Package org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClass

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClass.CommandClass


   * Does nothing if command class is already added.
   * @param commandClass the command class instance to add.
   */
  public void addCommandClass(ZWaveCommandClass commandClass)
  {
    CommandClass key = commandClass.getCommandClass();
   
    if (!supportedCommandClasses.containsKey(key)) {
      logger.debug("NODE {}: Adding command class {} to the list of supported command classes.", nodeId, commandClass.getCommandClass().getLabel());
      supportedCommandClasses.put(key, commandClass);
     
View Full Code Here


   * Adds a command class to the list of supported command classes by this
   * endpoint. Does nothing if command class is already added.
   * @param commandClass the command class instance to add.
   */
  public void addCommandClass(ZWaveCommandClass commandClass) {
    CommandClass key = commandClass.getCommandClass();

    if (!supportedCommandClasses.containsKey(key))
      supportedCommandClasses.put(key, commandClass);
  }
View Full Code Here

   
    node.resetResendCount();
    node.incrementReceiveCount();
   
    int commandClassCode = incomingMessage.getMessagePayloadByte(3);
    CommandClass commandClass = CommandClass.getCommandClass(commandClassCode);

    if (commandClass == null) {
      logger.error(String.format("NODE %d: Unsupported command class 0x%02x", nodeId, commandClassCode));
      return false;
    }

    logger.debug(String.format("NODE %d: Incoming command class %s (0x%02x)", nodeId, commandClass.getLabel(), commandClass.getKey()));
    ZWaveCommandClass zwaveCommandClass =  node.getCommandClass(commandClass);
   
    // Apparently, this node supports a command class that we did not get (yet) during initialization.
    // Let's add it now then to support handling this message.
    if (zwaveCommandClass == null) {
      logger.debug(String.format("NODE %d: Command class %s (0x%02x) not found, trying to add it.",
          nodeId, commandClass.getLabel(), commandClass.getKey()));
     
      zwaveCommandClass = ZWaveCommandClass.getInstance(commandClass.getKey(), node, zController);
     
      if (zwaveCommandClass != null) {
        logger.debug(String.format("NODE %d: Adding command class %s (0x%02x)", nodeId, commandClass.getLabel(), commandClass.getKey()));
        node.addCommandClass(zwaveCommandClass);
      }
    }
   
    // We got an unsupported command class, return.
    if (zwaveCommandClass == null) {
      logger.error(String.format("NODE %d: Unsupported command class %s (0x%02x)", nodeId, commandClass.getLabel(), commandClassCode));
      return false;
    }
   
    logger.trace("NODE {}: Found Command Class {}, passing to handleApplicationCommandRequest", nodeId, zwaveCommandClass.getCommandClass().getLabel());
    zwaveCommandClass.handleApplicationCommandRequest(incomingMessage, 4, 0);
View Full Code Here

TOP

Related Classes of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClass.CommandClass

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.