@Test public void testDeserialize() { int[] packet = getPacketData("B1 68 DE 3A 00 00 00 00 86 06 00 00 00 EE 1F 00 A9 44 25 02 0F E2"); DefaultDeserializer deserializer = new DefaultDeserializer(packet); NeighborTable neighbor = new NeighborTable(); neighbor.deserialize(deserializer); assertEquals(LogicalType.ROUTER, neighbor.getDeviceType()); assertEquals(new IeeeAddress("001FEE0000000686"), neighbor.getExtendedAddress()); assertEquals(new ExtendedPanId("3ADE68B1"), neighbor.getExtendedPanId()); assertEquals(NeighborTableRelationship.SIBLING, neighbor.getRelationship()); assertEquals(Integer.valueOf(17577), neighbor.getNetworkAddress()); assertEquals(NeighborTableJoining.UNKNOWN, neighbor.getPermitJoining()); assertEquals(NeighborTableRxState.RX_ON, neighbor.getRxOnWhenIdle()); assertEquals(Integer.valueOf(15), neighbor.getDepth()); assertEquals(Integer.valueOf(226), neighbor.getLqi()); }
public void deserialize(ZigBeeDeserializer deserializer) { extendedPanId = (ExtendedPanId) deserializer.readZigBeeType(ZclDataType.EXTENDED_PANID); extendedAddress = (IeeeAddress) deserializer.readZigBeeType(ZclDataType.IEEE_ADDRESS); networkAddress = (Integer) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER); int temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setDeviceType(temp & 0x03); setRxOnWhenIdle((temp & 0x0c) >> 2); setRelationship((temp & 0x70) >> 4); temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setPermitJoining(temp & 0x03); depth = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); lqi = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); }
NeighborTable { public void deserialize(ZigBeeDeserializer deserializer) { extendedPanId = (ExtendedPanId) deserializer.readZigBeeType(ZclDataType.EXTENDED_PANID); extendedAddress = (IeeeAddress) deserializer.readZigBeeType(ZclDataType.IEEE_ADDRESS); networkAddress = (Integer) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER); int temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setDeviceType(temp & 0x03); setRxOnWhenIdle((temp & 0x0c) >> 2); setRelationship((temp & 0x70) >> 4); temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setPermitJoining(temp & 0x03); depth = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); lqi = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); } }
NeighborTable { public void deserialize(ZigBeeDeserializer deserializer) { extendedPanId = (ExtendedPanId) deserializer.readZigBeeType(ZclDataType.EXTENDED_PANID); extendedAddress = (IeeeAddress) deserializer.readZigBeeType(ZclDataType.IEEE_ADDRESS); networkAddress = (Integer) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER); int temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setDeviceType(temp & 0x03); setRxOnWhenIdle((temp & 0x0c) >> 2); setRelationship((temp & 0x70) >> 4); temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setPermitJoining(temp & 0x03); depth = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); lqi = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); }  }
NeighborTable { public void deserialize(ZigBeeDeserializer deserializer) { extendedPanId = (ExtendedPanId) deserializer.readZigBeeType(ZclDataType.EXTENDED_PANID); extendedAddress = (IeeeAddress) deserializer.readZigBeeType(ZclDataType.IEEE_ADDRESS); networkAddress = (Integer) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER); int temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setDeviceType(temp & 0x03); setRxOnWhenIdle((temp & 0x0c) >> 2); setRelationship((temp & 0x70) >> 4); temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setPermitJoining(temp & 0x03); depth = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); lqi = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); }  void deserialize(ZigBeeDeserializer deserializer); ExtendedPanId getExtendedPanId(); IeeeAddress getExtendedAddress(); Integer getNetworkAddress(); LogicalType getDeviceType(); NeighborTableRxState getRxOnWhenIdle(); void setRxOnWhenIdle(Integer rxOnWhenIdle); NeighborTableRelationship getRelationship(); NeighborTableJoining getPermitJoining(); Integer getDepth(); Integer getLqi(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
NeighborTable { public void deserialize(ZigBeeDeserializer deserializer) { extendedPanId = (ExtendedPanId) deserializer.readZigBeeType(ZclDataType.EXTENDED_PANID); extendedAddress = (IeeeAddress) deserializer.readZigBeeType(ZclDataType.IEEE_ADDRESS); networkAddress = (Integer) deserializer.readZigBeeType(ZclDataType.UNSIGNED_16_BIT_INTEGER); int temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setDeviceType(temp & 0x03); setRxOnWhenIdle((temp & 0x0c) >> 2); setRelationship((temp & 0x70) >> 4); temp = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); setPermitJoining(temp & 0x03); depth = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); lqi = (int) deserializer.readZigBeeType(ZclDataType.UNSIGNED_8_BIT_INTEGER); }  void deserialize(ZigBeeDeserializer deserializer); ExtendedPanId getExtendedPanId(); IeeeAddress getExtendedAddress(); Integer getNetworkAddress(); LogicalType getDeviceType(); NeighborTableRxState getRxOnWhenIdle(); void setRxOnWhenIdle(Integer rxOnWhenIdle); NeighborTableRelationship getRelationship(); NeighborTableJoining getPermitJoining(); Integer getDepth(); Integer getLqi(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }