@Test public void serializeEmberInitialSecurityBitmask() { EzspSerializer serializer; Set<EmberInitialSecurityBitmask> securityBitmask; serializer = new EzspSerializer(); securityBitmask = new HashSet<EmberInitialSecurityBitmask>(); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_HAVE_PRECONFIGURED_KEY); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_HAVE_NETWORK_KEY); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_REQUIRE_ENCRYPTED_KEY); serializer.serializeEmberInitialSecurityBitmask(securityBitmask); assertTrue(Arrays.equals(new int[] { 0x00, 0x0B }, serializer.getPayload())); serializer = new EzspSerializer(); securityBitmask = new HashSet<EmberInitialSecurityBitmask>(); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_TRUST_CENTER_USES_HASHED_LINK_KEY); serializer.serializeEmberInitialSecurityBitmask(securityBitmask); assertTrue(Arrays.equals(new int[] { 0x84, 0x00 }, serializer.getPayload())); serializer = new EzspSerializer(); securityBitmask = new HashSet<EmberInitialSecurityBitmask>(); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_DISTRIBUTED_TRUST_CENTER_MODE); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_HAVE_NETWORK_KEY); securityBitmask.add(EmberInitialSecurityBitmask.EMBER_NO_FRAME_COUNTER_RESET); serializer.serializeEmberInitialSecurityBitmask(securityBitmask); assertTrue(Arrays.equals(new int[] { 0x02, 0x12 }, serializer.getPayload())); }
public void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask) { int value = 0; for (EmberInitialSecurityBitmask bitmask : securityBitmask) { value |= bitmask.getKey(); } buffer[length++] = value & 0xFF; buffer[length++] = (value >> 8) & 0xFF; }
EzspSerializer { public void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask) { int value = 0; for (EmberInitialSecurityBitmask bitmask : securityBitmask) { value |= bitmask.getKey(); } buffer[length++] = value & 0xFF; buffer[length++] = (value >> 8) & 0xFF; } }
EzspSerializer { public void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask) { int value = 0; for (EmberInitialSecurityBitmask bitmask : securityBitmask) { value |= bitmask.getKey(); } buffer[length++] = value & 0xFF; buffer[length++] = (value >> 8) & 0xFF; }  }
EzspSerializer { public void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask) { int value = 0; for (EmberInitialSecurityBitmask bitmask : securityBitmask) { value |= bitmask.getKey(); } buffer[length++] = value & 0xFF; buffer[length++] = (value >> 8) & 0xFF; }  void serializeUInt8(int val); void serializeInt8S(int val); void serializeUInt16(int val); void serializeUInt32(int val); void serializeUInt16Array(int[] array); void serializeUInt8Array(int[] array); void serializeBool(boolean val); void serializeEmberKeyData(EmberKeyData keyData); void serializeEmberEui64(IeeeAddress address); void serializeEmberNetworkParameters(EmberNetworkParameters networkParameters); void serializeEmberApsFrame(EmberApsFrame apsFrame); void serializeEmberApsOption(Set<EmberApsOption> options); void serializeEzspNetworkScanType(EzspNetworkScanType scanType); void serializeEmberBindingTableEntry(EmberBindingTableEntry tableEntry); void serializeEmberInitialSecurityState(EmberInitialSecurityState securityState); void serializeEmberOutgoingMessageType(EmberOutgoingMessageType messageType); void serializeEmberConcentratorType(EmberConcentratorType concentratorType); void serializeEzspPolicyId(EzspPolicyId policyId); void serializeEmberNodeType(EmberNodeType nodeType); void serializeEzspConfigId(EzspConfigId configId); void serializeEmberBindingType(EmberBindingType bindingType); void serializeEmberCurrentSecurityBitmask(Set<EmberCurrentSecurityBitmask> securityBitmask); void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask); void serializeEmberJoinMethod(EmberJoinMethod joinMethod); void serializeExtendedPanId(ExtendedPanId extendedPanId); int[] getPayload(); void serializeEmberKeyType(EmberKeyType keyType); void serializeEzspValueId(EzspValueId valueId); void serializeEmberKeyStructBitmask(Set<EmberKeyStructBitmask> keyBitmask); void serializeEmberPowerMode(EmberPowerMode powerMode); void serializeEmberGpAddress(EmberGpAddress address); void serializeEmberGpProxyTableEntryStatus(EmberGpProxyTableEntryStatus status); void serializeEmberAesMmoHashContext(EmberAesMmoHashContext context); void serializeEmberCertificateData(EmberCertificateData certificate); void serializeEmberCertificate283k1Data(EmberCertificate283k1Data certificate); void serializeEmberPublicKeyData(EmberPublicKeyData publicKey); void serializeEmberPublicKey283k1Data(EmberPublicKey283k1Data publicKey); void serializeEmberPrivateKey283k1Data(EmberPrivateKey283k1Data privateKey); void serializeEmberPrivateKeyData(EmberPrivateKeyData privateKey); void serializeEmberLibraryId(EmberLibraryId libraryId); void serializeEzspMfgTokenId(EzspMfgTokenId tokenId); void serializeEmberGpSinkListEntry(EmberGpSinkListEntry[] sinkList); void serializeEmberGpSinkTableEntryStatus(EmberGpSinkTableEntryStatus status); void serializeEmberGpSinkTableEntry(EmberGpSinkTableEntry entry); void serializeEmberGpApplicationId(EmberGpApplicationId applicationId); void serializeEmberBeaconData(EmberBeaconData beacon); }
EzspSerializer { public void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask) { int value = 0; for (EmberInitialSecurityBitmask bitmask : securityBitmask) { value |= bitmask.getKey(); } buffer[length++] = value & 0xFF; buffer[length++] = (value >> 8) & 0xFF; }  void serializeUInt8(int val); void serializeInt8S(int val); void serializeUInt16(int val); void serializeUInt32(int val); void serializeUInt16Array(int[] array); void serializeUInt8Array(int[] array); void serializeBool(boolean val); void serializeEmberKeyData(EmberKeyData keyData); void serializeEmberEui64(IeeeAddress address); void serializeEmberNetworkParameters(EmberNetworkParameters networkParameters); void serializeEmberApsFrame(EmberApsFrame apsFrame); void serializeEmberApsOption(Set<EmberApsOption> options); void serializeEzspNetworkScanType(EzspNetworkScanType scanType); void serializeEmberBindingTableEntry(EmberBindingTableEntry tableEntry); void serializeEmberInitialSecurityState(EmberInitialSecurityState securityState); void serializeEmberOutgoingMessageType(EmberOutgoingMessageType messageType); void serializeEmberConcentratorType(EmberConcentratorType concentratorType); void serializeEzspPolicyId(EzspPolicyId policyId); void serializeEmberNodeType(EmberNodeType nodeType); void serializeEzspConfigId(EzspConfigId configId); void serializeEmberBindingType(EmberBindingType bindingType); void serializeEmberCurrentSecurityBitmask(Set<EmberCurrentSecurityBitmask> securityBitmask); void serializeEmberInitialSecurityBitmask(Set<EmberInitialSecurityBitmask> securityBitmask); void serializeEmberJoinMethod(EmberJoinMethod joinMethod); void serializeExtendedPanId(ExtendedPanId extendedPanId); int[] getPayload(); void serializeEmberKeyType(EmberKeyType keyType); void serializeEzspValueId(EzspValueId valueId); void serializeEmberKeyStructBitmask(Set<EmberKeyStructBitmask> keyBitmask); void serializeEmberPowerMode(EmberPowerMode powerMode); void serializeEmberGpAddress(EmberGpAddress address); void serializeEmberGpProxyTableEntryStatus(EmberGpProxyTableEntryStatus status); void serializeEmberAesMmoHashContext(EmberAesMmoHashContext context); void serializeEmberCertificateData(EmberCertificateData certificate); void serializeEmberCertificate283k1Data(EmberCertificate283k1Data certificate); void serializeEmberPublicKeyData(EmberPublicKeyData publicKey); void serializeEmberPublicKey283k1Data(EmberPublicKey283k1Data publicKey); void serializeEmberPrivateKey283k1Data(EmberPrivateKey283k1Data privateKey); void serializeEmberPrivateKeyData(EmberPrivateKeyData privateKey); void serializeEmberLibraryId(EmberLibraryId libraryId); void serializeEzspMfgTokenId(EzspMfgTokenId tokenId); void serializeEmberGpSinkListEntry(EmberGpSinkListEntry[] sinkList); void serializeEmberGpSinkTableEntryStatus(EmberGpSinkTableEntryStatus status); void serializeEmberGpSinkTableEntry(EmberGpSinkTableEntry entry); void serializeEmberGpApplicationId(EmberGpApplicationId applicationId); void serializeEmberBeaconData(EmberBeaconData beacon);  }