@Test public void testRequestV8NetworkId() { EzspFrame.setEzspVersion(8); EzspFrameRequest request = Mockito.mock(EzspFrameRequest.class, Mockito.CALLS_REAL_METHODS); request.setNetworkId(1); EzspSerializer serializer = new EzspSerializer(); request.serializeHeader(serializer); assertTrue(Arrays.equals(new int[] { 0x00, 0x20, 0x01, 0x00, 0x00 }, serializer.getPayload())); request.setNetworkId(3); serializer = new EzspSerializer(); request.serializeHeader(serializer); assertTrue(Arrays.equals(new int[] { 0x00, 0x60, 0x01, 0x00, 0x00 }, serializer.getPayload())); EzspFrame.setEzspVersion(4); }
protected void serializeHeader(final EzspSerializer serializer) { serializer.serializeUInt8(sequenceNumber); if (ezspVersion >= 8) { serializer.serializeUInt16(0x0100 + ((networkId << EZSP_NETWORK_ID_SHIFT) & EZSP_NETWORK_ID_MASK)); serializer.serializeUInt16(frameId); } else { serializer.serializeUInt8(EZSP_FC_REQUEST); if (ezspVersion > 4) { serializer.serializeUInt8(EZSP_LEGACY_FRAME_ID); serializer.serializeUInt8(0x00); } serializer.serializeUInt8(frameId); } }
EzspFrameRequest extends EzspFrame { protected void serializeHeader(final EzspSerializer serializer) { serializer.serializeUInt8(sequenceNumber); if (ezspVersion >= 8) { serializer.serializeUInt16(0x0100 + ((networkId << EZSP_NETWORK_ID_SHIFT) & EZSP_NETWORK_ID_MASK)); serializer.serializeUInt16(frameId); } else { serializer.serializeUInt8(EZSP_FC_REQUEST); if (ezspVersion > 4) { serializer.serializeUInt8(EZSP_LEGACY_FRAME_ID); serializer.serializeUInt8(0x00); } serializer.serializeUInt8(frameId); } } }
EzspFrameRequest extends EzspFrame { protected void serializeHeader(final EzspSerializer serializer) { serializer.serializeUInt8(sequenceNumber); if (ezspVersion >= 8) { serializer.serializeUInt16(0x0100 + ((networkId << EZSP_NETWORK_ID_SHIFT) & EZSP_NETWORK_ID_MASK)); serializer.serializeUInt16(frameId); } else { serializer.serializeUInt8(EZSP_FC_REQUEST); if (ezspVersion > 4) { serializer.serializeUInt8(EZSP_LEGACY_FRAME_ID); serializer.serializeUInt8(0x00); } serializer.serializeUInt8(frameId); } } protected  EzspFrameRequest(); }
EzspFrameRequest extends EzspFrame { protected void serializeHeader(final EzspSerializer serializer) { serializer.serializeUInt8(sequenceNumber); if (ezspVersion >= 8) { serializer.serializeUInt16(0x0100 + ((networkId << EZSP_NETWORK_ID_SHIFT) & EZSP_NETWORK_ID_MASK)); serializer.serializeUInt16(frameId); } else { serializer.serializeUInt8(EZSP_FC_REQUEST); if (ezspVersion > 4) { serializer.serializeUInt8(EZSP_LEGACY_FRAME_ID); serializer.serializeUInt8(0x00); } serializer.serializeUInt8(frameId); } } protected  EzspFrameRequest(); int[] serialize(); }
EzspFrameRequest extends EzspFrame { protected void serializeHeader(final EzspSerializer serializer) { serializer.serializeUInt8(sequenceNumber); if (ezspVersion >= 8) { serializer.serializeUInt16(0x0100 + ((networkId << EZSP_NETWORK_ID_SHIFT) & EZSP_NETWORK_ID_MASK)); serializer.serializeUInt16(frameId); } else { serializer.serializeUInt8(EZSP_FC_REQUEST); if (ezspVersion > 4) { serializer.serializeUInt8(EZSP_LEGACY_FRAME_ID); serializer.serializeUInt8(0x00); } serializer.serializeUInt8(frameId); } } protected  EzspFrameRequest(); int[] serialize();  }