Package org.openhab.binding.zwave.internal.protocol.ZWaveDeviceClass

Examples of org.openhab.binding.zwave.internal.protocol.ZWaveDeviceClass.Generic


      logger.error(String.format("NODE %d: Basic device class 0x%02x not found", nodeId, incomingMessage.getMessagePayloadByte(3)));
      return false;
    }
    logger.debug(String.format("NODE %d: Basic = %s 0x%02x", nodeId, basic.getLabel(), basic.getKey()));

    Generic generic = Generic.getGeneric(incomingMessage.getMessagePayloadByte(4));
    if (generic == null) {
      logger.error(String.format("NODE %d: Generic device class 0x%02x not found", nodeId, incomingMessage.getMessagePayloadByte(4)));
      return false;
    }
    logger.debug(String.format("NODE %d: Generic = %s 0x%02x", nodeId, generic.getLabel(), generic.getKey()));

    Specific specific = Specific.getSpecific(generic, incomingMessage.getMessagePayloadByte(5));
    if (specific == null) {
      logger.error(String.format("NODE %d: Specific device class 0x%02x not found", nodeId, incomingMessage.getMessagePayloadByte(5)));
      return false;
    }
    logger.debug(String.format("NODE %d: Specific = %s 0x%02x", nodeId, specific.getLabel(), specific.getKey()));
   
    ZWaveDeviceClass deviceClass = node.getDeviceClass();
    deviceClass.setBasicDeviceClass(basic);
    deviceClass.setGenericDeviceClass(generic);
    deviceClass.setSpecificDeviceClass(specific);
   
    // Add all the command classes.
    // If restored the node from configuration file then
    // the classes will already exist and this will be ignored

    // Add mandatory command classes as specified by it's generic device class.
    for (CommandClass commandClass : generic.getMandatoryCommandClasses()) {
      ZWaveCommandClass zwaveCommandClass = ZWaveCommandClass.getInstance(commandClass.getKey(), node, zController);
      if (zwaveCommandClass != null)
        zController.getNode(nodeId).addCommandClass(zwaveCommandClass);
    }
View Full Code Here


        logger.error("Endpoint {} not found on node {}. Cannot set command classes.", endpointId, this.getNode().getNodeId());
        continue;
      }
 
      Basic basic = this.getNode().getDeviceClass().getBasicDeviceClass();
      Generic generic = Generic.getGeneric(genericDeviceClass);
      if (generic == null) {
        logger.error(String.format("NODE %d: Endpoint %d has invalid device class. generic = 0x%02x, specific = 0x%02x.",
            this.getNode().getNodeId(), endpoint, genericDeviceClass, specificDeviceClass));
        continue;
      }
      Specific specific = Specific.getSpecific(generic, specificDeviceClass);
      if (specific == null) {
        logger.error(String.format("NODE %d: Endpoint %d has invalid device class. generic = 0x%02x, specific = 0x%02x.",
            this.getNode().getNodeId(), endpoint, genericDeviceClass, specificDeviceClass));
        continue;
      }
     
      logger.debug("NODE {}: Endpoint Id = {}", this.getNode().getNodeId(), endpointId);
      logger.debug("NODE {}: Endpoints is dynamic = {}", this.getNode().getNodeId(), dynamic ? "true" : false);
      logger.debug(String.format("NODE %d: Basic = %s 0x%02x", this.getNode().getNodeId(), basic.getLabel(), basic.getKey()));
      logger.debug(String.format("NODE %d: Generic = %s 0x%02x", this.getNode().getNodeId(), generic.getLabel(), generic.getKey()));
      logger.debug(String.format("NODE %d: Specific = %s 0x%02x", this.getNode().getNodeId(), specific.getLabel(), specific.getKey()));
     
      ZWaveDeviceClass deviceClass = endpoint.getDeviceClass();
      deviceClass.setBasicDeviceClass(basic);
      deviceClass.setGenericDeviceClass(generic);
View Full Code Here

TOP

Related Classes of org.openhab.binding.zwave.internal.protocol.ZWaveDeviceClass.Generic

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.