use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisReceiveUnicastEventTest method testRemoteAddress.
@Test
public void testRemoteAddress() {
TelegesisReceiveUnicastEvent event = new TelegesisReceiveUnicastEvent();
event.deserialize(stringToIntArray("UCAST:000D6F000005A666,04=test"));
System.out.println(event);
assertEquals(new IeeeAddress("000D6F000005A666"), event.getRemoteAddress());
assertTrue(Arrays.equals(stringToIntArray("test"), event.getMessageData()));
}
use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisRouteRecordMessageEventTest method test.
@Test
public void test() {
TelegesisRouteRecordMessageEvent event = new TelegesisRouteRecordMessageEvent();
event.deserialize(stringToIntArray("SR:03,1234567890ABCDEF,1234,5678,9ABC"));
System.out.println(event);
assertEquals(Integer.valueOf(3), event.getHops());
assertEquals(new IeeeAddress("1234567890ABCDEF"), event.getRemoteAddress());
}
use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisRouterAnnounceEventTest method testExtended.
@Test
public void testExtended() {
TelegesisRouterAnnounceEvent event = new TelegesisRouterAnnounceEvent();
event.deserialize(stringToIntArray("FFD:1234567890ABCDEF,9876,44,AA"));
System.out.println(event);
assertEquals(new IeeeAddress("1234567890ABCDEF"), event.getIeeeAddress());
assertEquals(Integer.valueOf(0x9876), event.getNetworkAddress());
assertEquals(Integer.valueOf(68), event.getRssi());
assertEquals(Integer.valueOf(0xAA), event.getLqi());
}
use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisRouterAnnounceEventTest method testBasic.
@Test
public void testBasic() {
TelegesisRouterAnnounceEvent event = new TelegesisRouterAnnounceEvent();
event.deserialize(stringToIntArray("FFD:1234567890ABCDEF,9876"));
System.out.println(event);
assertEquals(new IeeeAddress("1234567890ABCDEF"), event.getIeeeAddress());
assertEquals(Integer.valueOf(0x9876), event.getNetworkAddress());
assertNull(event.getRssi());
assertNull(event.getLqi());
}
use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisGetIeeeAddressCommandTest method testOk.
@Test
public void testOk() {
TelegesisGetIeeeAddressCommand command = new TelegesisGetIeeeAddressCommand();
System.out.println(command);
assertEquals("ATS04?\r\n", intArrayToString(command.serialize()));
assertFalse(command.deserialize(stringToIntArray("1122334455AABBCC\r")));
System.out.println(command);
assertTrue(command.deserialize(stringToIntArray("OK\r")));
System.out.println(command);
assertEquals(new IeeeAddress("1122334455AABBCC"), command.getIeeeAddress());
assertEquals(TelegesisStatusCode.SUCCESS, command.getStatus());
}
Aggregations