diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/EmberNcp.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/EmberNcp.java index 2607cc1ba..3348bd5fb 100644 --- a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/EmberNcp.java +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/EmberNcp.java @@ -28,6 +28,15 @@ import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrame; import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspAddEndpointRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspExportKeyRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspExportKeyResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspSecManImportTransientKeyRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspSecManImportTransientKeyResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspSecManGetNetworkKeyInfoRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspSecManGetNetworkKeyInfoResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerKeyType; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerNetworkKeyInfo; import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspAddEndpointResponse; import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspAddOrUpdateKeyTableEntryRequest; import com.zsmartsystems.zigbee.dongle.ember.ezsp.command.EzspAddOrUpdateKeyTableEntryResponse; @@ -454,6 +463,35 @@ public EmberStatus clearKeyTable() { * @return the {@link EmberKeyStruct} or null on error */ public EmberKeyStruct getKey(EmberKeyType keyType) { + // EZSP v13+: Use SecurityManager exportKey API (legacy getKey was removed) + if (EzspFrame.getEzspVersion() >= 13) { + EzspSecurityManagerKeyType secManKeyType; + switch (keyType) { + case EMBER_CURRENT_NETWORK_KEY: + secManKeyType = EzspSecurityManagerKeyType.NETWORK; + break; + case EMBER_TRUST_CENTER_LINK_KEY: + secManKeyType = EzspSecurityManagerKeyType.TC_LINK; + break; + case EMBER_APPLICATION_LINK_KEY: + secManKeyType = EzspSecurityManagerKeyType.APP_LINK; + break; + default: + logger.debug("Unsupported key type for EZSP v13 exportKey: {}", keyType); + return null; + } + EmberKeyData keyData = secManExportKey(secManKeyType); + if (keyData == null) { + return null; + } + // Wrap EmberKeyData in an EmberKeyStruct for backwards compatibility + EmberKeyStruct keyStruct = new EmberKeyStruct(); + keyStruct.setKey(keyData); + keyStruct.setType(keyType); + return keyStruct; + } + + // Legacy EZSP v4-v12 EzspGetKeyRequest request = new EzspGetKeyRequest(); request.setKeyType(keyType); EzspTransaction transaction = protocolHandler @@ -470,6 +508,32 @@ public EmberKeyStruct getKey(EmberKeyType keyType) { return response.getKeyStruct(); } + /** + * Exports a key using the EZSP v13+ SecurityManager API. + * + * @param keyType the {@link EzspSecurityManagerKeyType} to export + * @return the {@link EmberKeyData} or null on error + */ + public EmberKeyData secManExportKey(EzspSecurityManagerKeyType keyType) { + EzspSecurityManagerContext context = new EzspSecurityManagerContext(); + context.setKeyType(keyType); + EzspExportKeyRequest request = new EzspExportKeyRequest(); + request.setContext(context); + EzspTransaction transaction = protocolHandler + .sendEzspTransaction(new EzspSingleResponseTransaction(request, EzspExportKeyResponse.class)); + EzspExportKeyResponse response = (EzspExportKeyResponse) transaction.getResponse(); + if (response == null) { + logger.debug("No response from exportKey command"); + return null; + } + logger.debug(response.toString()); + if (response.getSlStatus() != 0) { + logger.debug("Error exporting key: status=0x{}", String.format("%08X", response.getSlStatus())); + return null; + } + return response.getKey(); + } + /** * Gets a Security Key based on the passed key type. * @@ -682,6 +746,28 @@ public int[] getValue(EzspValueId valueId) { public EmberStatus addTransientLinkKey(IeeeAddress partner, ZigBeeKey transientKey) { EmberKeyData emberKey = new EmberKeyData(); emberKey.setContents(transientKey.getValue()); + + // EZSP v13+: Use SecurityManager importTransientKey API + if (EzspFrame.getEzspVersion() >= 13) { + EzspSecManImportTransientKeyRequest request = new EzspSecManImportTransientKeyRequest(); + request.setEui64(partner); + request.setPlaintextKey(emberKey); + EzspTransaction transaction = protocolHandler.sendEzspTransaction( + new EzspSingleResponseTransaction(request, EzspSecManImportTransientKeyResponse.class)); + EzspSecManImportTransientKeyResponse response = (EzspSecManImportTransientKeyResponse) transaction + .getResponse(); + if (response == null) { + return EmberStatus.UNKNOWN; + } + logger.debug(response.toString()); + if (response.getSlStatus() != 0) { + logger.debug("Error importing transient key: status=0x{}", String.format("%08X", response.getSlStatus())); + return EmberStatus.EMBER_ERR_FATAL; + } + return EmberStatus.EMBER_SUCCESS; + } + + // Legacy EZSP v4-v12 EzspAddTransientLinkKeyRequest request = new EzspAddTransientLinkKeyRequest(); request.setPartner(partner); request.setTransientKey(emberKey); diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/EzspFrame.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/EzspFrame.java index 9da5cdbe7..8d1397f19 100644 --- a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/EzspFrame.java +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/EzspFrame.java @@ -117,6 +117,7 @@ public abstract class EzspFrame { protected static final int FRAME_ID_ENERGY_SCAN_REQUEST = 0x9C; protected static final int FRAME_ID_ENERGY_SCAN_RESULT_HANDLER = 0x48; protected static final int FRAME_ID_ERASE_KEY_TABLE_ENTRY = 0x76; + protected static final int FRAME_ID_EXPORT_KEY = 0x0114; protected static final int FRAME_ID_FIND_AND_REJOIN_NETWORK = 0x21; protected static final int FRAME_ID_FIND_KEY_TABLE_ENTRY = 0x75; protected static final int FRAME_ID_FORM_NETWORK = 0x1E; @@ -177,6 +178,7 @@ public abstract class EzspFrame { protected static final int FRAME_ID_INCOMING_NETWORK_STATUS_HANDLER = 0xC4; protected static final int FRAME_ID_INCOMING_ROUTE_ERROR_HANDLER = 0x80; protected static final int FRAME_ID_INCOMING_ROUTE_RECORD_HANDLER = 0x59; + protected static final int FRAME_ID_IMPORT_KEY = 0x0115; protected static final int FRAME_ID_INCOMING_SENDER_EUI64_HANDLER = 0x62; protected static final int FRAME_ID_INVALID_COMMAND = 0x58; protected static final int FRAME_ID_JOIN_NETWORK = 0x1F; @@ -221,6 +223,15 @@ public abstract class EzspFrame { protected static final int FRAME_ID_SEND_REPLY = 0x39; protected static final int FRAME_ID_SEND_TRUST_CENTER_LINK_KEY = 0x67; protected static final int FRAME_ID_SEND_UNICAST = 0x34; + protected static final int FRAME_ID_SEC_MAN_CHECK_KEY_CONTEXT = 0x0110; + protected static final int FRAME_ID_SEC_MAN_EXPORT_LINK_KEY_BY_EUI = 0x010D; + protected static final int FRAME_ID_SEC_MAN_EXPORT_LINK_KEY_BY_INDEX = 0x010F; + protected static final int FRAME_ID_SEC_MAN_EXPORT_TRANSIENT_KEY_BY_EUI = 0x0113; + protected static final int FRAME_ID_SEC_MAN_EXPORT_TRANSIENT_KEY_BY_INDEX = 0x0112; + protected static final int FRAME_ID_SEC_MAN_GET_APS_KEY_INFO = 0x010C; + protected static final int FRAME_ID_SEC_MAN_GET_NETWORK_KEY_INFO = 0x0116; + protected static final int FRAME_ID_SEC_MAN_IMPORT_LINK_KEY = 0x010E; + protected static final int FRAME_ID_SEC_MAN_IMPORT_TRANSIENT_KEY = 0x0111; protected static final int FRAME_ID_SET_ADDRESS_TABLE_REMOTE_EUI64 = 0x5C; protected static final int FRAME_ID_SET_ADDRESS_TABLE_REMOTE_NODE_ID = 0x5D; protected static final int FRAME_ID_SET_BINDING = 0x2B; @@ -288,6 +299,7 @@ public abstract class EzspFrame { ezspHandlerMap.put(FRAME_ID_ENERGY_SCAN_REQUEST, EzspEnergyScanRequestResponse.class); ezspHandlerMap.put(FRAME_ID_ENERGY_SCAN_RESULT_HANDLER, EzspEnergyScanResultHandler.class); ezspHandlerMap.put(FRAME_ID_ERASE_KEY_TABLE_ENTRY, EzspEraseKeyTableEntryResponse.class); + ezspHandlerMap.put(FRAME_ID_EXPORT_KEY, EzspExportKeyResponse.class); ezspHandlerMap.put(FRAME_ID_FIND_AND_REJOIN_NETWORK, EzspFindAndRejoinNetworkResponse.class); ezspHandlerMap.put(FRAME_ID_FIND_KEY_TABLE_ENTRY, EzspFindKeyTableEntryResponse.class); ezspHandlerMap.put(FRAME_ID_FORM_NETWORK, EzspFormNetworkResponse.class); @@ -310,6 +322,7 @@ public abstract class EzspFrame { ezspHandlerMap.put(FRAME_ID_GET_FIRST_BEACON, EzspGetFirstBeaconResponse.class); ezspHandlerMap.put(FRAME_ID_GET_KEY, EzspGetKeyResponse.class); ezspHandlerMap.put(FRAME_ID_GET_KEY_TABLE_ENTRY, EzspGetKeyTableEntryResponse.class); + ezspHandlerMap.put(FRAME_ID_IMPORT_KEY, EzspImportKeyResponse.class); ezspHandlerMap.put(FRAME_ID_GET_LIBRARY_STATUS, EzspGetLibraryStatusResponse.class); ezspHandlerMap.put(FRAME_ID_GET_MFG_TOKEN, EzspGetMfgTokenResponse.class); ezspHandlerMap.put(FRAME_ID_GET_MULTICAST_TABLE_ENTRY, EzspGetMulticastTableEntryResponse.class); @@ -392,6 +405,15 @@ public abstract class EzspFrame { ezspHandlerMap.put(FRAME_ID_SEND_REPLY, EzspSendReplyResponse.class); ezspHandlerMap.put(FRAME_ID_SEND_TRUST_CENTER_LINK_KEY, EzspSendTrustCenterLinkKeyResponse.class); ezspHandlerMap.put(FRAME_ID_SEND_UNICAST, EzspSendUnicastResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_CHECK_KEY_CONTEXT, EzspSecManCheckKeyContextResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_EXPORT_LINK_KEY_BY_EUI, EzspSecManExportLinkKeyByEuiResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_EXPORT_LINK_KEY_BY_INDEX, EzspSecManExportLinkKeyByIndexResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_EXPORT_TRANSIENT_KEY_BY_EUI, EzspSecManExportTransientKeyByEuiResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_EXPORT_TRANSIENT_KEY_BY_INDEX, EzspSecManExportTransientKeyByIndexResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_GET_APS_KEY_INFO, EzspSecManGetApsKeyInfoResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_GET_NETWORK_KEY_INFO, EzspSecManGetNetworkKeyInfoResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_IMPORT_LINK_KEY, EzspSecManImportLinkKeyResponse.class); + ezspHandlerMap.put(FRAME_ID_SEC_MAN_IMPORT_TRANSIENT_KEY, EzspSecManImportTransientKeyResponse.class); ezspHandlerMap.put(FRAME_ID_SET_ADDRESS_TABLE_REMOTE_EUI64, EzspSetAddressTableRemoteEui64Response.class); ezspHandlerMap.put(FRAME_ID_SET_ADDRESS_TABLE_REMOTE_NODE_ID, EzspSetAddressTableRemoteNodeIdResponse.class); ezspHandlerMap.put(FRAME_ID_SET_BINDING, EzspSetBindingResponse.class); diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspExportKeyRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspExportKeyRequest.java new file mode 100644 index 000000000..98c90ef7b --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspExportKeyRequest.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command exportKey. + *
+ * Exports a key from the security manager based on the provided context. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspExportKeyRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0114; + + /** + * The security manager context specifying which key to export. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspExportKeyRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The security manager context specifying which key to export. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The security manager context specifying which key to export. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + context.serialize(serializer); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(80); + builder.append("EzspExportKeyRequest [networkId="); + builder.append(networkId); + builder.append(", context="); + builder.append(context); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspExportKeyResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspExportKeyResponse.java new file mode 100644 index 000000000..79f682d30 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspExportKeyResponse.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; + +/** + * Class to implement the Ember EZSP command exportKey. + *
+ * Exports a key from the security manager based on the provided context. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspExportKeyResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0114; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * The exported key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData key; + + /** + * Response and Handler constructor + */ + public EzspExportKeyResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + key = deserializer.deserializeEmberKeyData(); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * The exported key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current key as {@link EmberKeyData} + */ + public EmberKeyData getKey() { + return key; + } + + /** + * The exported key data. + * + * @param key the key to set as {@link EmberKeyData} + */ + public void setKey(EmberKeyData key) { + this.key = key; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspExportKeyResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", key="); + builder.append(key); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspImportKeyRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspImportKeyRequest.java new file mode 100644 index 000000000..e17f28690 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspImportKeyRequest.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command importKey. + *
+ * Imports a key into the security manager based on the provided context. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspImportKeyRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0115; + + /** + * The security manager context specifying which key to import. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * The key data to import. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData key; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspImportKeyRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The security manager context specifying which key to import. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The security manager context specifying which key to import. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + /** + * The key data to import. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current key as {@link EmberKeyData} + */ + public EmberKeyData getKey() { + return key; + } + + /** + * The key data to import. + * + * @param key the key to set as {@link EmberKeyData} + */ + public void setKey(EmberKeyData key) { + this.key = key; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + context.serialize(serializer); + serializer.serializeEmberKeyData(key); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspImportKeyRequest [networkId="); + builder.append(networkId); + builder.append(", context="); + builder.append(context); + builder.append(", key="); + builder.append(key); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspImportKeyResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspImportKeyResponse.java new file mode 100644 index 000000000..0abe97e7e --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspImportKeyResponse.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; + +/** + * Class to implement the Ember EZSP command importKey. + *
+ * Imports a key into the security manager based on the provided context. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspImportKeyResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0115; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * Response and Handler constructor + */ + public EzspImportKeyResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(80); + builder.append("EzspImportKeyResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManCheckKeyContextRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManCheckKeyContextRequest.java new file mode 100644 index 000000000..d9fa0f29a --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManCheckKeyContextRequest.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManCheckKeyContext. + *
+ * Checks that the passed security manager context is valid. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManCheckKeyContextRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0110; + + /** + * The security manager context to check. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManCheckKeyContextRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The security manager context to check. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The security manager context to check. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + context.serialize(serializer); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspSecManCheckKeyContextRequest [networkId="); + builder.append(networkId); + builder.append(", context="); + builder.append(context); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManCheckKeyContextResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManCheckKeyContextResponse.java new file mode 100644 index 000000000..cd2144b72 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManCheckKeyContextResponse.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; + +/** + * Class to implement the Ember EZSP command secManCheckKeyContext. + *
+ * Checks that the passed security manager context is valid. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManCheckKeyContextResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0110; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * Response and Handler constructor + */ + public EzspSecManCheckKeyContextResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(80); + builder.append("EzspSecManCheckKeyContextResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByEuiRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByEuiRequest.java new file mode 100644 index 000000000..bdc71ba20 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByEuiRequest.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.IeeeAddress; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManExportLinkKeyByEui. + *
+ * Exports a link key from the security manager by EUI64. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportLinkKeyByEuiRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x010D; + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + */ + private IeeeAddress eui64; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManExportLinkKeyByEuiRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + * + * @return the current eui64 as {@link IeeeAddress} + */ + public IeeeAddress getEui64() { + return eui64; + } + + /** + * The EUI64 of the partner device. + * + * @param eui64 the eui64 to set as {@link IeeeAddress} + */ + public void setEui64(IeeeAddress eui64) { + this.eui64 = eui64; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeEmberEui64(eui64); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspSecManExportLinkKeyByEuiRequest [networkId="); + builder.append(networkId); + builder.append(", eui64="); + builder.append(eui64); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByEuiResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByEuiResponse.java new file mode 100644 index 000000000..86d52d666 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByEuiResponse.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; + +/** + * Class to implement the Ember EZSP command secManExportLinkKeyByEui. + *
+ * Exports a link key from the security manager by EUI64. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportLinkKeyByEuiResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x010D; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData plaintextKey; + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + */ + private EzspSecurityManagerApsKeyMetadata keyData; + + /** + * Response and Handler constructor + */ + public EzspSecManExportLinkKeyByEuiResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + context = new EzspSecurityManagerContext(); + context.deserialize(deserializer); + plaintextKey = deserializer.deserializeEmberKeyData(); + keyData = new EzspSecurityManagerApsKeyMetadata(); + keyData.deserialize(deserializer); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The context associated with the exported key. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current plaintextKey as {@link EmberKeyData} + */ + public EmberKeyData getPlaintextKey() { + return plaintextKey; + } + + /** + * The exported plaintext key data. + * + * @param plaintextKey the plaintextKey to set as {@link EmberKeyData} + */ + public void setPlaintextKey(EmberKeyData plaintextKey) { + this.plaintextKey = plaintextKey; + } + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + * + * @return the current keyData as {@link EzspSecurityManagerApsKeyMetadata} + */ + public EzspSecurityManagerApsKeyMetadata getKeyData() { + return keyData; + } + + /** + * The metadata associated with the exported key. + * + * @param keyData the keyData to set as {@link EzspSecurityManagerApsKeyMetadata} + */ + public void setKeyData(EzspSecurityManagerApsKeyMetadata keyData) { + this.keyData = keyData; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(200); + builder.append("EzspSecManExportLinkKeyByEuiResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", context="); + builder.append(context); + builder.append(", plaintextKey="); + builder.append(plaintextKey); + builder.append(", keyData="); + builder.append(keyData); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByIndexRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByIndexRequest.java new file mode 100644 index 000000000..051a486bd --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByIndexRequest.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManExportLinkKeyByIndex. + *
+ * Exports a link key from the security manager by index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportLinkKeyByIndexRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x010F; + + /** + * The index of the link key to export. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int index; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManExportLinkKeyByIndexRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The index of the link key to export. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current index as {@link int} + */ + public int getIndex() { + return index; + } + + /** + * The index of the link key to export. + * + * @param index the index to set as {@link int} + */ + public void setIndex(int index) { + this.index = index; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeUInt8(index); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspSecManExportLinkKeyByIndexRequest [networkId="); + builder.append(networkId); + builder.append(", index="); + builder.append(index); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByIndexResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByIndexResponse.java new file mode 100644 index 000000000..d3edb39ad --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportLinkKeyByIndexResponse.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; + +/** + * Class to implement the Ember EZSP command secManExportLinkKeyByIndex. + *
+ * Exports a link key from the security manager by index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportLinkKeyByIndexResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x010F; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData plaintextKey; + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + */ + private EzspSecurityManagerApsKeyMetadata keyData; + + /** + * Response and Handler constructor + */ + public EzspSecManExportLinkKeyByIndexResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + context = new EzspSecurityManagerContext(); + context.deserialize(deserializer); + plaintextKey = deserializer.deserializeEmberKeyData(); + keyData = new EzspSecurityManagerApsKeyMetadata(); + keyData.deserialize(deserializer); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The context associated with the exported key. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current plaintextKey as {@link EmberKeyData} + */ + public EmberKeyData getPlaintextKey() { + return plaintextKey; + } + + /** + * The exported plaintext key data. + * + * @param plaintextKey the plaintextKey to set as {@link EmberKeyData} + */ + public void setPlaintextKey(EmberKeyData plaintextKey) { + this.plaintextKey = plaintextKey; + } + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + * + * @return the current keyData as {@link EzspSecurityManagerApsKeyMetadata} + */ + public EzspSecurityManagerApsKeyMetadata getKeyData() { + return keyData; + } + + /** + * The metadata associated with the exported key. + * + * @param keyData the keyData to set as {@link EzspSecurityManagerApsKeyMetadata} + */ + public void setKeyData(EzspSecurityManagerApsKeyMetadata keyData) { + this.keyData = keyData; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(200); + builder.append("EzspSecManExportLinkKeyByIndexResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", context="); + builder.append(context); + builder.append(", plaintextKey="); + builder.append(plaintextKey); + builder.append(", keyData="); + builder.append(keyData); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByEuiRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByEuiRequest.java new file mode 100644 index 000000000..0701ab5ba --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByEuiRequest.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.IeeeAddress; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManExportTransientKeyByEui. + *
+ * Exports a transient key from the security manager by EUI64. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportTransientKeyByEuiRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0113; + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + */ + private IeeeAddress eui64; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManExportTransientKeyByEuiRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + * + * @return the current eui64 as {@link IeeeAddress} + */ + public IeeeAddress getEui64() { + return eui64; + } + + /** + * The EUI64 of the partner device. + * + * @param eui64 the eui64 to set as {@link IeeeAddress} + */ + public void setEui64(IeeeAddress eui64) { + this.eui64 = eui64; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeEmberEui64(eui64); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(100); + builder.append("EzspSecManExportTransientKeyByEuiRequest [networkId="); + builder.append(networkId); + builder.append(", eui64="); + builder.append(eui64); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByEuiResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByEuiResponse.java new file mode 100644 index 000000000..bda63db43 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByEuiResponse.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; + +/** + * Class to implement the Ember EZSP command secManExportTransientKeyByEui. + *
+ * Exports a transient key from the security manager by EUI64. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportTransientKeyByEuiResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0113; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData plaintextKey; + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + */ + private EzspSecurityManagerApsKeyMetadata keyData; + + /** + * Response and Handler constructor + */ + public EzspSecManExportTransientKeyByEuiResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + context = new EzspSecurityManagerContext(); + context.deserialize(deserializer); + plaintextKey = deserializer.deserializeEmberKeyData(); + keyData = new EzspSecurityManagerApsKeyMetadata(); + keyData.deserialize(deserializer); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The context associated with the exported key. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current plaintextKey as {@link EmberKeyData} + */ + public EmberKeyData getPlaintextKey() { + return plaintextKey; + } + + /** + * The exported plaintext key data. + * + * @param plaintextKey the plaintextKey to set as {@link EmberKeyData} + */ + public void setPlaintextKey(EmberKeyData plaintextKey) { + this.plaintextKey = plaintextKey; + } + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + * + * @return the current keyData as {@link EzspSecurityManagerApsKeyMetadata} + */ + public EzspSecurityManagerApsKeyMetadata getKeyData() { + return keyData; + } + + /** + * The metadata associated with the exported key. + * + * @param keyData the keyData to set as {@link EzspSecurityManagerApsKeyMetadata} + */ + public void setKeyData(EzspSecurityManagerApsKeyMetadata keyData) { + this.keyData = keyData; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(200); + builder.append("EzspSecManExportTransientKeyByEuiResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", context="); + builder.append(context); + builder.append(", plaintextKey="); + builder.append(plaintextKey); + builder.append(", keyData="); + builder.append(keyData); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByIndexRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByIndexRequest.java new file mode 100644 index 000000000..f9913ed19 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByIndexRequest.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManExportTransientKeyByIndex. + *
+ * Exports a transient key from the security manager by index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportTransientKeyByIndexRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0112; + + /** + * The index of the transient key to export. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int index; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManExportTransientKeyByIndexRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The index of the transient key to export. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current index as {@link int} + */ + public int getIndex() { + return index; + } + + /** + * The index of the transient key to export. + * + * @param index the index to set as {@link int} + */ + public void setIndex(int index) { + this.index = index; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeUInt8(index); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(100); + builder.append("EzspSecManExportTransientKeyByIndexRequest [networkId="); + builder.append(networkId); + builder.append(", index="); + builder.append(index); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByIndexResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByIndexResponse.java new file mode 100644 index 000000000..758d0d5a5 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManExportTransientKeyByIndexResponse.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; + +/** + * Class to implement the Ember EZSP command secManExportTransientKeyByIndex. + *
+ * Exports a transient key from the security manager by index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManExportTransientKeyByIndexResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0112; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData plaintextKey; + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + */ + private EzspSecurityManagerApsKeyMetadata keyData; + + /** + * Response and Handler constructor + */ + public EzspSecManExportTransientKeyByIndexResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + context = new EzspSecurityManagerContext(); + context.deserialize(deserializer); + plaintextKey = deserializer.deserializeEmberKeyData(); + keyData = new EzspSecurityManagerApsKeyMetadata(); + keyData.deserialize(deserializer); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * The context associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The context associated with the exported key. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + /** + * The exported plaintext key data. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current plaintextKey as {@link EmberKeyData} + */ + public EmberKeyData getPlaintextKey() { + return plaintextKey; + } + + /** + * The exported plaintext key data. + * + * @param plaintextKey the plaintextKey to set as {@link EmberKeyData} + */ + public void setPlaintextKey(EmberKeyData plaintextKey) { + this.plaintextKey = plaintextKey; + } + + /** + * The metadata associated with the exported key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + * + * @return the current keyData as {@link EzspSecurityManagerApsKeyMetadata} + */ + public EzspSecurityManagerApsKeyMetadata getKeyData() { + return keyData; + } + + /** + * The metadata associated with the exported key. + * + * @param keyData the keyData to set as {@link EzspSecurityManagerApsKeyMetadata} + */ + public void setKeyData(EzspSecurityManagerApsKeyMetadata keyData) { + this.keyData = keyData; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(220); + builder.append("EzspSecManExportTransientKeyByIndexResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", context="); + builder.append(context); + builder.append(", plaintextKey="); + builder.append(plaintextKey); + builder.append(", keyData="); + builder.append(keyData); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetApsKeyInfoRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetApsKeyInfoRequest.java new file mode 100644 index 000000000..9417837a6 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetApsKeyInfoRequest.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManGetApsKeyInfo. + *
+ * Gets the metadata for an APS key from the security manager. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManGetApsKeyInfoRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x010C; + + /** + * The security manager context specifying which key's info to retrieve. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + */ + private EzspSecurityManagerContext context; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManGetApsKeyInfoRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The security manager context specifying which key's info to retrieve. + *
+ * EZSP type is EzspSecurityManagerContext - Java type is {@link EzspSecurityManagerContext} + * + * @return the current context as {@link EzspSecurityManagerContext} + */ + public EzspSecurityManagerContext getContext() { + return context; + } + + /** + * The security manager context specifying which key's info to retrieve. + * + * @param context the context to set as {@link EzspSecurityManagerContext} + */ + public void setContext(EzspSecurityManagerContext context) { + this.context = context; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + context.serialize(serializer); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspSecManGetApsKeyInfoRequest [networkId="); + builder.append(networkId); + builder.append(", context="); + builder.append(context); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetApsKeyInfoResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetApsKeyInfoResponse.java new file mode 100644 index 000000000..c0ca42db5 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetApsKeyInfoResponse.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata; + +/** + * Class to implement the Ember EZSP command secManGetApsKeyInfo. + *
+ * Gets the metadata for an APS key from the security manager. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManGetApsKeyInfoResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x010C; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * The metadata associated with the APS key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + */ + private EzspSecurityManagerApsKeyMetadata keyData; + + /** + * Response and Handler constructor + */ + public EzspSecManGetApsKeyInfoResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + keyData = new EzspSecurityManagerApsKeyMetadata(); + keyData.deserialize(deserializer); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * The metadata associated with the APS key. + *
+ * EZSP type is EzspSecurityManagerApsKeyMetadata - Java type is {@link EzspSecurityManagerApsKeyMetadata} + * + * @return the current keyData as {@link EzspSecurityManagerApsKeyMetadata} + */ + public EzspSecurityManagerApsKeyMetadata getKeyData() { + return keyData; + } + + /** + * The metadata associated with the APS key. + * + * @param keyData the keyData to set as {@link EzspSecurityManagerApsKeyMetadata} + */ + public void setKeyData(EzspSecurityManagerApsKeyMetadata keyData) { + this.keyData = keyData; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(128); + builder.append("EzspSecManGetApsKeyInfoResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", keyData="); + builder.append(keyData); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetNetworkKeyInfoRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetNetworkKeyInfoRequest.java new file mode 100644 index 000000000..9cd9c7c84 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetNetworkKeyInfoRequest.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManGetNetworkKeyInfo. + *
+ * Gets information about the current and alternate network keys. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManGetNetworkKeyInfoRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0116; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManGetNetworkKeyInfoRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // No fields to serialize + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(64); + builder.append("EzspSecManGetNetworkKeyInfoRequest [networkId="); + builder.append(networkId); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetNetworkKeyInfoResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetNetworkKeyInfoResponse.java new file mode 100644 index 000000000..001826bd7 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManGetNetworkKeyInfoResponse.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerNetworkKeyInfo; + +/** + * Class to implement the Ember EZSP command secManGetNetworkKeyInfo. + *
+ * Gets information about the current and alternate network keys. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManGetNetworkKeyInfoResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0116; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * Information about the current and alternate network keys. + *
+ * EZSP type is EzspSecurityManagerNetworkKeyInfo - Java type is {@link EzspSecurityManagerNetworkKeyInfo} + */ + private EzspSecurityManagerNetworkKeyInfo networkKeyInfo; + + /** + * Response and Handler constructor + */ + public EzspSecManGetNetworkKeyInfoResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + networkKeyInfo = new EzspSecurityManagerNetworkKeyInfo(); + networkKeyInfo.deserialize(deserializer); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + /** + * Information about the current and alternate network keys. + *
+ * EZSP type is EzspSecurityManagerNetworkKeyInfo - Java type is {@link EzspSecurityManagerNetworkKeyInfo} + * + * @return the current networkKeyInfo as {@link EzspSecurityManagerNetworkKeyInfo} + */ + public EzspSecurityManagerNetworkKeyInfo getNetworkKeyInfo() { + return networkKeyInfo; + } + + /** + * Information about the current and alternate network keys. + * + * @param networkKeyInfo the networkKeyInfo to set as {@link EzspSecurityManagerNetworkKeyInfo} + */ + public void setNetworkKeyInfo(EzspSecurityManagerNetworkKeyInfo networkKeyInfo) { + this.networkKeyInfo = networkKeyInfo; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(128); + builder.append("EzspSecManGetNetworkKeyInfoResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(", networkKeyInfo="); + builder.append(networkKeyInfo); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportLinkKeyRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportLinkKeyRequest.java new file mode 100644 index 000000000..5b47fa6be --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportLinkKeyRequest.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.IeeeAddress; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManImportLinkKey. + *
+ * Imports a link key into the security manager at the specified index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManImportLinkKeyRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x010E; + + /** + * The index at which to import the link key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int index; + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + */ + private IeeeAddress address; + + /** + * The plaintext key data to import. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData plaintextKey; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManImportLinkKeyRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The index at which to import the link key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current index as {@link int} + */ + public int getIndex() { + return index; + } + + /** + * The index at which to import the link key. + * + * @param index the index to set as {@link int} + */ + public void setIndex(int index) { + this.index = index; + } + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + * + * @return the current address as {@link IeeeAddress} + */ + public IeeeAddress getAddress() { + return address; + } + + /** + * The EUI64 of the partner device. + * + * @param address the address to set as {@link IeeeAddress} + */ + public void setAddress(IeeeAddress address) { + this.address = address; + } + + /** + * The plaintext key data to import. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current plaintextKey as {@link EmberKeyData} + */ + public EmberKeyData getPlaintextKey() { + return plaintextKey; + } + + /** + * The plaintext key data to import. + * + * @param plaintextKey the plaintextKey to set as {@link EmberKeyData} + */ + public void setPlaintextKey(EmberKeyData plaintextKey) { + this.plaintextKey = plaintextKey; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeUInt8(index); + serializer.serializeEmberEui64(address); + serializer.serializeEmberKeyData(plaintextKey); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(128); + builder.append("EzspSecManImportLinkKeyRequest [networkId="); + builder.append(networkId); + builder.append(", index="); + builder.append(index); + builder.append(", address="); + builder.append(address); + builder.append(", plaintextKey="); + builder.append(plaintextKey); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportLinkKeyResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportLinkKeyResponse.java new file mode 100644 index 000000000..653f6c8cd --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportLinkKeyResponse.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; + +/** + * Class to implement the Ember EZSP command secManImportLinkKey. + *
+ * Imports a link key into the security manager at the specified index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManImportLinkKeyResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x010E; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * Response and Handler constructor + */ + public EzspSecManImportLinkKeyResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(80); + builder.append("EzspSecManImportLinkKeyResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportTransientKeyRequest.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportTransientKeyRequest.java new file mode 100644 index 000000000..2f61c6c1e --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportTransientKeyRequest.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.IeeeAddress; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameRequest; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyData; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember EZSP command secManImportTransientKey. + *
+ * Imports a transient key for a device into the security manager. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManImportTransientKeyRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0x0111; + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + */ + private IeeeAddress eui64; + + /** + * The plaintext key data to import. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + */ + private EmberKeyData plaintextKey; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspSecManImportTransientKeyRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The EUI64 of the partner device. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + * + * @return the current eui64 as {@link IeeeAddress} + */ + public IeeeAddress getEui64() { + return eui64; + } + + /** + * The EUI64 of the partner device. + * + * @param eui64 the eui64 to set as {@link IeeeAddress} + */ + public void setEui64(IeeeAddress eui64) { + this.eui64 = eui64; + } + + /** + * The plaintext key data to import. + *
+ * EZSP type is EmberKeyData - Java type is {@link EmberKeyData} + * + * @return the current plaintextKey as {@link EmberKeyData} + */ + public EmberKeyData getPlaintextKey() { + return plaintextKey; + } + + /** + * The plaintext key data to import. + * + * @param plaintextKey the plaintextKey to set as {@link EmberKeyData} + */ + public void setPlaintextKey(EmberKeyData plaintextKey) { + this.plaintextKey = plaintextKey; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeEmberEui64(eui64); + serializer.serializeEmberKeyData(plaintextKey); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(120); + builder.append("EzspSecManImportTransientKeyRequest [networkId="); + builder.append(networkId); + builder.append(", eui64="); + builder.append(eui64); + builder.append(", plaintextKey="); + builder.append(plaintextKey); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportTransientKeyResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportTransientKeyResponse.java new file mode 100644 index 000000000..3b8cc22c4 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspSecManImportTransientKeyResponse.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; + +/** + * Class to implement the Ember EZSP command secManImportTransientKey. + *
+ * Imports a transient key for a device into the security manager. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecManImportTransientKeyResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0x0111; + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + */ + private int slStatus; + + /** + * Response and Handler constructor + */ + public EzspSecManImportTransientKeyResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + slStatus = deserializer.deserializeUInt32(); + } + + /** + * The success or failure code of the operation. + *
+ * EZSP type is sl_status_t - Java type is {@link int} + * + * @return the current slStatus as {@link int} + */ + public int getSlStatus() { + return slStatus; + } + + /** + * The success or failure code of the operation. + * + * @param slStatus the slStatus to set as {@link int} + */ + public void setSlStatus(int slStatus) { + this.slStatus = slStatus; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(96); + builder.append("EzspSecManImportTransientKeyResponse [networkId="); + builder.append(networkId); + builder.append(", slStatus="); + builder.append(String.format("%08X", slStatus)); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerApsKeyMetadata.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerApsKeyMetadata.java new file mode 100644 index 000000000..35604e89d --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerApsKeyMetadata.java @@ -0,0 +1,183 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.structure; + +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspDeserializer; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember Structure EzspSecurityManagerApsKeyMetadata. + *
+ * Metadata about an APS key including bitmask, frame counters, and TTL. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecurityManagerApsKeyMetadata { + + /** + * A bitmask of key properties. + *
+ * EZSP type is uint16_t - Java type is {@link int} + */ + private int bitmask; + + /** + * The outgoing frame counter associated with this key. + *
+ * EZSP type is uint32_t - Java type is {@link int} + */ + private int outgoingFrameCounter; + + /** + * The incoming frame counter associated with this key. + *
+ * EZSP type is uint32_t - Java type is {@link int} + */ + private int incomingFrameCounter; + + /** + * The time to live in seconds for this key. + *
+ * EZSP type is uint16_t - Java type is {@link int} + */ + private int ttlInSeconds; + + /** + * Default Constructor + */ + public EzspSecurityManagerApsKeyMetadata() { + } + + public EzspSecurityManagerApsKeyMetadata(EzspDeserializer deserializer) { + deserialize(deserializer); + } + + /** + * A bitmask of key properties. + *
+ * EZSP type is uint16_t - Java type is {@link int} + * + * @return the current bitmask as {@link int} + */ + public int getBitmask() { + return bitmask; + } + + /** + * A bitmask of key properties. + * + * @param bitmask the bitmask to set as {@link int} + */ + public void setBitmask(int bitmask) { + this.bitmask = bitmask; + } + + /** + * The outgoing frame counter associated with this key. + *
+ * EZSP type is uint32_t - Java type is {@link int} + * + * @return the current outgoingFrameCounter as {@link int} + */ + public int getOutgoingFrameCounter() { + return outgoingFrameCounter; + } + + /** + * The outgoing frame counter associated with this key. + * + * @param outgoingFrameCounter the outgoingFrameCounter to set as {@link int} + */ + public void setOutgoingFrameCounter(int outgoingFrameCounter) { + this.outgoingFrameCounter = outgoingFrameCounter; + } + + /** + * The incoming frame counter associated with this key. + *
+ * EZSP type is uint32_t - Java type is {@link int} + * + * @return the current incomingFrameCounter as {@link int} + */ + public int getIncomingFrameCounter() { + return incomingFrameCounter; + } + + /** + * The incoming frame counter associated with this key. + * + * @param incomingFrameCounter the incomingFrameCounter to set as {@link int} + */ + public void setIncomingFrameCounter(int incomingFrameCounter) { + this.incomingFrameCounter = incomingFrameCounter; + } + + /** + * The time to live in seconds for this key. + *
+ * EZSP type is uint16_t - Java type is {@link int} + * + * @return the current ttlInSeconds as {@link int} + */ + public int getTtlInSeconds() { + return ttlInSeconds; + } + + /** + * The time to live in seconds for this key. + * + * @param ttlInSeconds the ttlInSeconds to set as {@link int} + */ + public void setTtlInSeconds(int ttlInSeconds) { + this.ttlInSeconds = ttlInSeconds; + } + + /** + * Serialise the contents of the EZSP structure. + * + * @param serializer the {@link EzspSerializer} used to serialize + */ + public int[] serialize(EzspSerializer serializer) { + // Serialize the fields + serializer.serializeUInt16(bitmask); + serializer.serializeUInt32(outgoingFrameCounter); + serializer.serializeUInt32(incomingFrameCounter); + serializer.serializeUInt16(ttlInSeconds); + return serializer.getPayload(); + } + + /** + * Deserialise the contents of the EZSP structure. + * + * @param deserializer the {@link EzspDeserializer} used to deserialize + */ + public void deserialize(EzspDeserializer deserializer) { + // Deserialize the fields + bitmask = deserializer.deserializeUInt16(); + outgoingFrameCounter = deserializer.deserializeUInt32(); + incomingFrameCounter = deserializer.deserializeUInt32(); + ttlInSeconds = deserializer.deserializeUInt16(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(192); + builder.append("EzspSecurityManagerApsKeyMetadata [bitmask="); + builder.append(String.format("%04X", bitmask)); + builder.append(", outgoingFrameCounter="); + builder.append(String.format("%08X", outgoingFrameCounter)); + builder.append(", incomingFrameCounter="); + builder.append(String.format("%08X", incomingFrameCounter)); + builder.append(", ttlInSeconds="); + builder.append(ttlInSeconds); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerContext.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerContext.java new file mode 100644 index 000000000..c60f55d89 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerContext.java @@ -0,0 +1,277 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.structure; + +import com.zsmartsystems.zigbee.IeeeAddress; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspDeserializer; +import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; + +/** + * Class to implement the Ember Structure EzspSecurityManagerContext. + *
+ * Context for the security manager specifying the key type, index, and other properties. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspSecurityManagerContext { + + /** + * The type of key being referenced. + *
+ * EZSP type is EzspSecurityManagerKeyType - Java type is {@link EzspSecurityManagerKeyType} + */ + private EzspSecurityManagerKeyType keyType; + + /** + * The index of the referenced key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int keyIndex; + + /** + * The type of derivation used to derive the referenced key. + *
+ * EZSP type is uint16_t - Java type is {@link int} + */ + private int derivedType; + + /** + * The EUI64 associated with this key. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + */ + private IeeeAddress eui64; + + /** + * The multi-network index for this key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int multiNetworkIndex; + + /** + * Flags associated with this key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int flags; + + /** + * The PSA key algorithm permission. + *
+ * EZSP type is uint32_t - Java type is {@link int} + */ + private int psaKeyAlgPermission; + + /** + * Default Constructor + */ + public EzspSecurityManagerContext() { + } + + public EzspSecurityManagerContext(EzspDeserializer deserializer) { + deserialize(deserializer); + } + + /** + * The type of key being referenced. + *
+ * EZSP type is EzspSecurityManagerKeyType - Java type is {@link EzspSecurityManagerKeyType} + * + * @return the current keyType as {@link EzspSecurityManagerKeyType} + */ + public EzspSecurityManagerKeyType getKeyType() { + return keyType; + } + + /** + * The type of key being referenced. + * + * @param keyType the keyType to set as {@link EzspSecurityManagerKeyType} + */ + public void setKeyType(EzspSecurityManagerKeyType keyType) { + this.keyType = keyType; + } + + /** + * The index of the referenced key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current keyIndex as {@link int} + */ + public int getKeyIndex() { + return keyIndex; + } + + /** + * The index of the referenced key. + * + * @param keyIndex the keyIndex to set as {@link int} + */ + public void setKeyIndex(int keyIndex) { + this.keyIndex = keyIndex; + } + + /** + * The type of derivation used to derive the referenced key. + *
+ * EZSP type is uint16_t - Java type is {@link int} + * + * @return the current derivedType as {@link int} + */ + public int getDerivedType() { + return derivedType; + } + + /** + * The type of derivation used to derive the referenced key. + * + * @param derivedType the derivedType to set as {@link int} + */ + public void setDerivedType(int derivedType) { + this.derivedType = derivedType; + } + + /** + * The EUI64 associated with this key. + *
+ * EZSP type is EmberEUI64 - Java type is {@link IeeeAddress} + * + * @return the current eui64 as {@link IeeeAddress} + */ + public IeeeAddress getEui64() { + return eui64; + } + + /** + * The EUI64 associated with this key. + * + * @param eui64 the eui64 to set as {@link IeeeAddress} + */ + public void setEui64(IeeeAddress eui64) { + this.eui64 = eui64; + } + + /** + * The multi-network index for this key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current multiNetworkIndex as {@link int} + */ + public int getMultiNetworkIndex() { + return multiNetworkIndex; + } + + /** + * The multi-network index for this key. + * + * @param multiNetworkIndex the multiNetworkIndex to set as {@link int} + */ + public void setMultiNetworkIndex(int multiNetworkIndex) { + this.multiNetworkIndex = multiNetworkIndex; + } + + /** + * Flags associated with this key. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current flags as {@link int} + */ + public int getFlags() { + return flags; + } + + /** + * Flags associated with this key. + * + * @param flags the flags to set as {@link int} + */ + public void setFlags(int flags) { + this.flags = flags; + } + + /** + * The PSA key algorithm permission. + *
+ * EZSP type is uint32_t - Java type is {@link int} + * + * @return the current psaKeyAlgPermission as {@link int} + */ + public int getPsaKeyAlgPermission() { + return psaKeyAlgPermission; + } + + /** + * The PSA key algorithm permission. + * + * @param psaKeyAlgPermission the psaKeyAlgPermission to set as {@link int} + */ + public void setPsaKeyAlgPermission(int psaKeyAlgPermission) { + this.psaKeyAlgPermission = psaKeyAlgPermission; + } + + /** + * Serialise the contents of the EZSP structure. + * + * @param serializer the {@link EzspSerializer} used to serialize + */ + public int[] serialize(EzspSerializer serializer) { + // Serialize the fields + serializer.serializeUInt8(keyType.getKey()); + serializer.serializeUInt8(keyIndex); + serializer.serializeUInt16(derivedType); + serializer.serializeEmberEui64(eui64); + serializer.serializeUInt8(multiNetworkIndex); + serializer.serializeUInt8(flags); + serializer.serializeUInt32(psaKeyAlgPermission); + return serializer.getPayload(); + } + + /** + * Deserialise the contents of the EZSP structure. + * + * @param deserializer the {@link EzspDeserializer} used to deserialize + */ + public void deserialize(EzspDeserializer deserializer) { + // Deserialize the fields + keyType = EzspSecurityManagerKeyType.getEzspSecurityManagerKeyType(deserializer.deserializeUInt8()); + keyIndex = deserializer.deserializeUInt8(); + derivedType = deserializer.deserializeUInt16(); + eui64 = deserializer.deserializeEmberEui64(); + multiNetworkIndex = deserializer.deserializeUInt8(); + flags = deserializer.deserializeUInt8(); + psaKeyAlgPermission = deserializer.deserializeUInt32(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(256); + builder.append("EzspSecurityManagerContext [keyType="); + builder.append(keyType); + builder.append(", keyIndex="); + builder.append(keyIndex); + builder.append(", derivedType="); + builder.append(String.format("%04X", derivedType)); + builder.append(", eui64="); + builder.append(eui64); + builder.append(", multiNetworkIndex="); + builder.append(multiNetworkIndex); + builder.append(", flags="); + builder.append(String.format("%02X", flags)); + builder.append(", psaKeyAlgPermission="); + builder.append(String.format("%08X", psaKeyAlgPermission)); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerKeyType.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerKeyType.java new file mode 100644 index 000000000..a93702e44 --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EzspSecurityManagerKeyType.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) 2016-2026 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.structure; + +import java.util.HashMap; +import java.util.Map; + +/** + * Class to implement the Ember Enumeration EzspSecurityManagerKeyType. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum EzspSecurityManagerKeyType {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * No key type.
+ */
+ NONE(0x00),
+
+ /**
+ * Network key.
+ */
+ NETWORK(0x01),
+
+ /**
+ * Trust Center link key.
+ */
+ TC_LINK(0x02),
+
+ /**
+ * Trust Center link key with timeout.
+ */
+ TC_LINK_WITH_TIMEOUT(0x03),
+
+ /**
+ * Application link key.
+ */
+ APP_LINK(0x04),
+
+ /**
+ * Green Power proxy table key.
+ */
+ GREEN_POWER_PROXY_TABLE_KEY(0x05),
+
+ /**
+ * Green Power sink table key.
+ */
+ GREEN_POWER_SINK_TABLE_KEY(0x06),
+
+ /**
+ * ZLL encryption key.
+ */
+ ZLL_ENCRYPTION_KEY(0x07),
+
+ /**
+ * ZLL preconfigured key.
+ */
+ ZLL_PRECONFIGURED_KEY(0x08),
+
+ /**
+ * Internal key type.
+ */
+ INTERNAL(0x09);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Information about the current and alternate network keys.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class EzspSecurityManagerNetworkKeyInfo {
+
+ /**
+ * Whether the current network key is set.
+ *
+ * EZSP type is bool - Java type is {@link boolean}
+ */
+ private boolean networkKeySet;
+
+ /**
+ * Whether the alternate network key is set.
+ *
+ * EZSP type is bool - Java type is {@link boolean}
+ */
+ private boolean alternateNetworkKeySet;
+
+ /**
+ * The sequence number associated with the current network key.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ */
+ private int networkKeySequenceNumber;
+
+ /**
+ * The sequence number associated with the alternate network key.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ */
+ private int altNetworkKeySequenceNumber;
+
+ /**
+ * The frame counter for the current network key.
+ *
+ * EZSP type is uint32_t - Java type is {@link int}
+ */
+ private int networkKeyFrameCounter;
+
+ /**
+ * Default Constructor
+ */
+ public EzspSecurityManagerNetworkKeyInfo() {
+ }
+
+ public EzspSecurityManagerNetworkKeyInfo(EzspDeserializer deserializer) {
+ deserialize(deserializer);
+ }
+
+ /**
+ * Whether the current network key is set.
+ *
+ * EZSP type is bool - Java type is {@link boolean}
+ *
+ * @return the current networkKeySet as {@link boolean}
+ */
+ public boolean getNetworkKeySet() {
+ return networkKeySet;
+ }
+
+ /**
+ * Whether the current network key is set.
+ *
+ * @param networkKeySet the networkKeySet to set as {@link boolean}
+ */
+ public void setNetworkKeySet(boolean networkKeySet) {
+ this.networkKeySet = networkKeySet;
+ }
+
+ /**
+ * Whether the alternate network key is set.
+ *
+ * EZSP type is bool - Java type is {@link boolean}
+ *
+ * @return the current alternateNetworkKeySet as {@link boolean}
+ */
+ public boolean getAlternateNetworkKeySet() {
+ return alternateNetworkKeySet;
+ }
+
+ /**
+ * Whether the alternate network key is set.
+ *
+ * @param alternateNetworkKeySet the alternateNetworkKeySet to set as {@link boolean}
+ */
+ public void setAlternateNetworkKeySet(boolean alternateNetworkKeySet) {
+ this.alternateNetworkKeySet = alternateNetworkKeySet;
+ }
+
+ /**
+ * The sequence number associated with the current network key.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ *
+ * @return the current networkKeySequenceNumber as {@link int}
+ */
+ public int getNetworkKeySequenceNumber() {
+ return networkKeySequenceNumber;
+ }
+
+ /**
+ * The sequence number associated with the current network key.
+ *
+ * @param networkKeySequenceNumber the networkKeySequenceNumber to set as {@link int}
+ */
+ public void setNetworkKeySequenceNumber(int networkKeySequenceNumber) {
+ this.networkKeySequenceNumber = networkKeySequenceNumber;
+ }
+
+ /**
+ * The sequence number associated with the alternate network key.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ *
+ * @return the current altNetworkKeySequenceNumber as {@link int}
+ */
+ public int getAltNetworkKeySequenceNumber() {
+ return altNetworkKeySequenceNumber;
+ }
+
+ /**
+ * The sequence number associated with the alternate network key.
+ *
+ * @param altNetworkKeySequenceNumber the altNetworkKeySequenceNumber to set as {@link int}
+ */
+ public void setAltNetworkKeySequenceNumber(int altNetworkKeySequenceNumber) {
+ this.altNetworkKeySequenceNumber = altNetworkKeySequenceNumber;
+ }
+
+ /**
+ * The frame counter for the current network key.
+ *
+ * EZSP type is uint32_t - Java type is {@link int}
+ *
+ * @return the current networkKeyFrameCounter as {@link int}
+ */
+ public int getNetworkKeyFrameCounter() {
+ return networkKeyFrameCounter;
+ }
+
+ /**
+ * The frame counter for the current network key.
+ *
+ * @param networkKeyFrameCounter the networkKeyFrameCounter to set as {@link int}
+ */
+ public void setNetworkKeyFrameCounter(int networkKeyFrameCounter) {
+ this.networkKeyFrameCounter = networkKeyFrameCounter;
+ }
+
+ /**
+ * Serialise the contents of the EZSP structure.
+ *
+ * @param serializer the {@link EzspSerializer} used to serialize
+ */
+ public int[] serialize(EzspSerializer serializer) {
+ // Serialize the fields
+ serializer.serializeUInt8(networkKeySet ? 1 : 0);
+ serializer.serializeUInt8(alternateNetworkKeySet ? 1 : 0);
+ serializer.serializeUInt8(networkKeySequenceNumber);
+ serializer.serializeUInt8(altNetworkKeySequenceNumber);
+ serializer.serializeUInt32(networkKeyFrameCounter);
+ return serializer.getPayload();
+ }
+
+ /**
+ * Deserialise the contents of the EZSP structure.
+ *
+ * @param deserializer the {@link EzspDeserializer} used to deserialize
+ */
+ public void deserialize(EzspDeserializer deserializer) {
+ // Deserialize the fields
+ networkKeySet = deserializer.deserializeUInt8() != 0;
+ alternateNetworkKeySet = deserializer.deserializeUInt8() != 0;
+ networkKeySequenceNumber = deserializer.deserializeUInt8();
+ altNetworkKeySequenceNumber = deserializer.deserializeUInt8();
+ networkKeyFrameCounter = deserializer.deserializeUInt32();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(224);
+ builder.append("EzspSecurityManagerNetworkKeyInfo [networkKeySet=");
+ builder.append(networkKeySet);
+ builder.append(", alternateNetworkKeySet=");
+ builder.append(alternateNetworkKeySet);
+ builder.append(", networkKeySequenceNumber=");
+ builder.append(String.format("%02X", networkKeySequenceNumber));
+ builder.append(", altNetworkKeySequenceNumber=");
+ builder.append(String.format("%02X", altNetworkKeySequenceNumber));
+ builder.append(", networkKeyFrameCounter=");
+ builder.append(String.format("%08X", networkKeyFrameCounter));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java
index 06bfc7822..e7bacd2c6 100644
--- a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java
+++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java
@@ -60,6 +60,9 @@
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberTransientKeyData;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberZigbeeNetwork;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspConfigId;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerNetworkKeyInfo;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspStatus;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.NwkLayerStatusCode;
@@ -423,4 +426,16 @@ public EmberMultiPhyRadioParameters deserializeEmberMultiPhyRadioParameters() {
public NwkLayerStatusCode deserializeNwkLayerStatusCode() {
return NwkLayerStatusCode.getNwkLayerStatusCode(deserializeUInt8());
}
+
+ public EzspSecurityManagerContext deserializeEzspSecurityManagerContext() {
+ return new EzspSecurityManagerContext(this);
+ }
+
+ public EzspSecurityManagerNetworkKeyInfo deserializeEzspSecurityManagerNetworkKeyInfo() {
+ return new EzspSecurityManagerNetworkKeyInfo(this);
+ }
+
+ public EzspSecurityManagerApsKeyMetadata deserializeEzspSecurityManagerApsKeyMetadata() {
+ return new EzspSecurityManagerApsKeyMetadata(this);
+ }
}
diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspSerializer.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspSerializer.java
index f6bb45be5..2dab75770 100644
--- a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspSerializer.java
+++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspSerializer.java
@@ -50,6 +50,9 @@
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspMfgTokenId;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspNetworkScanType;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspPolicyId;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerApsKeyMetadata;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerContext;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspSecurityManagerNetworkKeyInfo;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EzspValueId;
/**
@@ -329,4 +332,16 @@ public void serializeEmberKeyStatus(EmberKeyStatus emberKeyStatus) {
public void serializeEzspExtendedValueId(EzspExtendedValueId extendedValueId) {
buffer[length++] = extendedValueId.getKey();
}
+
+ public void serializeEzspSecurityManagerContext(EzspSecurityManagerContext context) {
+ context.serialize(this);
+ }
+
+ public void serializeEzspSecurityManagerNetworkKeyInfo(EzspSecurityManagerNetworkKeyInfo networkKeyInfo) {
+ networkKeyInfo.serialize(this);
+ }
+
+ public void serializeEzspSecurityManagerApsKeyMetadata(EzspSecurityManagerApsKeyMetadata apsKeyMetadata) {
+ apsKeyMetadata.serialize(this);
+ }
}