use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZoneEnrollRequestCommandTest method test.
@Test
public void test() {
int[] packet = getPacketData("09 63 01 0D 00 4E 10");
ZoneEnrollRequestCommand command = new ZoneEnrollRequestCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(0x500), command.getClusterId());
assertEquals(Integer.valueOf(13), command.getZoneType());
assertEquals(Integer.valueOf(4174), command.getManufacturerCode());
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ZoneStatusChangeNotificationCommandTest method test.
@Test
public void test() {
int[] packet = getPacketData("09 7B 00 24 00 00 00 00 00");
ZoneStatusChangeNotificationCommand command = new ZoneStatusChangeNotificationCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(0x500), command.getClusterId());
assertEquals(Integer.valueOf(36), command.getZoneStatus());
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class OffWithEffectCommandTest method deserialize.
@Test
public void deserialize() {
int[] packet = getPacketData("01 12 40 00 00");
OffWithEffectCommand command = new OffWithEffectCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(0), command.getEffectIdentifier());
assertEquals(Integer.valueOf(0), command.getEffectVariant());
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ActiveEndpointsResponseTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 00 00 00 01 01");
ActiveEndpointsResponse endpointsResponse = new ActiveEndpointsResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
endpointsResponse.deserialize(fieldDeserializer);
System.out.println(endpointsResponse);
assertEquals(1, endpointsResponse.getActiveEpList().size());
assertEquals(0x8005, (int) endpointsResponse.getClusterId());
assertEquals(ZdoStatus.SUCCESS, endpointsResponse.getStatus());
assertEquals(0, (int) endpointsResponse.getNwkAddrOfInterest());
assertEquals(1, (int) endpointsResponse.getActiveEpList().get(0));
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class IeeeAddressResponseTest method testReceiveShort.
@Test
public void testReceiveShort() {
// Short response - ie not extended. This is from the Ember response!
int[] packet = getPacketData("00 00 BF 32 17 00 00 A3 22 00 00 00 00");
IeeeAddressResponse addressResponse = new IeeeAddressResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
addressResponse.deserialize(fieldDeserializer);
System.out.println(addressResponse);
assertEquals(new IeeeAddress("0022A300001732BF"), addressResponse.getIeeeAddrRemoteDev());
assertEquals(0x8001, (int) addressResponse.getClusterId());
assertEquals(ZdoStatus.SUCCESS, addressResponse.getStatus());
}
Aggregations