use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class QueryNextImageCommandTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 0C 11 62 00 03 05 02 01");
QueryNextImageCommand command = new QueryNextImageCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(4364), command.getManufacturerCode());
assertEquals(Integer.valueOf(98), command.getImageType());
assertEquals(Integer.valueOf(0x1020503), command.getFileVersion());
assertNull(command.getHardwareVersion());
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class QueryNextImageCommandTest method testReceiveHwVersion.
@Test
public void testReceiveHwVersion() {
int[] packet = getPacketData("01 0C 11 62 00 03 05 02 01 33 44");
QueryNextImageCommand command = new QueryNextImageCommand();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
command.deserialize(fieldDeserializer);
System.out.println(command);
assertEquals(Integer.valueOf(4364), command.getManufacturerCode());
assertEquals(Integer.valueOf(98), command.getImageType());
assertEquals(Integer.valueOf(0x1020503), command.getFileVersion());
assertEquals(Integer.valueOf(0x4433), command.getHardwareVersion());
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ActiveEndpointsResponseTest method testReceive2.
@Test
public void testReceive2() {
int[] packet = getPacketData("00 00 BD 97 06 01 02 03 04 C8 E8");
ActiveEndpointsResponse endpointsResponse = new ActiveEndpointsResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
endpointsResponse.deserialize(fieldDeserializer);
System.out.println(endpointsResponse);
assertEquals(6, endpointsResponse.getActiveEpList().size());
assertEquals(0x8005, (int) endpointsResponse.getClusterId());
assertEquals(ZdoStatus.SUCCESS, endpointsResponse.getStatus());
assertEquals(0x97bd, (int) endpointsResponse.getNwkAddrOfInterest());
assertEquals(1, (int) endpointsResponse.getActiveEpList().get(0));
assertEquals(2, (int) endpointsResponse.getActiveEpList().get(1));
assertEquals(3, (int) endpointsResponse.getActiveEpList().get(2));
assertEquals(4, (int) endpointsResponse.getActiveEpList().get(3));
assertEquals(0xc8, (int) endpointsResponse.getActiveEpList().get(4));
assertEquals(0xe8, (int) endpointsResponse.getActiveEpList().get(5));
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class IeeeAddressResponseTest method testReceiveVeryShort.
@Test
public void testReceiveVeryShort() {
// Short response - ie not extended. This is from the Ember response!
int[] packet = getPacketData("00 00 42 CC 12 00 00 24 E5 7C AD B8");
IeeeAddressResponse addressResponse = new IeeeAddressResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
addressResponse.deserialize(fieldDeserializer);
System.out.println(addressResponse);
assertEquals(ZdoStatus.SUCCESS, addressResponse.getStatus());
assertEquals(new IeeeAddress("7CE524000012CC42"), addressResponse.getIeeeAddrRemoteDev());
assertEquals(Integer.valueOf(47277), addressResponse.getNwkAddrRemoteDev());
assertEquals(0x8001, (int) addressResponse.getClusterId());
}
use of com.zsmartsystems.zigbee.serialization.DefaultDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class IeeeAddressResponseTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 00 EC A1 A5 01 00 8D 15 00 35 38 00 01 2A 2F");
IeeeAddressResponse addressResponse = new IeeeAddressResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
addressResponse.deserialize(fieldDeserializer);
System.out.println(addressResponse);
assertEquals(new IeeeAddress("00158D0001A5A1EC"), addressResponse.getIeeeAddrRemoteDev());
assertEquals(0x8001, (int) addressResponse.getClusterId());
assertEquals(ZdoStatus.SUCCESS, addressResponse.getStatus());
}
Aggregations