Package com.dalsemi.onewire.container

Examples of com.dalsemi.onewire.container.OneWireContainer


        throws InvalidPluginConfigurationException, Exception {

        DSPortAdapter adapter = context.getParentResourceComponent().getAdapter();
        Set<DiscoveredResourceDetails> results = new HashSet<DiscoveredResourceDetails>();

        OneWireContainer cont = adapter.getFirstDeviceContainer();
        while (cont != null) {
            if (cont instanceof OneWireContainer10) {

                String descr = cont.getDescription();
                if (descr.length() > 50) { // Shorten. The device can have a really long description
                    int pos = descr.indexOf(".");
                    if (pos > 0) {
                        descr = descr.substring(0, pos);
                        descr += "...";
                    }
                }

                DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), // Resource type
                    cont.getAddressAsString(), // unique address from device
                    cont.getName(), // the typ of device
                    "", // version
                    descr, // description
                    context.getDefaultPluginConfiguration(), // plugin config
                    null); // no physical info
View Full Code Here


    @SuppressWarnings("unchecked")
    private String getIdForAdapter(DSPortAdapter adapter) throws OneWireIOException, OneWireException {

        Enumeration<OneWireContainer> devices = adapter.getAllDeviceContainers();
        while (devices.hasMoreElements()) {
            OneWireContainer cont = devices.nextElement();
            String name = cont.getName();
            if ("DS1990A".equals(name) || "DS2401".equals(name) || "DS2411".equals(name)) {
                // TODO check for family code of 0x81 in case we have more then one of those devices on the bus
                return cont.getAddressAsString();
            }
        }
        log.warn("Was not able to get a unique adapter name");
        return adapter.getAdapterName();
View Full Code Here

        if (!next) {
            LOG.severe("Could not find any iButtons!");
            return false;
        }
        while (next) {
            OneWireContainer owc = dsDevice.getDeviceContainer();
            if (checkOneWireContainer(owc)) {
                LOG.info("= This container " + owc.getAddressAsString() + " is changed ");
            } else {
                //LOG.info("= This container isn't changed ");
            }
            next = dsDevice.findNextDevice();
        }
View Full Code Here

TOP

Related Classes of com.dalsemi.onewire.container.OneWireContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.