Search in sources :

Example 36 with IeeeAddress

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

Example 37 with IeeeAddress

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

Example 38 with IeeeAddress

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

Example 39 with IeeeAddress

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

Example 40 with IeeeAddress

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());
}
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