use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer 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());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ManagementBindResponseTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 00 01 00 01 43 1D A5 00 AA 3E B0 7C 03 06 00 03 62 39 05 0D 00 6F 0D 00 01");
ManagementBindResponse response = new ManagementBindResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
response.deserialize(fieldDeserializer);
System.out.println(response);
assertEquals(1, (int) response.getBindingTableEntries());
assertEquals(0, (int) response.getStartIndex());
List<BindingTable> table = response.getBindingTableList();
assertEquals(1, table.size());
BindingTable entry = table.get(0);
assertEquals(6, entry.getClusterId());
assertEquals(3, entry.getDstAddrMode());
assertEquals(new IeeeAddress("7CB03EAA00A51D43"), entry.getSrcAddr());
assertEquals(3, entry.getSrcEndpoint());
assertEquals(new IeeeAddress("000D6F000D053962"), entry.getDstNodeAddr());
assertEquals(1, entry.getDstNodeEndpoint());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ManagementRoutingResponseTest method testReceive.
@Test
public void testReceive() {
// Short response - ie not extended
int[] packet = getPacketData("00 00 01 00 01 2A 2F 00 35 38");
ManagementRoutingResponse routingResponse = new ManagementRoutingResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
routingResponse.deserialize(fieldDeserializer);
System.out.println(routingResponse);
assertEquals(1, (int) routingResponse.getRoutingTableEntries());
assertEquals(0, (int) routingResponse.getStartIndex());
List<RoutingTable> routes = routingResponse.getRoutingTableList();
assertEquals(1, routes.size());
assertEquals(12074, (int) routes.get(0).getDestinationAddress());
assertEquals(14389, (int) routes.get(0).getNextHopAddress());
assertEquals(DiscoveryState.ACTIVE, routes.get(0).getStatus());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class MatchDescriptorRequestTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("2E FD FF 04 01 00 01 00 05");
MatchDescriptorRequest request = new MatchDescriptorRequest();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
request.deserialize(fieldDeserializer);
System.out.println(request);
assertEquals(Integer.valueOf(65533), request.getNwkAddrOfInterest());
assertEquals(Integer.valueOf(260), request.getProfileId());
assertEquals(0, request.getInClusterList().size());
assertEquals(1, request.getOutClusterList().size());
assertEquals(Integer.valueOf(1280), request.getOutClusterList().get(0));
}
Aggregations