use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class RemoveNodeMessageClass method doRequestStop.
public SerialMessage doRequestStop() {
logger.debug("Ending EXCLUSION mode.");
// Queue the request
SerialMessage newMessage = new SerialMessage(SerialMessage.SerialMessageClass.RemoveNodeFromNetwork, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.RemoveNodeFromNetwork, SerialMessage.SerialMessagePriority.High);
byte[] newPayload = { (byte) REMOVE_NODE_STOP };
newMessage.setMessagePayload(newPayload);
return newMessage;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class RemoveNodeMessageClass method doRequestStart.
public SerialMessage doRequestStart(boolean highPower) {
logger.debug("Setting controller into EXCLUSION mode.");
// Queue the request
SerialMessage newMessage = new SerialMessage(SerialMessage.SerialMessageClass.RemoveNodeFromNetwork, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.RemoveNodeFromNetwork, SerialMessage.SerialMessagePriority.High);
byte[] newPayload = { (byte) REMOVE_NODE_ANY, (byte) 255 };
newMessage.setMessagePayload(newPayload);
return newMessage;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class RequestNodeInfoMessageClass method doRequest.
public SerialMessage doRequest(int nodeId) {
SerialMessage newMessage = new SerialMessage(SerialMessageClass.RequestNodeInfo, SerialMessageType.Request, SerialMessageClass.ApplicationUpdate, SerialMessagePriority.High);
byte[] newPayload = { (byte) nodeId };
newMessage.setMessagePayload(newPayload);
return newMessage;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class SerialApiGetCapabilitiesMessageClass method handleResponse.
@Override
public boolean handleResponse(ZWaveController zController, SerialMessage lastSentMessage, SerialMessage incomingMessage) {
logger.trace("Handle Message Serial API Get Capabilities - Length {}", incomingMessage.getMessagePayload().length);
serialAPIVersion = String.format("%d.%d", incomingMessage.getMessagePayloadByte(0), incomingMessage.getMessagePayloadByte(1));
manufactureId = ((incomingMessage.getMessagePayloadByte(2)) << 8) | (incomingMessage.getMessagePayloadByte(3));
deviceType = ((incomingMessage.getMessagePayloadByte(4)) << 8) | (incomingMessage.getMessagePayloadByte(5));
deviceId = (((incomingMessage.getMessagePayloadByte(6)) << 8) | (incomingMessage.getMessagePayloadByte(7)));
logger.debug(String.format("API Version = %s", serialAPIVersion));
logger.debug(String.format("Manufacture ID = 0x%x", manufactureId));
logger.debug(String.format("Device Type = 0x%x", deviceType));
logger.debug(String.format("Device ID = 0x%x", deviceId));
// Print the list of messages supported by this controller
for (int by = 8; by < incomingMessage.getMessagePayload().length; by++) {
for (int bi = 0; bi < 8; bi++) {
if ((incomingMessage.getMessagePayloadByte(by) & (0x01 << bi)) != 0) {
SerialMessage.SerialMessageClass msgClass = SerialMessage.SerialMessageClass.getMessageClass(((by - 8) << 3) + bi + 1);
if (msgClass == null) {
logger.debug(String.format("Supports: Unknown Class 0x%02x", ((by - 8) << 3) + bi + 1));
} else {
logger.debug("Supports: {}", msgClass.getLabel());
}
}
}
}
checkTransactionComplete(lastSentMessage, incomingMessage);
return true;
}
use of org.openhab.binding.zwave.internal.protocol.SerialMessage in project openhab1-addons by openhab.
the class AssignSucReturnRouteMessageClass method doRequest.
public SerialMessage doRequest(int nodeId, int callbackId) {
logger.debug("NODE {}: Assigning SUC return route", nodeId);
// Queue the request
SerialMessage newMessage = new SerialMessage(SerialMessageClass.AssignSucReturnRoute, SerialMessageType.Request, SerialMessageClass.AssignSucReturnRoute, SerialMessagePriority.High);
byte[] newPayload = { (byte) nodeId, (byte) callbackId };
newMessage.setMessagePayload(newPayload);
return newMessage;
}
Aggregations