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

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


   * Gets a SerialMessage with the WAKE UP INTERVAL GET command
   * @return the serial message
   */
  public SerialMessage getIntervalMessage() {
    logger.debug("NODE {}: Creating new message for application command WAKE_UP_INTERVAL_GET", 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) WAKE_UP_INTERVAL_GET };
      result.setMessagePayload(newPayload);
      return result;   
  }
View Full Code Here


   * Gets a SerialMessage with the WAKE UP INTERVAL CAPABILITIES GET command
   * @return the serial message
   */
  public SerialMessage getIntervalCapabilitiesMessage() {
    logger.debug("NODE {}: Creating new message for application command WAKE_UP_INTERVAL_CAPABILITIES_GET", 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) WAKE_UP_INTERVAL_CAPABILITIES_GET };
      result.setMessagePayload(newPayload);
      return result;   
  }
View Full Code Here

  @Override
  public void ZWaveIncomingEvent(ZWaveEvent event) {
    if (!(event instanceof ZWaveTransactionCompletedEvent))
      return;
   
    SerialMessage serialMessage = ((ZWaveTransactionCompletedEvent)event).getCompletedMessage();
   
    if (serialMessage.getMessageClass() != SerialMessageClass.SendData && serialMessage.getMessageType() != SerialMessageType.Request)
      return;
       
    byte[] payload = serialMessage.getMessagePayload();
   
    // Check if it's addressed to this node
    if (payload.length == 0 || (payload[0] & 0xFF) != this.getNode().getNodeId())
      return;
View Full Code Here

      logger.debug("NODE {}: Is awake with {} messages in the wake-up queue.", this.getNode().getNodeId(), this.wakeUpQueue.size());

      // Handle the wake-up queue for this node.
      // We send the first message, and when that's ACKed, we sent the next
      if (!this.wakeUpQueue.isEmpty()) {
        SerialMessage serialMessage = this.wakeUpQueue.poll();
        this.getController().sendData(serialMessage);
      }
      else {
        // No messages in the queue.
        // Start a timer to send the "Go To Sleep" message
View Full Code Here

   * @return the serial message
   * @author Chris Jackson
   */
  public SerialMessage setInterval(int interval) {
    logger.debug("NODE {}: Creating new message for application command WAKE_UP_INTERVAL_SET to {}", this.getNode().getNodeId(), interval);
    SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.ApplicationCommandHandler, SerialMessagePriority.Get);
      byte[] newPayload = {   (byte) this.getNode().getNodeId(),
                  6,
                (byte) getCommandClass().getKey(),
                (byte) WAKE_UP_INTERVAL_SET,
                (byte)(( interval >> 16 ) & 0xff),
                        (byte)(( interval >> 8 ) & 0xff),
                        (byte)( interval & 0xff ),
                        (byte) getController().getOwnNodeId()};
      result.setMessagePayload(newPayload);
      return result;   
  }
View Full Code Here

*/
public class SerialApiSoftResetMessageClass extends ZWaveCommandProcessor {
  private static final Logger logger = LoggerFactory.getLogger(SerialApiSoftResetMessageClass.class);
 
  public SerialMessage doRequest() {
    return new SerialMessage(SerialMessageClass.SerialApiSoftReset, SerialMessageType.Request, SerialMessageClass.SerialApiSoftReset, SerialMessagePriority.High);
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
  public SerialMessage getValueMessage() {
    logger.debug("NODE {}: Creating new message for application command THERMOSTAT_FAN_STATE_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(),
        2,
        (byte) getCommandClass().getKey(),
        THERMOSTAT_FAN_STATE_GET
    };
    result.setMessagePayload(payload);
    return result;
  }
View Full Code Here

 
  private String zWaveVersion = "Unknown";
  private int ZWaveLibraryType = 0;
 
  public SerialMessage doRequest() {
    return new SerialMessage(SerialMessageClass.GetVersion, SerialMessageType.Request, SerialMessageClass.GetVersion, SerialMessagePriority.High);
  }
View Full Code Here

   * Gets a SerialMessage with the SENSOR_BINARY_GET command
   * @return the serial message
   */
  public SerialMessage getValueMessage() {
    logger.debug("NODE {}: Creating new message for application command SENSOR_BINARY_GET", 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) SENSOR_BINARY_GET };
     
      // Should there be another byte here to specify the sensor type?
      // Looking at the RaZberry doc, it talks about requesting the sensor type
      // and using FF for the first sensor.
      // Maybe this is a V2 feature - need to find some docs on V2!
     
     
      result.setMessagePayload(newPayload);
      return result;   
  }
View Full Code Here

  private ArrayList<Integer>zwaveNodes = new ArrayList<Integer>();

  private static final int NODE_BYTES = 29; // 29 bytes = 232 bits, one for each supported node by Z-Wave;
 
  public SerialMessage doRequest() {
    return new SerialMessage(SerialMessageClass.SerialApiGetInitData, SerialMessageType.Request, SerialMessageClass.SerialApiGetInitData, SerialMessagePriority.High);
  }
View Full Code Here

TOP

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

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.