use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class EzspChildJoinHandlerTest method testReceive1.
@Test
public void testReceive1() {
EzspFrame.setEzspVersion(4);
EzspChildJoinHandler handler = new EzspChildJoinHandler(getPacketData("0B 90 23 00 00 95 87 F9 41 F6 02 00 4B 12 00 04"));
System.out.println(handler);
assertTrue(handler.isResponse());
assertEquals(0, handler.getIndex());
assertEquals(34709, handler.getChildId());
assertEquals(false, handler.getJoining());
assertEquals(new IeeeAddress("00124B0002F641F9"), handler.getChildEui64());
assertEquals(EmberNodeType.EMBER_SLEEPY_END_DEVICE, handler.getChildType());
}
use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisDisplayProductIdentificationCommandTest method testOk.
@Test
public void testOk() {
TelegesisDisplayProductIdentificationCommand command = new TelegesisDisplayProductIdentificationCommand();
System.out.println(command);
assertEquals("ATI\r\n", intArrayToString(command.serialize()));
assertFalse(command.deserialize(stringToIntArray("Telegesis ETRX357-LRS\r")));
System.out.println(command);
assertFalse(command.deserialize(stringToIntArray("R309\r")));
System.out.println(command);
assertFalse(command.deserialize(stringToIntArray("1234567890ABCDEF\r")));
System.out.println(command);
assertTrue(command.deserialize(stringToIntArray("OK\r")));
System.out.println(command);
assertEquals("ETRX357-LRS", command.getDeviceName());
assertEquals("309", command.getFirmwareRevision());
assertEquals(new IeeeAddress("1234567890ABCDEF"), command.getIeeeAddress());
assertEquals(TelegesisStatusCode.SUCCESS, command.getStatus());
}
use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.
the class TelegesisMobileDeviceAnnounceEventTest method testExtended.
@Test
public void testExtended() {
TelegesisMobileDeviceAnnounceEvent event = new TelegesisMobileDeviceAnnounceEvent();
event.deserialize(stringToIntArray("MED: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 TelegesisReceiveBroadcastEventTest method testRemoteAddress.
@Test
public void testRemoteAddress() {
TelegesisReceiveBroadcastEvent event = new TelegesisReceiveBroadcastEvent();
event.deserialize(stringToIntArray("BCAST: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 TelegesisReceiveBroadcastEventTest method testRemoteAddressRssiLqi.
@Test
public void testRemoteAddressRssiLqi() {
TelegesisReceiveBroadcastEvent event = new TelegesisReceiveBroadcastEvent();
event.deserialize(stringToIntArray("BCAST:000D6F000005A666,04=test,A0,45"));
System.out.println(event);
assertEquals(new IeeeAddress("000D6F000005A666"), event.getRemoteAddress());
assertTrue(Arrays.equals(stringToIntArray("test"), event.getMessageData()));
assertEquals(Integer.valueOf(160), event.getRssi());
assertEquals(Integer.valueOf(69), event.getLqi());
}
Aggregations