Examples of ZWaveCommandClassDynamicState


Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClassDynamicState

    for (ZWaveCommandClass zwaveCommandClass : node.getCommandClasses()) {
      logger.trace("NODE {}: Inspecting command class {}", node.getNodeId(), zwaveCommandClass.getCommandClass().getLabel());
      if (zwaveCommandClass instanceof ZWaveCommandClassDynamicState) {
        logger.debug("NODE {}: Found dynamic state command class {}", node.getNodeId(), zwaveCommandClass.getCommandClass()
            .getLabel());
        ZWaveCommandClassDynamicState zdds = (ZWaveCommandClassDynamicState) zwaveCommandClass;
        int instances = zwaveCommandClass.getInstances();
        if (instances == 0) {
          Collection<SerialMessage> dynamicQueries = zdds.getDynamicValues();
          for (SerialMessage serialMessage : dynamicQueries) {
            sendData(serialMessage);
          }
        } else {
          for (int i = 1; i <= instances; i++) {
            Collection<SerialMessage> dynamicQueries = zdds.getDynamicValues();
            for (SerialMessage serialMessage : dynamicQueries) {
              sendData(node.encapsulate(serialMessage, zwaveCommandClass, i));
            }
          }
        }
      } else if (zwaveCommandClass instanceof ZWaveMultiInstanceCommandClass) {
        ZWaveMultiInstanceCommandClass multiInstanceCommandClass = (ZWaveMultiInstanceCommandClass) zwaveCommandClass;
        for (ZWaveEndpoint endpoint : multiInstanceCommandClass.getEndpoints()) {
          for (ZWaveCommandClass endpointCommandClass : endpoint.getCommandClasses()) {
            logger.trace(String.format("NODE %d: Inspecting command class %s for endpoint %d", node.getNodeId(), endpointCommandClass
                .getCommandClass().getLabel(), endpoint.getEndpointId()));
            if (endpointCommandClass instanceof ZWaveCommandClassDynamicState) {
              logger.debug("NODE {}: Found dynamic state command class {}", node.getNodeId(), endpointCommandClass
                  .getCommandClass().getLabel());
              ZWaveCommandClassDynamicState zdds2 = (ZWaveCommandClassDynamicState) endpointCommandClass;
              Collection<SerialMessage> dynamicQueries = zdds2.getDynamicValues();
              for (SerialMessage serialMessage : dynamicQueries) {
                sendData(node.encapsulate(serialMessage,
                    endpointCommandClass, endpoint.getEndpointId()));
              }
            }
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveCommandClassDynamicState

        for (ZWaveCommandClass zwaveCommandClass : this.node.getCommandClasses()) {
          logger.trace("NODE {}: Inspecting command class {}", this.node.getNodeId(), zwaveCommandClass.getCommandClass().getLabel());
          if (zwaveCommandClass instanceof ZWaveCommandClassDynamicState) {
            logger.debug("NODE {}: Found dynamic state command class {}", this.node.getNodeId(), zwaveCommandClass.getCommandClass()
                .getLabel());
            ZWaveCommandClassDynamicState zdds = (ZWaveCommandClassDynamicState) zwaveCommandClass;
            int instances = zwaveCommandClass.getInstances();
            if (instances == 0) {
              Collection<SerialMessage> dynamicQueries = zdds.getDynamicValues();
              for (SerialMessage serialMessage : dynamicQueries) {
                this.controller.sendData(serialMessage);
                queriesPending++;
              }
            } else {
              for (int i = 1; i <= instances; i++) {
                Collection<SerialMessage> dynamicQueries = zdds.getDynamicValues();
                for (SerialMessage serialMessage : dynamicQueries) {
                  this.controller
                      .sendData(this.node.encapsulate(serialMessage, zwaveCommandClass, i));
                  queriesPending++;
                }
              }
            }
          } else if (zwaveCommandClass instanceof ZWaveMultiInstanceCommandClass) {
            ZWaveMultiInstanceCommandClass multiInstanceCommandClass = (ZWaveMultiInstanceCommandClass) zwaveCommandClass;
            for (ZWaveEndpoint endpoint : multiInstanceCommandClass.getEndpoints()) {
              for (ZWaveCommandClass endpointCommandClass : endpoint.getCommandClasses()) {
                logger.trace(String.format("NODE %d: Inspecting command class %s for endpoint %d", this.node.getNodeId(), endpointCommandClass
                    .getCommandClass().getLabel(), endpoint.getEndpointId()));
                if (endpointCommandClass instanceof ZWaveCommandClassDynamicState) {
                  logger.debug("NODE {}: Found dynamic state command class {}", this.node.getNodeId(), endpointCommandClass
                      .getCommandClass().getLabel());
                  ZWaveCommandClassDynamicState zdds2 = (ZWaveCommandClassDynamicState) endpointCommandClass;
                  Collection<SerialMessage> dynamicQueries = zdds2.getDynamicValues();
                  for (SerialMessage serialMessage : dynamicQueries) {
                    this.controller.sendData(this.node.encapsulate(serialMessage,
                        endpointCommandClass, endpoint.getEndpointId()));
                    queriesPending++;
                  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.