use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class ZWaveWakeUpCommandClass method getIntervalMessage.
/**
* Gets a SerialMessage with the WAKE UP INTERVAL GET command
*
* @return the serial message
*/
public SerialMessage getIntervalMessage() {
if (isGetSupported == false) {
logger.debug("NODE {}: Node doesn't support get requests", this.getNode().getNodeId());
return null;
}
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.Config);
byte[] newPayload = { (byte) this.getNode().getNodeId(), 2, (byte) getCommandClass().getKey(), (byte) WAKE_UP_INTERVAL_GET };
result.setMessagePayload(newPayload);
return result;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class ZWaveMultiLevelSensorCommandClass method getMessage.
/**
* Gets a SerialMessage with the SENSOR_MULTI_LEVEL_GET command
*
* @param sensorType the {@link SensorType} to get the value for.
* @return the serial message
*/
public SerialMessage getMessage(SensorType sensorType) {
if (isGetSupported == false) {
logger.debug("NODE {}: Node doesn't support get requests for MULTI_LEVEL_SENSOR", this.getNode().getNodeId());
return null;
}
logger.debug("NODE {}: Creating new message for command SENSOR_MULTI_LEVEL_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(), 3, (byte) getCommandClass().getKey(), (byte) SENSOR_MULTI_LEVEL_GET, (byte) sensorType.getKey() };
result.setMessagePayload(newPayload);
return result;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class ZWaveMultiLevelSensorCommandClass method getSupportedValueMessage.
/**
* Gets a SerialMessage with the SENSOR_MULTI_LEVEL_SUPPORTED_GET command
*
* @return the serial message
*/
public SerialMessage getSupportedValueMessage() {
logger.debug("NODE {}: Creating new message for command SENSOR_MULTI_LEVEL_SUPPORTED_GET", this.getNode().getNodeId());
SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessageClass.SendData, SerialMessageType.Request, SerialMessageClass.ApplicationCommandHandler, SerialMessagePriority.Config);
byte[] newPayload = { (byte) this.getNode().getNodeId(), 2, (byte) getCommandClass().getKey(), (byte) SENSOR_MULTI_LEVEL_SUPPORTED_GET };
result.setMessagePayload(newPayload);
return result;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class ZWaveMultiLevelSensorCommandClass method getValueMessage.
/**
* Gets a SerialMessage with the SENSOR_MULTI_LEVEL_GET command
*
* @return the serial message
*/
@Override
public SerialMessage getValueMessage() {
if (isGetSupported == false) {
logger.debug("NODE {}: Node doesn't support get requests", this.getNode().getNodeId());
return null;
}
// TODO: Why does this return???!!!???
if (this.getVersion() > 4) {
for (Map.Entry<SensorType, Sensor> entry : this.sensors.entrySet()) {
return this.getMessage(entry.getValue().getSensorType());
}
}
logger.debug("NODE {}: Creating new message for command SENSOR_MULTI_LEVEL_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_MULTI_LEVEL_GET };
result.setMessagePayload(newPayload);
return result;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class ZWaveMultiLevelSwitchCommandClass method setValueMessage.
/**
* Gets a SerialMessage with the SWITCH_MULTILEVEL_SET command
*
* @param the level to set. 0 is mapped to off, > 0 is mapped to on.
* @return the serial message
*/
@Override
public SerialMessage setValueMessage(int level) {
logger.debug("NODE {}: Creating new message for command SWITCH_MULTILEVEL_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(), 3, (byte) getCommandClass().getKey(), (byte) SWITCH_MULTILEVEL_SET, (byte) level };
result.setMessagePayload(newPayload);
return result;
}
Aggregations