Search in sources :

Example 11 with IeeeAddress

use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.

the class TelegesisEndDeviceAnnounceEventTest method testExtended.

@Test
public void testExtended() {
    TelegesisEndDeviceAnnounceEvent event = new TelegesisEndDeviceAnnounceEvent();
    event.deserialize(stringToIntArray("ZED: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 12 with IeeeAddress

use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.

the class TelegesisEndDeviceAnnounceEventTest method testBasic.

@Test
public void testBasic() {
    TelegesisEndDeviceAnnounceEvent event = new TelegesisEndDeviceAnnounceEvent();
    event.deserialize(stringToIntArray("ZED: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 13 with IeeeAddress

use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.

the class TelegesisMobileDeviceAnnounceEventTest method testBasic.

@Test
public void testBasic() {
    TelegesisMobileDeviceAnnounceEvent event = new TelegesisMobileDeviceAnnounceEvent();
    event.deserialize(stringToIntArray("MED: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 14 with IeeeAddress

use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.

the class TelegesisReceiveMulticastEventTest method testRemoteAddress.

@Test
public void testRemoteAddress() {
    TelegesisReceiveMulticastEvent event = new TelegesisReceiveMulticastEvent();
    event.deserialize(stringToIntArray("MCAST: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 15 with IeeeAddress

use of com.zsmartsystems.zigbee.IeeeAddress in project com.zsmartsystems.zigbee by zsmartsystems.

the class TelegesisReceiveUnicastEventTest method testRemoteAddressRssiLqi.

@Test
public void testRemoteAddressRssiLqi() {
    TelegesisReceiveUnicastEvent event = new TelegesisReceiveUnicastEvent();
    event.deserialize(stringToIntArray("UCAST: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());
}
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