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

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


  private boolean isServerPresent = false;
  private boolean isRealPrimary = false;
  private boolean isSUC = false;

  public SerialMessage doRequest() {
    return new SerialMessage(SerialMessageClass.GetControllerCapabilities, SerialMessageType.Request, SerialMessageClass.GetControllerCapabilities, SerialMessagePriority.High);
  }
View Full Code Here


  public SerialMessage doRequest(int nodeId) {
    logger.debug("NODE {}: Deleting return routes", nodeId);

    // Queue the request
    SerialMessage newMessage = new SerialMessage(SerialMessageClass.DeleteReturnRoute, SerialMessageType.Request,
        SerialMessageClass.DeleteReturnRoute, SerialMessagePriority.High);
    byte[] newPayload = { (byte) nodeId };
    newMessage.setMessagePayload(newPayload);

      return newMessage;
  }
View Full Code Here

    if (following == 0 && group == updateAssociationsNode) {
      // This is the end of this group and the current 'get all groups' node
      // so we need to request the next group
      if(updateAssociationsNode < maxGroups){
        updateAssociationsNode++;
        SerialMessage outputMessage = getAssociationMessage(updateAssociationsNode);
        if(outputMessage != null)
          this.getController().sendData(outputMessage);
      } else {
        logger.debug("NODE {}: All association groups acquired.", this.getNode().getNodeId());
        //we have reached our maxNodes, notify listeners we are done.
View Full Code Here

    maxGroups = serialMessage.getMessagePayloadByte(offset + 1);
    logger.debug("NODE {} processGroupingsReport number of groups {}", getNode().getNodeId(), maxGroups);
    //Start the process to query these nodes
    updateAssociationsNode = 1;
    configAssociations.clear();
    SerialMessage sm = getAssociationMessage(updateAssociationsNode);
    if(sm != null)
      this.getController().sendData(sm);
  }
View Full Code Here

  public SerialMessage doRequest(int nodeId) {
    logger.debug("NODE {}: Marking node as having failed.", nodeId);

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

   * @return the serial message
   */
  public SerialMessage setAssociationMessage(int group, int node) {
    logger.debug("NODE {}: Creating new message for application command ASSOCIATIONCMD_SET", this.getNode()
        .getNodeId());
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData,
        SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Set);

    byte[] newPayload = { (byte) this.getNode().getNodeId(), 4, (byte) getCommandClass().getKey(),
        (byte) ASSOCIATIONCMD_SET, (byte) (group & 0xff), (byte) (node & 0xff) };

    result.setMessagePayload(newPayload);
    return result;
  }
View Full Code Here

   * @return the serial message
   */
  public SerialMessage removeAssociationMessage(int group, int node) {
    logger.debug("NODE {}: Creating new message for application command ASSOCIATIONCMD_REMOVE", this.getNode()
        .getNodeId());
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData,
        SerialMessageType.Request, SerialMessageClass.SendData, SerialMessagePriority.Set);

    byte[] newPayload = { (byte) this.getNode().getNodeId(), 4, (byte) getCommandClass().getKey(),
        (byte) ASSOCIATIONCMD_REMOVE, (byte) (group & 0xff), (byte) (node & 0xff) };

    result.setMessagePayload(newPayload);
    return result;
  }
View Full Code Here

   * @return the serial message
   */
  public SerialMessage getAssociationMessage(int group) {
    logger.debug("NODE {}: Creating new message for application command ASSOCIATIONCMD_GET group {}", this.getNode()
        .getNodeId(), group);
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData,
        SerialMessageType.Request, SerialMessageClass.ApplicationCommandHandler, SerialMessagePriority.Get);
    byte[] newPayload = { (byte) this.getNode().getNodeId(), 3, (byte) getCommandClass().getKey(),
        (byte) ASSOCIATIONCMD_GET, (byte) (group & 0xff) };
    result.setMessagePayload(newPayload);
    return result;
  }
View Full Code Here

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

   * requests the next group. This continues until we reach the maximum
   * number of group the device reports to us or until the device returns
   * a group with no members.
   */
  public void getAllAssociations() {
    SerialMessage serialMessage = getGroupingsMessage();
    if(serialMessage != null)
      this.getController().sendData(serialMessage);
  }
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.