use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class NetworkAddressResponseTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 00 43 1D A5 00 AA 3E B0 7C 74 3B");
NetworkAddressResponse addressResponse = new NetworkAddressResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
addressResponse.deserialize(fieldDeserializer);
System.out.println(addressResponse);
assertEquals(new IeeeAddress("7CB03EAA00A51D43"), addressResponse.getIeeeAddrRemoteDev());
assertEquals(0x8000, (int) addressResponse.getClusterId());
assertEquals(ZdoStatus.SUCCESS, addressResponse.getStatus());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class PowerDescriptorResponseTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 00 00 00 10 C1");
PowerDescriptorResponse descriptorResponse = new PowerDescriptorResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
descriptorResponse.deserialize(fieldDeserializer);
System.out.println(descriptorResponse);
PowerDescriptor powerDescriptor = descriptorResponse.getPowerDescriptor();
assertEquals(ZdoStatus.SUCCESS, descriptorResponse.getStatus());
assertEquals(PowerLevelType.FULL, powerDescriptor.getPowerLevel());
assertEquals(CurrentPowerModeType.RECEIVER_ON_IDLE, powerDescriptor.getCurrentPowerMode());
assertEquals(PowerSourceType.MAINS, powerDescriptor.getCurrentPowerSource());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class SimpleDescriptorResponseTest method testReceive.
@Test
public void testReceive() {
int[] packet = getPacketData("00 00 00 00 14 01 04 01 00 00 00 03 00 00 01 00 06 00 03 00 00 01 00 06 00");
SimpleDescriptorResponse descriptorResponse = new SimpleDescriptorResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
descriptorResponse.deserialize(fieldDeserializer);
System.out.println(descriptorResponse);
SimpleDescriptor simpleDescriptor = descriptorResponse.getSimpleDescriptor();
assertEquals(ZdoStatus.SUCCESS, descriptorResponse.getStatus());
assertEquals(0, (int) descriptorResponse.getNwkAddrOfInterest());
assertEquals(1, simpleDescriptor.getEndpoint());
assertEquals(0x104, simpleDescriptor.getProfileId());
assertEquals(3, simpleDescriptor.getInputClusterList().size());
assertTrue(simpleDescriptor.getInputClusterList().contains(0));
assertTrue(simpleDescriptor.getInputClusterList().contains(1));
assertTrue(simpleDescriptor.getInputClusterList().contains(6));
assertEquals(3, simpleDescriptor.getOutputClusterList().size());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ConfigureReportingResponseTest method test.
@Test
public void test() {
int[] packet = getPacketData("18 1B 07 00 00 00 00");
ConfigureReportingResponse response = new ConfigureReportingResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
response.deserialize(fieldDeserializer);
System.out.println(response);
assertNull(response.getStatus());
assertEquals(1, response.getRecords().size());
AttributeStatusRecord record = response.getRecords().get(0);
assertEquals(0, record.getAttributeIdentifier());
assertEquals(ZclStatus.SUCCESS, record.getStatus());
}
use of com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer in project com.zsmartsystems.zigbee by zsmartsystems.
the class ConfigureReportingResponseTest method testStatusOnly.
@Test
public void testStatusOnly() {
int[] packet = getPacketData("18 11 07 00");
ConfigureReportingResponse response = new ConfigureReportingResponse();
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
ZclFieldDeserializer fieldDeserializer = new ZclFieldDeserializer(deserializer);
ZclHeader zclHeader = new ZclHeader(fieldDeserializer);
System.out.println(zclHeader);
response.deserialize(fieldDeserializer);
System.out.println(response);
assertEquals(ZclStatus.SUCCESS, response.getStatus());
assertNull(response.getRecords());
}
Aggregations