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

Examples of org.openhab.binding.zwave.internal.protocol.SerialMessage$SerialMessageComparator


    if(setpointType == null) {
      return null;
    }

    logger.debug("NODE {}: Creating new message for application command THERMOSTAT_SETPOINT_GET", this.getNode().getNodeId());
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Get);
    byte[] payload = {
        (byte) this.getNode().getNodeId(),
        3,
        (byte) getCommandClass().getKey(),
        THERMOSTAT_SETPOINT_GET,
        (byte) setpointType.getKey()
    };
    result.setMessagePayload(payload);
    return result;
  }
View Full Code Here


   * @return the serial message, or null if the supported command is not supported.
   */
  public SerialMessage getSupportedMessage() {
    logger.debug("NODE {}: Creating new message for application command THERMOSTAT_SETPOINT_SUPPORTED_GET", this.getNode().getNodeId());
   
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.ApplicationCommandHandler, SerialMessagePriority.High);
      byte[] newPayload = {   (byte) this.getNode().getNodeId(),
                  2,
                (byte) getCommandClass().getKey(),
                (byte) THERMOSTAT_SETPOINT_SUPPORTED_GET };
      result.setMessagePayload(newPayload);
      return result;   
  }
View Full Code Here

  public SerialMessage doRequest(int nodeId, int destinationId, int callbackId) {
    logger.debug("NODE {}: Assigning return route to node {}", nodeId, destinationId);

    // Queue the request
    SerialMessage newMessage = new SerialMessage(SerialMessageClass.AssignReturnRoute, SerialMessageType.Request,
        SerialMessageClass.AssignReturnRoute, SerialMessagePriority.High);
    byte[] newPayload = { (byte) nodeId, (byte) destinationId, (byte) callbackId };
    newMessage.setMessagePayload(newPayload);
      return newMessage;
  }
View Full Code Here

   * @param setpoint the setpoint to set.
   * @return the serial message
   */
  public SerialMessage setMessage(int scale, SetpointType setpointType, BigDecimal setpoint) {
    logger.debug("NODE {}: Creating new message for application command THERMOSTAT_SETPOINT_SET", this.getNode().getNodeId());
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Set);

    try
    {
      byte[] encodedValue = encodeValue(setpoint);
     
      byte[] payload = ArrayUtils.addAll(
        new byte[] {
          (byte) this.getNode().getNodeId(),
          (byte) (3 + encodedValue.length),
          (byte) getCommandClass().getKey(),
          THERMOSTAT_SETPOINT_SET,
          (byte) setpointType.getKey()
        },
        encodedValue
      );
      // Add the scale
      payload[5] += (byte)(scale << 3);
     
      result.setMessagePayload(payload);
      return result;
    } catch (ArithmeticException e) {
      logger.error("NODE {}: Got an arithmetic exception converting value {} to a valid Z-Wave value. Ignoring THERMOSTAT_SETPOINT_SET message.", this.getNode().getNodeId(), setpoint);
      return null;
    }
View Full Code Here

   */
  @Override
  public void executeRefresh(ZWaveNode node,
      ZWaveBasicCommandClass commandClass, int endpointId, Map<String,String> arguments) {
    logger.debug("Generating poll message for {} for node {} endpoint {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
    SerialMessage serialMessage = node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId);
   
    if (serialMessage == null) {
      logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
      return;
    }
View Full Code Here

    if (converter == null) {
      logger.warn("No converter found for item = {}, node = {} endpoint = {}, ignoring command.", item.getName(), node.getNodeId(), endpointId);
      return;
    }
   
    SerialMessage serialMessage = node.encapsulate(commandClass.setValueMessage((Integer)converter.convertFromCommandToValue(item, command)), commandClass, endpointId);
   
    if (serialMessage == null) {
      logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
      return;
    }
View Full Code Here

   */
  @Override
  public void executeRefresh(ZWaveNode node,
      ZWaveBinarySensorCommandClass commandClass, int endpointId, Map<String,String> arguments) {
    logger.debug("Generating poll message for {} for node {} endpoint {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
    SerialMessage serialMessage = node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId);
   
    if (serialMessage == null) {
      logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
      return;
    }
View Full Code Here

   */
  @Override
  public void executeRefresh(ZWaveNode node,
      ZWaveBinarySwitchCommandClass commandClass, int endpointId, Map<String,String> arguments) {
    logger.debug("Generating poll message for {} for node {} endpoint {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
    SerialMessage serialMessage = node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId);
   
    if (serialMessage == null) {
      logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
      return;
    }
View Full Code Here

    if (converter == null) {
      logger.warn("No converter found for item = {}, node = {} endpoint = {}, ignoring command.", item.getName(), node.getNodeId(), endpointId);
      return;
    }
   
    SerialMessage serialMessage = node.encapsulate(commandClass.setValueMessage((Integer)converter.convertFromCommandToValue(item, command)), commandClass, endpointId);
   
    if (serialMessage == null) {
      logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
      return;
    }
View Full Code Here

   */
  @Override
  public void executeRefresh(ZWaveNode node,
      ZWaveMultiLevelSwitchCommandClass commandClass, int endpointId, Map<String,String> arguments) {
    logger.debug("Generating poll message for {} for node {} endpoint {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
    SerialMessage serialMessage = node.encapsulate(commandClass.getValueMessage(), commandClass, endpointId);
   
    if (serialMessage == null) {
      logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);
      return;
    }
View Full Code Here

TOP

Related Classes of org.openhab.binding.zwave.internal.protocol.SerialMessage$SerialMessageComparator

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.