@Test public void testReceive2() { EzspFrame.setEzspVersion(4); EzspIncomingMessageHandler incomingMessageHandler = new EzspIncomingMessageHandler(getPacketData( "01 90 45 00 00 00 01 80 00 00 40 00 00 00 EE FF 00 00 00 FF FF 0C 00 81 F0 F0 00 20 00 00 00 00 00 01")); System.out.println(incomingMessageHandler); assertEquals(0x45, incomingMessageHandler.getFrameId()); assertTrue(incomingMessageHandler.isResponse()); assertEquals(EmberIncomingMessageType.EMBER_INCOMING_UNICAST, incomingMessageHandler.getType()); ZigBeeTransportReceive transportReceiveMock = Mockito.mock(ZigBeeTransportReceive.class); ArgumentCaptor<ZigBeeApsFrame> apsFrame = ArgumentCaptor.forClass(ZigBeeApsFrame.class); Mockito.doNothing().when(transportReceiveMock).receiveCommand(apsFrame.capture()); ZigBeeDongleEzsp dongle = getDongle(); dongle.setZigBeeTransportReceive(transportReceiveMock); dongle.handlePacket(incomingMessageHandler); assertEquals(1, apsFrame.getAllValues().size()); assertEquals(0, apsFrame.getValue().getSourceAddress()); assertEquals(0, apsFrame.getValue().getDestinationAddress()); assertEquals(0, apsFrame.getValue().getProfile()); assertEquals(238, apsFrame.getValue().getApsCounter()); assertEquals(0x8001, apsFrame.getValue().getCluster()); assertEquals(0, apsFrame.getValue().getSourceEndpoint()); assertEquals(0, apsFrame.getValue().getDestinationEndpoint()); assertTrue( Arrays.equals(apsFrame.getValue().getPayload(), getPacketData("00 81 F0 F0 00 20 00 00 00 00 00 01"))); }
public EmberIncomingMessageType getType() { return type; }
EzspIncomingMessageHandler extends EzspFrameResponse { public EmberIncomingMessageType getType() { return type; } }
EzspIncomingMessageHandler extends EzspFrameResponse { public EmberIncomingMessageType getType() { return type; } EzspIncomingMessageHandler(int[] inputBuffer); }
EzspIncomingMessageHandler extends EzspFrameResponse { public EmberIncomingMessageType getType() { return type; } EzspIncomingMessageHandler(int[] inputBuffer); EmberIncomingMessageType getType(); void setType(EmberIncomingMessageType type); EmberApsFrame getApsFrame(); void setApsFrame(EmberApsFrame apsFrame); int getLastHopLqi(); void setLastHopLqi(int lastHopLqi); int getLastHopRssi(); void setLastHopRssi(int lastHopRssi); int getSender(); void setSender(int sender); int getBindingIndex(); void setBindingIndex(int bindingIndex); int getAddressIndex(); void setAddressIndex(int addressIndex); int[] getMessageContents(); void setMessageContents(int[] messageContents); @Override String toString(); }
EzspIncomingMessageHandler extends EzspFrameResponse { public EmberIncomingMessageType getType() { return type; } EzspIncomingMessageHandler(int[] inputBuffer); EmberIncomingMessageType getType(); void setType(EmberIncomingMessageType type); EmberApsFrame getApsFrame(); void setApsFrame(EmberApsFrame apsFrame); int getLastHopLqi(); void setLastHopLqi(int lastHopLqi); int getLastHopRssi(); void setLastHopRssi(int lastHopRssi); int getSender(); void setSender(int sender); int getBindingIndex(); void setBindingIndex(int bindingIndex); int getAddressIndex(); void setAddressIndex(int addressIndex); int[] getMessageContents(); void setMessageContents(int[] messageContents); @Override String toString(); static final int FRAME_ID; }