Search in sources :

Example 16 with IeeeAddress

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()));
}
Also used : IeeeAddress(com.zsmartsystems.zigbee.IeeeAddress) Test(org.junit.Test)

Example 17 with IeeeAddress

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());
}
Also used : IeeeAddress(com.zsmartsystems.zigbee.IeeeAddress) Test(org.junit.Test)

Example 18 with IeeeAddress

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());
}
Also used : IeeeAddress(com.zsmartsystems.zigbee.IeeeAddress) Test(org.junit.Test)

Example 19 with IeeeAddress

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());
}
Also used : IeeeAddress(com.zsmartsystems.zigbee.IeeeAddress) Test(org.junit.Test)

Example 20 with IeeeAddress

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());
}
Also used : IeeeAddress(com.zsmartsystems.zigbee.IeeeAddress) Test(org.junit.Test)

Aggregations

IeeeAddress (com.zsmartsystems.zigbee.IeeeAddress)66 Test (org.junit.Test)53 ZigBeeEndpoint (com.zsmartsystems.zigbee.ZigBeeEndpoint)12 ZigBeeNode (com.zsmartsystems.zigbee.ZigBeeNode)12 CommandTest (com.zsmartsystems.zigbee.CommandTest)7 DefaultDeserializer (com.zsmartsystems.zigbee.serialization.DefaultDeserializer)7 ZclOnOffCluster (com.zsmartsystems.zigbee.zcl.clusters.ZclOnOffCluster)7 ZigBeeEndpointAddress (com.zsmartsystems.zigbee.ZigBeeEndpointAddress)6 ZclFieldDeserializer (com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer)6 ArrayList (java.util.ArrayList)6 ZigBeeCommand (com.zsmartsystems.zigbee.ZigBeeCommand)5 EzspFrameTest (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.EzspFrameTest)4 CommandResult (com.zsmartsystems.zigbee.CommandResult)3 ExtendedPanId (com.zsmartsystems.zigbee.ExtendedPanId)3 NodeDescriptor (com.zsmartsystems.zigbee.zdo.field.NodeDescriptor)3 HashSet (java.util.HashSet)3 ZigBeeNetworkManager (com.zsmartsystems.zigbee.ZigBeeNetworkManager)2 EmberInitialSecurityState (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberInitialSecurityState)2 EmberKeyData (com.zsmartsystems.zigbee.dongle.ember.internal.ezsp.structure.EmberKeyData)2 XBeeFrameHandler (com.zsmartsystems.zigbee.dongle.xbee.internal.XBeeFrameHandler)2