Search in sources :

Example 16 with ZToolPacket

use of com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZDO_END_DEVICE_ANNCE_IND_Test method testReceive.

@Test
public void testReceive() {
    ZToolPacket data = getPacket("FE 0D 45 C1 2A 2F 2A 2F F9 41 F6 02 00 4B 12 00 00 9C");
    ZigBeeApsFrame apsFrame = ZdoEndDeviceAnnounce.create(data);
    assertEquals(0x2f2a, apsFrame.getSourceAddress());
    assertEquals(0, apsFrame.getProfile());
    assertEquals(0, apsFrame.getDestinationEndpoint());
    assertTrue(Arrays.equals(getPacketData("2F 2A 2F F9 41 F6 02 00 4B 12 00 00"), apsFrame.getPayload()));
}
Also used : ZigBeeApsFrame(com.zsmartsystems.zigbee.ZigBeeApsFrame) ZToolPacket(com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket) Test(org.junit.Test)

Example 17 with ZToolPacket

use of com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZDO_IEEE_ADDR_RSP_Test method testReceive2.

@Test
public void testReceive2() {
    ZToolPacket data = getPacket("FE 0F 45 81 00 86 06 00 00 00 EE 1F 00 21 A4 00 01 00 00 3E");
    ZigBeeApsFrame apsFrame = ZdoIeeeAddress.create(data);
    assertEquals(42017, apsFrame.getSourceAddress());
    assertEquals(0, apsFrame.getProfile());
    assertEquals(0, apsFrame.getDestinationEndpoint());
    assertTrue(Arrays.equals(getPacketData("00 00 86 06 00 00 00 EE 1F 00 21 A4 01 00 00 00"), apsFrame.getPayload()));
}
Also used : ZigBeeApsFrame(com.zsmartsystems.zigbee.ZigBeeApsFrame) ZToolPacket(com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket) Test(org.junit.Test)

Example 18 with ZToolPacket

use of com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZDO_IEEE_ADDR_RSP_Test method testReceive1.

@Test
public void testReceive1() {
    ZToolPacket data = getPacket("FE 11 45 81 00 14 D4 F1 02 00 4B 12 00 00 00 00 02 8F 22 2A 2F 15");
    ZigBeeApsFrame apsFrame = ZdoIeeeAddress.create(data);
    assertEquals(0x0000, apsFrame.getSourceAddress());
    assertEquals(0, apsFrame.getProfile());
    assertEquals(0, apsFrame.getDestinationEndpoint());
    assertTrue(Arrays.equals(getPacketData("00 00 14 D4 F1 02 00 4B 12 00 00 00 02 00 8F 22 2A 2F"), apsFrame.getPayload()));
}
Also used : ZigBeeApsFrame(com.zsmartsystems.zigbee.ZigBeeApsFrame) ZToolPacket(com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket) Test(org.junit.Test)

Example 19 with ZToolPacket

use of com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZDO_MGMT_LEAVE_RSP_Test method testReceive.

@Test
public void testReceive() {
    ZToolPacket data = getPacket("FE 03 45 B4 E6 D2 00 C6");
    ZigBeeApsFrame apsFrame = ZdoManagementLeave.create(data);
    assertEquals(53990, apsFrame.getSourceAddress());
    assertEquals(0, apsFrame.getProfile());
    assertEquals(0, apsFrame.getDestinationEndpoint());
    assertTrue(Arrays.equals(getPacketData("D2 00"), apsFrame.getPayload()));
}
Also used : ZigBeeApsFrame(com.zsmartsystems.zigbee.ZigBeeApsFrame) ZToolPacket(com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket) Test(org.junit.Test)

Example 20 with ZToolPacket

use of com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket in project com.zsmartsystems.zigbee by zsmartsystems.

the class ZDO_MGMT_LQI_RSP_Test method testReceive.

@Test
public void testReceive() {
    ZToolPacket data = getPacket("FE 32 45 B1 00 00 00 02 00 02 14 D4 F1 02 00 4B 12 00 0B 88 DC 00 01 88 17 00 8F 22 15 02 01 3B 14 D4 F1 02 00 4B 12 00 EC A1 A5 01 00 8D 15 00 35 38 15 02 01 58 B5");
    ZigBeeApsFrame apsFrame = ZdoManagementLqi.create(data);
    assertEquals(0x0000, apsFrame.getSourceAddress());
    assertEquals(0, apsFrame.getProfile());
    assertEquals(0, apsFrame.getDestinationEndpoint());
    assertTrue(Arrays.equals(getPacketData("00 00 02 00 02 14 D4 F1 02 00 4B 12 00 0B 88 DC 00 01 88 17 00 8F 22 15 02 01 3B 14 D4 F1 02 00 4B 12 00 EC A1 A5 01 00 8D 15 00 35 38 15 02 01 58"), apsFrame.getPayload()));
}
Also used : ZigBeeApsFrame(com.zsmartsystems.zigbee.ZigBeeApsFrame) ZToolPacket(com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket) Test(org.junit.Test)

Aggregations

ZToolPacket (com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacket)16 Test (org.junit.Test)13 ZigBeeApsFrame (com.zsmartsystems.zigbee.ZigBeeApsFrame)12 DoubleByte (com.zsmartsystems.zigbee.dongle.cc2531.zigbee.util.DoubleByte)4 AsynchronousCommandListener (com.zsmartsystems.zigbee.dongle.cc2531.network.AsynchronousCommandListener)2 IOException (java.io.IOException)2 SynchronousCommandListener (com.zsmartsystems.zigbee.dongle.cc2531.network.SynchronousCommandListener)1 BlockingCommandReceiver (com.zsmartsystems.zigbee.dongle.cc2531.network.impl.BlockingCommandReceiver)1 ZToolPacketStream (com.zsmartsystems.zigbee.dongle.cc2531.network.packet.ZToolPacketStream)1 SYS_RESET_RESPONSE (com.zsmartsystems.zigbee.dongle.cc2531.network.packet.system.SYS_RESET_RESPONSE)1 SYS_VERSION_RESPONSE (com.zsmartsystems.zigbee.dongle.cc2531.network.packet.system.SYS_VERSION_RESPONSE)1 ZigBeePort (com.zsmartsystems.zigbee.transport.ZigBeePort)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1