use of com.zsmartsystems.zigbee.ExtendedPanId in project com.zsmartsystems.zigbee by zsmartsystems.
the class DefaultSerializerTest method testSerialize_EXTENDED_PANID.
@Test
public void testSerialize_EXTENDED_PANID() {
ExtendedPanId valIn = new ExtendedPanId("1234567890123456");
int[] valOut = { 0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12 };
testSerializedData(valIn, valOut, ZclDataType.EXTENDED_PANID);
}
use of com.zsmartsystems.zigbee.ExtendedPanId in project com.zsmartsystems.zigbee by zsmartsystems.
the class NeighborTableTest method testDeserialize.
@Test
public void testDeserialize() {
int[] packet = getPacketData("B1 68 DE 3A 00 00 00 00 86 06 00 00 00 EE 1F 00 A9 44 25 02 0F E2");
DefaultDeserializer deserializer = new DefaultDeserializer(packet);
NeighborTable neighbor = new NeighborTable();
neighbor.deserialize(deserializer);
assertEquals(LogicalType.ROUTER, neighbor.getDeviceType());
assertEquals(new IeeeAddress("001FEE0000000686"), neighbor.getExtendedAddress());
assertEquals(new ExtendedPanId("3ADE68B1"), neighbor.getExtendedPanId());
assertEquals(NeighborTableRelationship.SIBLING, neighbor.getRelationship());
assertEquals(Integer.valueOf(17577), neighbor.getNetworkAddress());
assertEquals(NeighborTableJoining.UNKNOWN, neighbor.getPermitJoining());
assertEquals(NeighborTableRxState.RX_ON, neighbor.getRxOnWhenIdle());
assertEquals(Integer.valueOf(15), neighbor.getDepth());
assertEquals(Integer.valueOf(226), neighbor.getLqi());
}
use of com.zsmartsystems.zigbee.ExtendedPanId in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisActiveScanCommandTest method test.
@Test
public void test() {
TelegesisActiveScanCommand command = new TelegesisActiveScanCommand();
command.setChannelMask(0xFFF0);
System.out.println(command);
assertEquals("AT+PANSCAN:FFF0\r\n", intArrayToString(command.serialize()));
command.deserialize(stringToIntArray("+PANSCAN:11,2001,000000003ADE68B1,02,00\r"));
System.out.println(command);
command.deserialize(stringToIntArray("+PANSCAN:19,9D12,BD42FE090EEE14CA,02,00\r"));
System.out.println(command);
command.deserialize(stringToIntArray("OK\r"));
System.out.println(command);
assertEquals(2, command.getScanResults().size());
assertEquals(TelegesisStatusCode.SUCCESS, command.getStatus());
ScanResult result;
Iterator<ScanResult> resultIterator = command.getScanResults().iterator();
result = resultIterator.next();
assertEquals(Integer.valueOf(11), result.getChannel());
assertEquals(Integer.valueOf(0x2001), result.getPanId());
assertEquals(new ExtendedPanId("000000003ADE68B1"), result.getEpanId());
assertEquals(Integer.valueOf(2), result.getProfileId());
assertEquals(false, result.getJoiningEnabled());
result = resultIterator.next();
assertEquals(Integer.valueOf(19), result.getChannel());
assertEquals(Integer.valueOf(0x9D12), result.getPanId());
assertEquals(new ExtendedPanId("BD42FE090EEE14CA"), result.getEpanId());
assertEquals(Integer.valueOf(2), result.getProfileId());
assertEquals(false, result.getJoiningEnabled());
}
use of com.zsmartsystems.zigbee.ExtendedPanId in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisDisplayNetworkInformationCommandTest method test.
@Test
public void test() {
TelegesisDisplayNetworkInformationCommand command = new TelegesisDisplayNetworkInformationCommand();
System.out.println(command);
assertEquals("AT+N?\r\n", intArrayToString(command.serialize()));
command.deserialize(stringToIntArray("+N=FFD,18,5,1234,1234567890ABCDEF"));
System.out.println(command);
assertEquals(Integer.valueOf(18), command.getChannel());
assertEquals(Integer.valueOf(5), command.getPower());
assertEquals(Integer.valueOf(0x1234), command.getPanId());
assertEquals(new ExtendedPanId("1234567890ABCDEF"), command.getEpanId());
}
use of com.zsmartsystems.zigbee.ExtendedPanId in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisGetEpanIdCommandTest method testOk.
@Test
public void testOk() {
TelegesisGetEpanIdCommand command = new TelegesisGetEpanIdCommand();
System.out.println(command);
assertEquals("ATS03?\r\n", intArrayToString(command.serialize()));
assertFalse(command.deserialize(stringToIntArray("1234567890ABCDEF\r")));
System.out.println(command);
assertTrue(command.deserialize(stringToIntArray("OK\r")));
System.out.println(command);
assertEquals(new ExtendedPanId("1234567890ABCDEF"), command.getEpanId());
assertEquals(TelegesisStatusCode.SUCCESS, command.getStatus());
}
Aggregations