diff --git a/README.md b/README.md
index f0941837e5..69277c9602 100644
--- a/README.md
+++ b/README.md
@@ -79,23 +79,26 @@ The following clusters are currently supported -:
The framework implements a package structure that allows efficient use of re-usable components in a number of different applications.
-| Package | Description |
-| -------------------------------------------------- | ------------------------------------------------------ |
-| com.zsmartsystems.zigbee | The main framework and cluster library implementation |
-| com.zsmartsystems.zigbee.autocode | Code generator for the ZigBee cluster library classes |
-| com.zsmartsystems.zigbee.dongle.cc2531 | Dongle driver for the Texas Instruments ZNP CC2531 |
-| com.zsmartsystems.zigbee.dongle.conbee | Dongle driver for the Dresden Electronics Conbee |
-| com.zsmartsystems.zigbee.dongle.ember | Dongle driver for the Silabs EZSP Network Co-Processor |
-| com.zsmartsystems.zigbee.dongle.ember.autocode | Code generator for the Ember NCP dongle commands |
-| com.zsmartsystems.zigbee.dongle.telegesis | Dongle driver for the Telegesis dongle |
-| com.zsmartsystems.zigbee.dongle.telegesis.autocode | Code generator for the Telegesis dongle commands |
-| com.zsmartsystems.zigbee.dongle.xbee | Dongle driver for the Digi XBee dongle |
-| com.zsmartsystems.zigbee.dongle.xbee.autocode | Code generator for the XBee dongle commands |
-| com.zsmartsystems.zigbee.console | Console commands for the general framework |
-| com.zsmartsystems.zigbee.console.ember | Console commands for the Silabs Ember NCP |
-| com.zsmartsystems.zigbee.console.main | Main CLI console application |
-| com.zsmartsystems.zigbee.serial | Serial driver implementation |
-| com.zsmartsystems.zigbee.test | Overall tests and code coverage |
+| Package | Description |
+| -------------------------------------------------- | ------------------------------------------------------- |
+| com.zsmartsystems.zigbee | The main framework and cluster library implementation |
+| com.zsmartsystems.zigbee.autocode | Code generator for the ZigBee cluster library classes |
+| com.zsmartsystems.zigbee.dongle.cc2531 | Dongle driver for the Texas Instruments ZNP CC2531 |
+| com.zsmartsystems.zigbee.dongle.conbee | Dongle driver for the Dresden Electronics Conbee |
+| com.zsmartsystems.zigbee.dongle.ember | Dongle driver for the Silabs EZSP Network Co-Processor |
+| com.zsmartsystems.zigbee.dongle.ember.autocode | Code generator for the Ember NCP dongle commands |
+| com.zsmartsystems.zigbee.dongle.telegesis | Dongle driver for the Telegesis dongle |
+| com.zsmartsystems.zigbee.dongle.telegesis.autocode | Code generator for the Telegesis dongle commands |
+| com.zsmartsystems.zigbee.dongle.xbee | Dongle driver for the Digi XBee dongle |
+| com.zsmartsystems.zigbee.dongle.xbee.autocode | Code generator for the XBee dongle commands |
+| com.zsmartsystems.zigbee.dongle.zstack | Dongle driver for Texas Instruments Z-Stack 3 dongles |
+| com.zsmartsystems.zigbee.dongle.zstack.autocode | Code generator for the TI Z-Stack 3 dongle commands |
+| com.zsmartsystems.zigbee.console | Console commands for the general framework |
+| com.zsmartsystems.zigbee.console.ember | Console commands for the Silabs Ember NCP |
+| com.zsmartsystems.zigbee.console.main | Main CLI console application |
+| com.zsmartsystems.zigbee.console.zstack | Console commands for Texas Instruments ZNP of Z-Stack 3 |
+| com.zsmartsystems.zigbee.serial | Serial driver implementation |
+| com.zsmartsystems.zigbee.test | Overall tests and code coverage |
## Testing
@@ -145,7 +148,11 @@ The [com.zsmartsystems.zigbee.sniffer](https://github.com/zsmartsystems/com.zsma
### Texas Instruments CC2531
-The library supports the Texas Instruments ZNP protocol over a serial interface.
+The library supports the Texas Instruments Z-Stack Home 1.2 ZNP protocol over a serial interface as used by Zigbee Coordinator NCP firmware on TI CC2530 and CC2531 series based dongles.
+
+### Texas Instruments Z-Stack
+
+The library supports the Texas Instruments Z-Stack 3.x ZNP protocol over a serial interface as used by Zigbee Coordinator NCP firmware on TI CC2652 and CC1352 series based dongles.
### Telegesis ETRX3
@@ -180,12 +187,17 @@ The following table provides a summary of some of the dongles / chipsets that ar
| EFR32 | Yes (EZSP) | | | |
| **EM358LR** | Yes (EZSP) | -103dBm | **+20.0dBm** | Internal |
| MGM111 | Yes (EZSP) | -99dBm | +10.0dBm | Internal |
-| RaspBee | Yes (CONBEE) | **-105dBm** | +8.7dBm | Internal |
-| ConBee | Yes (CONBEE) | **-105dBm** | +8.7dBm | Internal |
+| RaspBee | Yes (CONBEE) | -105dBm | +8.7dBm | Internal |
+| ConBee | Yes (CONBEE) | -105dBm | +8.7dBm | Internal |
| CC2530 | Yes (ZNP) | -97dBm | +4.5dBm | |
| CC2531 | Yes (ZNP) | -97dBm | +4.5dBm | |
| CC2538 | Yes (ZNP) | -97dBm | +7.0dBm | |
| CC2650 | Yes (ZNP) | -100dBm | +5.0dBm | |
+| CC2652P | Yes (Z-Stack) | -105dBm | **+20.0dBm** | |
+| CC2652R | Yes (Z-Stack) | -105dBm | +5.0dBm | |
+| CC2652RB | Yes (Z-Stack) | -102dBm | +5.0dBm | |
+| CC1352P | Yes (Z-Stack) | **-121dBm** | **+20.0dBm** | |
+| CC1352R | Yes (Z-Stack) | **-121dBm** | +5.0dBm | |
| ATSAMR21 | No | -99dBm | +4.0dBm | |
| JN5169 | No | -96dBm | +10.0dBm | |
| HUSBZB-1 | Yes (EZSP) | | | Internal |
diff --git a/com.zsmartsystems.zigbee.autocode/.project b/com.zsmartsystems.zigbee.autocode/.project
index a27386da2f..faafd57e9b 100644
--- a/com.zsmartsystems.zigbee.autocode/.project
+++ b/com.zsmartsystems.zigbee.autocode/.project
@@ -20,4 +20,15 @@
");
+ out.print(indent + " * Note:");
+ len = 15;
+ continue;
+ }
+ if (len + word.length() > lineLen) {
+ out.println();
+ out.print(indent + " *");
+ len = 2;
+ }
+ out.print(" ");
+ out.print(word);
+ len += word.length();
+ }
+
+ out.println();
+ }
+
+ protected String formatParameterString(Parameter parameter) {
+ if (parameter.displayType != null) {
+ switch (parameter.displayType.toLowerCase()) {
+ case "hex":
+ String size = "";
+ if (parameter.displayLength != 0) {
+ size = "0" + parameter.displayLength;
+ }
+ return "String.format(\"%" + size + "X\", " + camelCaseToLowerCamelCase(parameter.name) + ")";
+ default:
+ break;
+ }
+ }
+ return camelCaseToLowerCamelCase(parameter.name);
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack.autocode/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/autocode/CommandGenerator.java b/com.zsmartsystems.zigbee.dongle.zstack.autocode/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/autocode/CommandGenerator.java
new file mode 100644
index 0000000000..c15c599163
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack.autocode/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/autocode/CommandGenerator.java
@@ -0,0 +1,1103 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.autocode;
+
+import static java.util.Objects.requireNonNull;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Command;
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Command.ZstackRequestType;
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Enumeration;
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Parameter;
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Protocol;
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Structure;
+import com.zsmartsystems.zigbee.dongle.zstack.autocode.xml.Value;
+
+/**
+ *
+ * @author Chris Jackson
+ *
+ */
+public class CommandGenerator extends ClassGenerator {
+ protected final String zssPackage = "com.zsmartsystems.zigbee";
+ protected final String zstackInternalPackage = "com.zsmartsystems.zigbee.dongle.zstack.internal";
+ protected final String zstackCommandPackage = "com.zsmartsystems.zigbee.dongle.zstack.api";
+
+ private List ");
+ if (command.description != null && !command.description.isEmpty()) {
+ outputWithLinebreak(out, "", command.description);
+ out.println(" * ");
+ }
+ out.println(" * Note that this code is autogenerated. Manual changes may be overwritten.");
+ out.println(" */");
+ out.println("");
+ addImport("javax.annotation.Generated");
+ out.println("@Generated(value = \"com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator\", date = \"" + new Date() + "\")");
+
+ if (className.endsWith("Srsp") || className.endsWith("Areq")) {
+ addImport(zstackCommandPackage + ".ZstackFrameResponse");
+ out.println("public class " + className + " extends ZstackFrameResponse {");
+ } else {
+ addImport(zstackCommandPackage + ".ZstackFrameRequest");
+ out.println("public class " + className + " extends ZstackFrameRequest {");
+ }
+
+ for (Parameter parameter : requireNonNull(parameters, "Parameters may not be null")) {
+ if (parameter.auto_size != null) {
+ continue;
+ }
+
+ out.println();
+ out.println(" /**");
+ if (parameter.description != null && !parameter.description.isEmpty()) {
+ outputWithLinebreak(out, " ", parameter.description);
+ }
+ if (parameter.multiple) {
+ out.println(" * ");
+ out.println(" * Parameter allows multiple options so implemented as a {@link Set}.");
+ }
+ out.println(" */");
+ if (parameter.multiple) {
+ addImport("java.util.Set");
+ addImport("java.util.HashSet");
+ out.println(" private Set<" + getTypeClass(command.subsystem, parameter.data_type) + "> "
+ + camelCaseToLowerCamelCase(parameter.name) + " = new HashSet<>();");
+ } else {
+ out.println(" private " + getTypeClass(command.subsystem, parameter.data_type) + " "
+ + camelCaseToLowerCamelCase(parameter.name) + ";");
+ }
+
+ // out.println(" private " + getTypeClass(command.subsystem, parameter.data_type) + " "
+ // + camelCaseToLowerCamelCase(parameter.name) + ";");
+ }
+
+ if (className.endsWith("Srsp") || className.endsWith("Areq")) {
+ out.println();
+ out.println(" /**");
+ out.println(" * Response and Handler constructor");
+ out.println(" */");
+ out.println(" public " + className + "(int[] inputBuffer) {");
+ out.println(" // Super creates deserializer and reads header fields");
+ out.println(" super(inputBuffer);");
+ if (className.endsWith("Srsp")) {
+ out.println();
+ out.println(" synchronousCommand = true;");
+ }
+ out.println();
+ out.println(" // Deserialize the fields");
+ Map ");
+ if (structure.description != null && !structure.description.isEmpty()) {
+ outputWithLinebreak(out, "", structure.description);
+ out.println(" * ");
+ }
+ out.println(" * Note that this code is autogenerated. Manual changes may be overwritten.");
+ out.println(" *");
+ out.println(" * @author Chris Jackson");
+ out.println(" */");
+
+ addImport(zstackInternalPackage + ".serializer.ZstackSerializer");
+ addImport(zstackInternalPackage + ".serializer.ZstackDeserializer");
+ out.println("public class " + className + " {");
+
+ for (Parameter parameter : requireNonNull(structure.parameters, "Parameters in structure may not be empty")) {
+ if (parameter.auto_size != null) {
+ continue;
+ }
+
+ out.println();
+ out.println(" /**");
+ if (parameter.description != null && !parameter.description.isEmpty()) {
+ outputWithLinebreak(out, " ", parameter.description);
+ }
+ if (parameter.multiple) {
+ out.println(" * ");
+ out.println(" * Parameter allows multiple options so implemented as a {@link Set}.");
+ }
+ out.println(" */");
+ if (parameter.multiple) {
+ addImport("java.util.Set");
+ addImport("java.util.HashSet");
+ out.println(" private Set<" + getTypeClass(structure.subsystem, parameter.data_type) + "> "
+ + camelCaseToLowerCamelCase(parameter.name) + " = new HashSet<>();");
+ } else {
+ out.println(" private " + getTypeClass(structure.subsystem, parameter.data_type) + " "
+ + camelCaseToLowerCamelCase(parameter.name) + ";");
+ }
+
+ // out.println(" private " + getTypeClass(command.subsystem, parameter.data_type) + " "
+ // + camelCaseToLowerCamelCase(parameter.name) + ";");
+ }
+
+ for (Parameter parameter : structure.parameters) {
+ if (parameter.auto_size != null) {
+ continue;
+ }
+
+ out.println();
+ out.println(" /**");
+ outputWithLinebreak(out, " ", parameter.description);
+ out.println(" *");
+ if (parameter.multiple) {
+ out.println(" * @return the current " + camelCaseToLowerCamelCase(parameter.name)
+ + " as {@link Set} of {@link " + getTypeClass(structure.subsystem, parameter.data_type) + "}");
+ } else {
+ out.println(" * @return the current " + camelCaseToLowerCamelCase(parameter.name) + " as {@link "
+ + getTypeClass(structure.subsystem, parameter.data_type) + "}");
+ }
+ out.println(" */");
+ if (parameter.multiple) {
+ out.println(" public Set<" + getTypeClass(structure.subsystem, parameter.data_type) + "> get"
+ + upperCaseFirstCharacter(parameter.name) + "() {");
+ } else {
+ out.println(" public " + getTypeClass(structure.subsystem, parameter.data_type) + " get"
+ + upperCaseFirstCharacter(parameter.name) + "() {");
+ }
+
+ out.println(" return " + camelCaseToLowerCamelCase(parameter.name) + ";");
+ out.println(" }");
+ out.println();
+
+ if (parameter.multiple) {
+ out.println(" /**");
+ outputWithLinebreak(out, " ", parameter.description);
+ out.println(" *");
+ out.println(" * @param " + camelCaseToLowerCamelCase(parameter.name) + " the " + parameter.name
+ + " to add to the {@link Set} as {@link "
+ + getTypeClass(structure.subsystem, parameter.data_type) + "}");
+ out.println(" */");
+ out.println(" public void add" + upperCaseFirstCharacter(parameter.name) + "("
+ + getTypeClass(structure.subsystem, parameter.data_type) + " "
+ + camelCaseToLowerCamelCase(parameter.name) + ") {");
+ out.println(" this." + camelCaseToLowerCamelCase(parameter.name) + ".add("
+ + camelCaseToLowerCamelCase(parameter.name) + ");");
+ out.println(" }");
+ out.println();
+ out.println(" /**");
+ outputWithLinebreak(out, " ", parameter.description);
+ out.println(" *");
+ out.println(" * @param " + camelCaseToLowerCamelCase(parameter.name) + " the " + parameter.name
+ + " to remove to the {@link Set} as {@link "
+ + getTypeClass(structure.subsystem, parameter.data_type) + "}");
+ out.println(" */");
+ out.println(" public void remove" + upperCaseFirstCharacter(parameter.name) + "("
+ + getTypeClass(structure.subsystem, parameter.data_type) + " "
+ + camelCaseToLowerCamelCase(parameter.name) + ") {");
+ out.println(" this." + camelCaseToLowerCamelCase(parameter.name) + ".remove("
+ + camelCaseToLowerCamelCase(parameter.name) + ");");
+ out.println(" }");
+ } else {
+ out.println(" /**");
+ outputWithLinebreak(out, " ", parameter.description);
+ out.println(" *");
+ out.println(" * @param " + camelCaseToLowerCamelCase(parameter.name) + " the " + parameter.name
+ + " to set as {@link " + getTypeClass(structure.subsystem, parameter.data_type) + "}");
+ out.println(" */");
+ out.println(" public void set" + upperCaseFirstCharacter(parameter.name) + "("
+ + getTypeClass(structure.subsystem, parameter.data_type) + " "
+ + camelCaseToLowerCamelCase(parameter.name) + ") {");
+ out.println(" this." + camelCaseToLowerCamelCase(parameter.name) + " = "
+ + camelCaseToLowerCamelCase(parameter.name) + ";");
+ out.println(" }");
+ }
+ }
+
+ out.println();
+ out.println(" /**");
+ out.println(" * Serialize the data from this structure class to an integer array");
+ out.println(" *");
+ out.println(" * @param serializer the {@link ZstackSerializer} to use");
+ out.println(" */");
+ out.println(" public int[] serialize(ZstackSerializer serializer) {");
+ out.println(" // Serialize the fields");
+ for (Parameter parameter : structure.parameters) {
+ String enumModifier = "";
+ if (getDataType(parameter.data_type) != parameter.data_type) {
+ enumModifier = ".getKey()";
+ }
+ if (parameter.auto_size != null) {
+ out.println(" serializer.serialize" + getTypeSerializer(structure.subsystem, parameter.data_type)
+ + "(" + camelCaseToLowerCamelCase(parameter.auto_size) + ".length);");
+ continue;
+ }
+ if (parameter.multiple) {
+ out.println(" " + getTypeClass(structure.subsystem, getDataType(parameter.data_type)) + " tmp"
+ + upperCaseFirstCharacter(parameter.name) + " = 0;");
+ out.println(" for (" + getTypeClass(parameter.data_type) + " value : "
+ + camelCaseToLowerCamelCase(parameter.name) + ") {");
+ out.println(" tmp" + upperCaseFirstCharacter(parameter.name) + " += value.getKey();");
+ out.println(" }");
+ out.println(" serializer.serialize" + getTypeSerializer(structure.subsystem, parameter.data_type)
+ + "(" + "tmp" + upperCaseFirstCharacter(parameter.name) + ");");
+ } else {
+ out.println(" serializer.serialize" + getTypeSerializer(structure.subsystem, parameter.data_type)
+ + "(" + camelCaseToLowerCamelCase(parameter.name) + enumModifier + ");");
+ }
+ }
+ out.println(" return serializer.getBuffer();");
+ out.println(" }");
+
+ out.println();
+ out.println(" /**");
+ out.println(" * Deserialize the data into this structure class");
+ out.println(" *");
+ out.println(" * @param deserializer the {@link ZstackDeserializer} to use");
+ out.println(" */");
+ out.println(" public void deserialize (ZstackDeserializer deserializer) {");
+ out.println(" // Deserialize the fields");
+ Map ");
+ outputWithLinebreak(out, "", enumeration.description);
+ }
+ out.println(" * ");
+ out.println(" * Note that this code is autogenerated. Manual changes may be overwritten.");
+ out.println(" *");
+ out.println(" * @author Chris Jackson");
+ out.println(" */");
+
+ out.println("public enum " + className + " {");
+
+ if (!enumeration.fullyDefined) {
+ out.println(" /**");
+ out.println(" * Default unknown value");
+ out.println(" */");
+ out.println(" UNKNOWN(-1),");
+ }
+
+ boolean first = true;
+ for (Value value : enumeration.values) {
+ if (!first) {
+ out.println(",");
+ }
+ first = false;
+ out.println();
+ out.println(" /**");
+ outputWithLinebreak(out, " ", value.description);
+ out.println(" */");
+ out.print(" " + super.stringToConstant(value.name) + "(0x" + String.format("%04X", value.enum_value)
+ + ")");
+ }
+
+ out.println(";");
+
+ out.println();
+ out.println(" /**");
+ out.println(" * A mapping between the integer code and its corresponding type to");
+ out.println(" * facilitate lookup by code.");
+ out.println(" */");
+ out.println(" private static Map ");
+ out.println(" * Note that this code is autogenerated. Manual changes may be overwritten.");
+ out.println(" *");
+ out.println(" * @author Chris Jackson");
+ out.println(" */");
+ out.println("public class ZstackFrameFactory {");
+ out.println(" /**");
+ out.println(" * Logger");
+ out.println(" */");
+ out.println(" private static Logger logger = LoggerFactory.getLogger(ZstackFrameFactory.class);");
+
+ out.println();
+
+ out.println(" /*");
+ out.println(" * Subsystem definitions");
+ out.println(" */");
+ out.println(" public static int ZSTACK_RPC = 0x0000;");
+ out.println(" public static int ZSTACK_SYS = 0x0100;");
+ out.println(" public static int ZSTACK_MAC = 0x0200;");
+ out.println(" public static int ZSTACK_AF = 0x0400;");
+ out.println(" public static int ZSTACK_ZDO = 0x0500;");
+ out.println(" public static int ZSTACK_SAPI = 0x0600;");
+ out.println(" public static int ZSTACK_UTIL = 0x0700;");
+ out.println(" public static int ZSTACK_APP_CNF = 0x0F00;");
+ out.println(" public static int ZSTACK_SBL = 0x0D00;");
+ out.println();
+ out.println(" /**");
+ out.println(" * Subsystem definition mask");
+ out.println(" */");
+ out.println(" private static int ZSTACK_SUBSYSTEM_MASK = 0x1F;");
+ out.println();
+
+ for (Command command : commandMap.values()) {
+ if (command.requestType == ZstackRequestType.ASYNCMD) {
+ continue;
+ }
+
+ String reference = camelCaseToConstant(
+ command.name.substring(0, 1).toUpperCase() + command.name.substring(1));
+ out.println(
+ " private static final int " + reference + " = 0x" + String.format("%02X", command.id) + ";");
+ }
+
+ out.println();
+ out.println(" private static Map
+ * Usage notes...
+ *
+ * APP_CNF_BDB_SET_ACTIVE_DEFAULT_CENTRALIZED_KEY
+ *
+ * @param mode the {@link ZstackCentralizedLinkKeyMode}
+ * @param installCode array with the code in the required format
+ * @return {@link ZstackResponseCode} returned from the NCP
+ */
+ public ZstackResponseCode setCentralisedKey(ZstackCentralizedLinkKeyMode mode, int[] installCode) {
+ ZstackAppCnfBdbSetActiveDefaultCentralizedKeySreq request = new ZstackAppCnfBdbSetActiveDefaultCentralizedKeySreq();
+ request.setCentralizedLinkKeyMode(mode);
+ request.setInstallCode(installCode);
+ ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp response = protocolHandler.sendTransaction(request, ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp.class);
+
+ return response == null ? ZstackResponseCode.FAILURE : response.getStatus();
+ }
+
+ /**
+ * Registers for a ZDO callback
+ *
+ * @return {@link ZstackResponseCode} returned from the NCP
+ */
+ public ZstackResponseCode zdoRegisterCallback(int clusterId) {
+ ZstackZdoMsgCbRegisterSreq request = new ZstackZdoMsgCbRegisterSreq();
+ request.setClusterId(clusterId);
+ ZstackZdoMsgCbRegisterSrsp response = protocolHandler.sendTransaction(request, ZstackZdoMsgCbRegisterSrsp.class);
+
+ return response == null ? ZstackResponseCode.FAILURE : response.getStatus();
+ }
+
+ /**
+ * Registers an AF Endpoint in the NCP
+ *
+ * @param endpointId the endpoint number to add
+ * @param deviceId the device id for the endpoint
+ * @param profileId the profile id
+ * @param inputClusters an array of input clusters supported by the endpoint
+ * @param outputClusters an array of output clusters supported by the endpoint
+ * @return {@link ZstackResponseCode} returned from the NCP
+ */
+ public ZstackResponseCode addEndpoint(int endpointId, int deviceId, int profileId, int[] inputClusters, int[] outputClusters) {
+ ZstackAfRegisterSreq request = new ZstackAfRegisterSreq();
+ request.setEndPoint(endpointId);
+ request.setAppDeviceId(deviceId);
+ request.setAppProfId(profileId);
+ request.setAppInClusterList(inputClusters);
+ request.setAppOutClusterList(outputClusters);
+ request.setLatencyReq(0);
+ request.setAppDevVer(0);
+
+ ZstackAfRegisterSrsp response = protocolHandler.sendTransaction(request, ZstackAfRegisterSrsp.class);
+
+ return response == null ? ZstackResponseCode.FAILURE : response.getStatus();
+ }
+
+ public ZstackSysVersionSrsp getVersion() {
+ return protocolHandler.sendTransaction(new ZstackSysVersionSreq(), ZstackSysVersionSrsp.class);
+ }
+
+ public ZstackUtilGetDeviceInfoSrsp getDeviceInfo() {
+ return protocolHandler.sendTransaction(new ZstackUtilGetDeviceInfoSreq(), ZstackUtilGetDeviceInfoSrsp.class);
+ }
+
+ public ZstackZdoExtNwkInfoSrsp getNetworkInfo() {
+ return protocolHandler.sendTransaction(new ZstackZdoExtNwkInfoSreq(), ZstackZdoExtNwkInfoSrsp.class);
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/ZstackCommand.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/ZstackCommand.java
new file mode 100644
index 0000000000..b7236ad9dc
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/ZstackCommand.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api;
+
+/**
+ * Base class for all ZStack commands
+ *
+ * @author Chris Jackson
+ *
+ */
+public abstract class ZstackCommand {
+ /**
+ * Definitions of API subsystems
+ */
+ protected static int ZSTACK_RPC = 0x00;
+ protected static int ZSTACK_SYS = 0x01;
+ protected static int ZSTACK_MAC = 0x02;
+ protected static int ZSTACK_AF = 0x04;
+ protected static int ZSTACK_ZDO = 0x05;
+ protected static int ZSTACK_SAPI = 0x06;
+ protected static int ZSTACK_UTIL = 0x07;
+ protected static int ZSTACK_APP = 0x09;
+ protected static int ZSTACK_SBL = 0x0D;
+ protected static int ZSTACK_APP_CNF = 0x0F;
+
+ /**
+ * Flag denoting if this command/request is done synchronously
+ */
+ protected boolean synchronousCommand = false;
+
+ /**
+ * Returns true if this request/response is performed synchronously
+ *
+ * @return true if the request requires asynchronous response
+ */
+ public boolean isSynchronous() {
+ return synchronousCommand;
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/ZstackFrameFactory.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/ZstackFrameFactory.java
new file mode 100644
index 0000000000..d8731ae15a
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/ZstackFrameFactory.java
@@ -0,0 +1,242 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.af.ZstackAfDataConfirmAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.af.ZstackAfDataRequestSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.af.ZstackAfIncomingMsgAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.af.ZstackAfRegisterSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfBdbAddInstallcodeSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfBdbCommissioningNotificationAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfBdbSetChannelSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackAppCnfSetAllowrejoinTcPolicySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.mac.ZstackMacScanReqSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sapi.ZstackZbGetDeviceInfoSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sapi.ZstackZbReadConfigurationSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sapi.ZstackZbWriteConfigurationSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sbl.ZstackSbHandshakeCmdSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sbl.ZstackSbWriteCmdSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysGetExtAddrSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysNvReadSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysOsalNvReadSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysOsalNvWriteSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysPingSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysResetIndAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysSetExtAddrSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysSetTxPowerSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysVersionSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysZdiagsClearStatsSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysZdiagsGetStatsSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysZdiagsInitStatsSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysZdiagsRestoreStatsNvSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackSysZdiagsSaveStatsToNvSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilApsmeLinkKeyDataGetSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilApsmeLinkKeyNvIdGetSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilGetDeviceInfoSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilGetNvInfoSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilLedControlSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilSetChannelsSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilSetPanidSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilSetPrecfgkeySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.util.ZstackUtilSetSeclevelSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoExtNwkInfoSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoGetLinkKeySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoLeaveIndAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoMsgCbIncomingAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoMsgCbRegisterSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoNwkDiscoveryReqSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoRemoveLinkKeySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoSetLinkKeySrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoStartupFromAppSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoStateChangeIndAreq;
+import com.zsmartsystems.zigbee.dongle.zstack.api.zdo.ZstackZdoTcDevIndAreq;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Factory class to create Z-Stack commands from incoming data. This will only create {@link ZstackFrameResponse}s.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public class ZstackFrameFactory {
+ /**
+ * Logger
+ */
+ private static Logger logger = LoggerFactory.getLogger(ZstackFrameFactory.class);
+
+ /*
+ * Subsystem definitions
+ */
+ public static int ZSTACK_RPC = 0x0000;
+ public static int ZSTACK_SYS = 0x0100;
+ public static int ZSTACK_MAC = 0x0200;
+ public static int ZSTACK_AF = 0x0400;
+ public static int ZSTACK_ZDO = 0x0500;
+ public static int ZSTACK_SAPI = 0x0600;
+ public static int ZSTACK_UTIL = 0x0700;
+ public static int ZSTACK_APP_CNF = 0x0F00;
+ public static int ZSTACK_SBL = 0x0D00;
+
+ /**
+ * Subsystem definition mask
+ */
+ private static int ZSTACK_SUBSYSTEM_MASK = 0x1F;
+
+ private static final int AF_DATA_CONFIRM = 0x80;
+ private static final int AF_DATA_REQUEST = 0x01;
+ private static final int AF_INCOMING_MSG = 0x81;
+ private static final int AF_REGISTER = 0x00;
+ private static final int APP_CNF_BDB_ADD_INSTALLCODE = 0x04;
+ private static final int APP_CNF_BDB_COMMISSIONING_NOTIFICATION = 0x80;
+ private static final int APP_CNF_BDB_SET_ACTIVE_DEFAULT_CENTRALIZED_KEY = 0x07;
+ private static final int APP_CNF_BDB_SET_CHANNEL = 0x08;
+ private static final int APP_CNF_BDB_SET_JOINUSESINSTALLCODEKEY = 0x06;
+ private static final int APP_CNF_BDB_SET_TC_REQUIRE_KEY_EXCHANGE = 0x09;
+ private static final int APP_CNF_SET_ALLOWREJOIN_TC_POLICY = 0x03;
+ private static final int MAC_SCAN_REQ = 0x0C;
+ private static final int RPC_SREQ_ERROR = 0x00;
+ private static final int SB_HANDSHAKE_CMD = 0x04;
+ private static final int SB_WRITE_CMD = 0x00;
+ private static final int SYS_GET_EXT_ADDR = 0x04;
+ private static final int SYS_NV_READ = 0x33;
+ private static final int SYS_OSAL_NV_READ = 0x08;
+ private static final int SYS_OSAL_NV_WRITE = 0x09;
+ private static final int SYS_PING = 0x01;
+ private static final int SYS_RESET_IND = 0x80;
+ private static final int SYS_SET_EXT_ADDR = 0x03;
+ private static final int SYS_SET_TX_POWER = 0x14;
+ private static final int SYS_VERSION = 0x02;
+ private static final int SYS_ZDIAGS_CLEAR_STATS = 0x18;
+ private static final int SYS_ZDIAGS_GET_STATS = 0x19;
+ private static final int SYS_ZDIAGS_INIT_STATS = 0x17;
+ private static final int SYS_ZDIAGS_RESTORE_STATS_NV = 0x1A;
+ private static final int SYS_ZDIAGS_SAVE_STATS_TO_NV = 0x1B;
+ private static final int UTIL_APSME_LINK_KEY_DATA_GET = 0x44;
+ private static final int UTIL_APSME_LINK_KEY_NV_ID_GET = 0x45;
+ private static final int UTIL_GET_DEVICE_INFO = 0x00;
+ private static final int UTIL_GET_NV_INFO = 0x01;
+ private static final int UTIL_LED_CONTROL = 0x09;
+ private static final int UTIL_SET_CHANNELS = 0x03;
+ private static final int UTIL_SET_PANID = 0x02;
+ private static final int UTIL_SET_PRECFGKEY = 0x05;
+ private static final int UTIL_SET_SECLEVEL = 0x04;
+ private static final int ZB_GET_DEVICE_INFO = 0x06;
+ private static final int ZB_READ_CONFIGURATION = 0x04;
+ private static final int ZB_WRITE_CONFIGURATION = 0x05;
+ private static final int ZDO_EXT_NWK_INFO = 0x50;
+ private static final int ZDO_GET_LINK_KEY = 0x25;
+ private static final int ZDO_LEAVE_IND = 0xC9;
+ private static final int ZDO_MSG_CB_INCOMING = 0xFF;
+ private static final int ZDO_MSG_CB_REGISTER = 0x3E;
+ private static final int ZDO_NWK_DISCOVERY_REQ = 0x26;
+ private static final int ZDO_REMOVE_LINK_KEY = 0x24;
+ private static final int ZDO_SET_LINK_KEY = 0x23;
+ private static final int ZDO_STARTUP_FROM_APP = 0x40;
+ private static final int ZDO_STATE_CHANGE_IND = 0xC0;
+ private static final int ZDO_TC_DEV_IND = 0xCA;
+
+ private static Map
+ * Global response codes
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackResponseCode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ SUCCESS(0x0000),
+
+ /**
+ *
+ */
+ FAILURE(0x0001),
+
+ /**
+ *
+ */
+ AF_INVALID_PARAMETER(0x0002),
+
+ /**
+ * Security manager key table full
+ */
+ AF_MEM_FAIL(0x0010),
+
+ /**
+ * Security manager key table full
+ */
+ KEY_TABLE_FULL(0x0011),
+
+ /**
+ * The operation could not be completed because no memory resources were available
+ */
+ MAC_NO_RESOURCES(0x001A),
+
+ /**
+ * Invalid Request
+ */
+ INVALID_REQUEST(0x00C2),
+
+ /**
+ * Not Permitted
+ */
+ NOT_PERMITTED(0x00C3),
+
+ /**
+ * Unknown Device
+ */
+ UNKNOWN_DEVICE(0x00C8),
+
+ /**
+ *
+ */
+ AF_NO_ROUTE(0x00CD),
+
+ /**
+ * The scan request failed because a scan is already in progress
+ */
+ MAC_SCAN_IN_PROGRESS(0x00FC),
+
+ /**
+ * The outstanding transaction has expired
+ */
+ MAC_TRANSACTION_EXPIRED(0x00F0);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Options applied when sending frames
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum AfDataOptions {
+
+ /**
+ * Set this bit to request APS acknowledgement for this packet
+ */
+ AF_ACK_REQUEST(0x0010),
+
+ /**
+ * Set this bit to force route discovery if a routing table entry doesn’t exist
+ */
+ AF_DISCV_ROUTE(0x0020),
+
+ /**
+ * Set this bit to enable APS security for this packet.
+ */
+ AF_EN_SECURITY(0x0040),
+
+ /**
+ * Skip routing.
+ */
+ AF_NO_ROUTING(0x0080);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * This command is sent by the device to the user after it receives an AF_DATA_REQUEST. For each AF_DATA_REQUEST, a
+ * AF_DATA_CONFIRM is always returned. If APS acknowledgement was used for the AF_DATA_REQUEST, the confirm carries the status
+ * of whether the APS acknowledgement was received or not (ZApsNoAck – 0xb7). If APS acknowledgement was not used, then the confirm
+ * carries the status of whether the MAC acknowledgement (“next hop” acknowledgment) was received or not (ZMacNoACK – 0xe9). This
+ * also applies to packets that are sent using AF_DATA_REQUEST_EXT and AF_DATA_STORE. For APS fragmented packets, the value of
+ * the configuration item ZCD_NV_APSF_WINDOW_SIZE determines when an AF_DATA_CONFIRM that carries the status of the APS
+ * acknowledgement is received.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackAfDataConfirmAreq extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Endpoint of the device.
+ */
+ private int endpoint;
+
+ /**
+ * Specifies the transaction sequence number of the message.
+ */
+ private int transId;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAfDataConfirmAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ endpoint = deserializer.deserializeUInt8();
+ transId = deserializer.deserializeUInt8();
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * Endpoint of the device.
+ *
+ * @return the current endpoint as {@link int}
+ */
+ public int getEndpoint() {
+ return endpoint;
+ }
+
+ /**
+ * Endpoint of the device.
+ *
+ * @param endpoint the Endpoint to set as {@link int}
+ */
+ public void setEndpoint(int endpoint) {
+ this.endpoint = endpoint;
+ }
+
+ /**
+ * Specifies the transaction sequence number of the message.
+ *
+ * @return the current transId as {@link int}
+ */
+ public int getTransId() {
+ return transId;
+ }
+
+ /**
+ * Specifies the transaction sequence number of the message.
+ *
+ * @param transId the TransId to set as {@link int}
+ */
+ public void setTransId(int transId) {
+ this.transId = transId;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(101);
+ builder.append("ZstackAfDataConfirmAreq [status=");
+ builder.append(status);
+ builder.append(", endpoint=");
+ builder.append(String.format("%02X", endpoint));
+ builder.append(", transId=");
+ builder.append(String.format("%02X", transId));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfDataRequestSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfDataRequestSreq.java
new file mode 100644
index 0000000000..7b8fa96d11
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfDataRequestSreq.java
@@ -0,0 +1,291 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.af;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.af.AfDataOptions;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import java.util.HashSet;
+import java.util.Set;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command AF_DATA_REQUEST.
+ *
+ * This command is used by the App processor to build and send a message through AF layer.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackAfDataRequestSreq extends ZstackFrameRequest {
+
+ /**
+ * Short address of the destination device.
+ */
+ private int dstAddr;
+
+ /**
+ * Endpoint of the destination device.
+ */
+ private int destEndpoint;
+
+ /**
+ * Endpoint of the source device.
+ */
+ private int srcEndpoint;
+
+ /**
+ * Specifies the cluster ID.
+ */
+ private int clusterId;
+
+ /**
+ * Specifies the transaction sequence number of the message. The corresponding AF_DATA_CONFIRM will have the same TransID. This
+ * can be useful if the application wishes to match up AF_DATA_REQUESTs with AF_DATA_CONFIRMs.
+ */
+ private int transId;
+
+ /**
+ * The transmit options field is organized as a bitmask. The following enumerates the values for the various supported bitmasks.
+ * For example, a value of 0x10 means that bit 4 is set.
+ *
+ * Parameter allows multiple options so implemented as a {@link Set}.
+ */
+ private Set
+ * This command is used by the App processor to build and send a message through AF layer.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackAfDataRequestSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAfDataRequestSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackAfDataRequestSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfIncomingMsgAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfIncomingMsgAreq.java
new file mode 100644
index 0000000000..b461d84ec4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfIncomingMsgAreq.java
@@ -0,0 +1,335 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.af;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command AF_INCOMING_MSG.
+ *
+ * This callback message is in response to incoming data to any of the registered endpoints on this device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackAfIncomingMsgAreq extends ZstackFrameResponse {
+
+ /**
+ * Specifies the group ID of the device.
+ */
+ private int groupId;
+
+ /**
+ * Specifies the cluster ID.
+ */
+ private int clusterId;
+
+ /**
+ * Specifies the ZigBee network address of the source device sending the message.
+ */
+ private int srcAddr;
+
+ /**
+ * Specifies the source endpoint of the message.
+ */
+ private int srcEndpoint;
+
+ /**
+ * Specifies the destination endpoint of the message.
+ */
+ private int destEndpoint;
+
+ /**
+ * Specifies if the message was a broadcast or not.
+ */
+ private boolean wasBroadcast;
+
+ /**
+ * Indicates the link quality measured during reception.
+ */
+ private int linkQuality;
+
+ /**
+ * Specifies if the security is used or not.
+ */
+ private boolean securityUse;
+
+ /**
+ * Specifies the timestamp of the message.
+ */
+ private int timeStamp;
+
+ /**
+ * Specifies transaction sequence number of the message.
+ */
+ private int seqNumber;
+
+ /**
+ * Contains 0 to 99 bytes of data. Without any security (99 bytes), with NWK security (81 bytes), with NWK and APS security (64
+ * bytes).
+ */
+ private int[] data;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAfIncomingMsgAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ groupId = deserializer.deserializeUInt16();
+ clusterId = deserializer.deserializeUInt16();
+ srcAddr = deserializer.deserializeUInt16();
+ srcEndpoint = deserializer.deserializeUInt8();
+ destEndpoint = deserializer.deserializeUInt8();
+ wasBroadcast = deserializer.deserializeBoolean();
+ linkQuality = deserializer.deserializeUInt8();
+ securityUse = deserializer.deserializeBoolean();
+ timeStamp = deserializer.deserializeUInt32();
+ seqNumber = deserializer.deserializeUInt8();
+ int len = deserializer.deserializeUInt8();
+ data = deserializer.deserializeUInt8Array(len);
+ }
+
+ /**
+ * Specifies the group ID of the device.
+ *
+ * @return the current groupId as {@link int}
+ */
+ public int getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * Specifies the group ID of the device.
+ *
+ * @param groupId the GroupId to set as {@link int}
+ */
+ public void setGroupId(int groupId) {
+ this.groupId = groupId;
+ }
+
+ /**
+ * Specifies the cluster ID.
+ *
+ * @return the current clusterId as {@link int}
+ */
+ public int getClusterId() {
+ return clusterId;
+ }
+
+ /**
+ * Specifies the cluster ID.
+ *
+ * @param clusterId the ClusterId to set as {@link int}
+ */
+ public void setClusterId(int clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ /**
+ * Specifies the ZigBee network address of the source device sending the message.
+ *
+ * @return the current srcAddr as {@link int}
+ */
+ public int getSrcAddr() {
+ return srcAddr;
+ }
+
+ /**
+ * Specifies the ZigBee network address of the source device sending the message.
+ *
+ * @param srcAddr the SrcAddr to set as {@link int}
+ */
+ public void setSrcAddr(int srcAddr) {
+ this.srcAddr = srcAddr;
+ }
+
+ /**
+ * Specifies the source endpoint of the message.
+ *
+ * @return the current srcEndpoint as {@link int}
+ */
+ public int getSrcEndpoint() {
+ return srcEndpoint;
+ }
+
+ /**
+ * Specifies the source endpoint of the message.
+ *
+ * @param srcEndpoint the SrcEndpoint to set as {@link int}
+ */
+ public void setSrcEndpoint(int srcEndpoint) {
+ this.srcEndpoint = srcEndpoint;
+ }
+
+ /**
+ * Specifies the destination endpoint of the message.
+ *
+ * @return the current destEndpoint as {@link int}
+ */
+ public int getDestEndpoint() {
+ return destEndpoint;
+ }
+
+ /**
+ * Specifies the destination endpoint of the message.
+ *
+ * @param destEndpoint the DestEndpoint to set as {@link int}
+ */
+ public void setDestEndpoint(int destEndpoint) {
+ this.destEndpoint = destEndpoint;
+ }
+
+ /**
+ * Specifies if the message was a broadcast or not.
+ *
+ * @return the current wasBroadcast as {@link boolean}
+ */
+ public boolean getWasBroadcast() {
+ return wasBroadcast;
+ }
+
+ /**
+ * Specifies if the message was a broadcast or not.
+ *
+ * @param wasBroadcast the WasBroadcast to set as {@link boolean}
+ */
+ public void setWasBroadcast(boolean wasBroadcast) {
+ this.wasBroadcast = wasBroadcast;
+ }
+
+ /**
+ * Indicates the link quality measured during reception.
+ *
+ * @return the current linkQuality as {@link int}
+ */
+ public int getLinkQuality() {
+ return linkQuality;
+ }
+
+ /**
+ * Indicates the link quality measured during reception.
+ *
+ * @param linkQuality the LinkQuality to set as {@link int}
+ */
+ public void setLinkQuality(int linkQuality) {
+ this.linkQuality = linkQuality;
+ }
+
+ /**
+ * Specifies if the security is used or not.
+ *
+ * @return the current securityUse as {@link boolean}
+ */
+ public boolean getSecurityUse() {
+ return securityUse;
+ }
+
+ /**
+ * Specifies if the security is used or not.
+ *
+ * @param securityUse the SecurityUse to set as {@link boolean}
+ */
+ public void setSecurityUse(boolean securityUse) {
+ this.securityUse = securityUse;
+ }
+
+ /**
+ * Specifies the timestamp of the message.
+ *
+ * @return the current timeStamp as {@link int}
+ */
+ public int getTimeStamp() {
+ return timeStamp;
+ }
+
+ /**
+ * Specifies the timestamp of the message.
+ *
+ * @param timeStamp the TimeStamp to set as {@link int}
+ */
+ public void setTimeStamp(int timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+
+ /**
+ * Specifies transaction sequence number of the message.
+ *
+ * @return the current seqNumber as {@link int}
+ */
+ public int getSeqNumber() {
+ return seqNumber;
+ }
+
+ /**
+ * Specifies transaction sequence number of the message.
+ *
+ * @param seqNumber the SeqNumber to set as {@link int}
+ */
+ public void setSeqNumber(int seqNumber) {
+ this.seqNumber = seqNumber;
+ }
+
+ /**
+ * Contains 0 to 99 bytes of data. Without any security (99 bytes), with NWK security (81 bytes), with NWK and APS security (64
+ * bytes).
+ *
+ * @return the current data as {@link int[]}
+ */
+ public int[] getData() {
+ return data;
+ }
+
+ /**
+ * Contains 0 to 99 bytes of data. Without any security (99 bytes), with NWK security (81 bytes), with NWK and APS security (64
+ * bytes).
+ *
+ * @param data the Data to set as {@link int[]}
+ */
+ public void setData(int[] data) {
+ this.data = data;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(326);
+ builder.append("ZstackAfIncomingMsgAreq [groupId=");
+ builder.append(String.format("%04X", groupId));
+ builder.append(", clusterId=");
+ builder.append(String.format("%04X", clusterId));
+ builder.append(", srcAddr=");
+ builder.append(String.format("%04X", srcAddr));
+ builder.append(", srcEndpoint=");
+ builder.append(String.format("%02X", srcEndpoint));
+ builder.append(", destEndpoint=");
+ builder.append(String.format("%02X", destEndpoint));
+ builder.append(", wasBroadcast=");
+ builder.append(wasBroadcast);
+ builder.append(", linkQuality=");
+ builder.append(linkQuality);
+ builder.append(", securityUse=");
+ builder.append(securityUse);
+ builder.append(", timeStamp=");
+ builder.append(String.format("%08X", timeStamp));
+ builder.append(", seqNumber=");
+ builder.append(String.format("%02X", seqNumber));
+ builder.append(", data=");
+ for (int c = 0; c < data.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", data[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfRegisterSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfRegisterSreq.java
new file mode 100644
index 0000000000..1b45701a82
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfRegisterSreq.java
@@ -0,0 +1,249 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.af;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command AF_REGISTER.
+ *
+ * This command enables the host processor to register an application’s endpoint description (and its simple descriptor).
+ * Multiple endpoints may be registered with the AF by making multiple calls to AF_REGISTER. This could be useful in the case where
+ * the device needs to support multiple application profiles, where each AF_REGISTER call would register a unique endpoint
+ * description per application profile.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackAfRegisterSreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the endpoint of this simple descriptor.
+ */
+ private int endPoint;
+
+ /**
+ * Specifies the profile id of the application.
+ */
+ private int appProfId;
+
+ /**
+ * Specifies the device description id for this endpoint.
+ */
+ private int appDeviceId;
+
+ /**
+ * Specifies the device version number.
+ */
+ private int appDevVer;
+
+ /**
+ * Specifies latency. For ZigBee the only applicable value is 0x00. 0x00-No latency 0x01-fast beacons 0x02-slow beacons
+ */
+ private int latencyReq;
+
+ /**
+ * Specifies the list of Input Cluster Ids (2 bytes each).
+ */
+ private int[] appInClusterList;
+
+ /**
+ * Specifies the list of Output Cluster Ids (2 bytes each)
+ */
+ private int[] appOutClusterList;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAfRegisterSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the endpoint of this simple descriptor.
+ *
+ * @return the current endPoint as {@link int}
+ */
+ public int getEndPoint() {
+ return endPoint;
+ }
+
+ /**
+ * Specifies the endpoint of this simple descriptor.
+ *
+ * @param endPoint the EndPoint to set as {@link int}
+ */
+ public void setEndPoint(int endPoint) {
+ this.endPoint = endPoint;
+ }
+
+ /**
+ * Specifies the profile id of the application.
+ *
+ * @return the current appProfId as {@link int}
+ */
+ public int getAppProfId() {
+ return appProfId;
+ }
+
+ /**
+ * Specifies the profile id of the application.
+ *
+ * @param appProfId the AppProfId to set as {@link int}
+ */
+ public void setAppProfId(int appProfId) {
+ this.appProfId = appProfId;
+ }
+
+ /**
+ * Specifies the device description id for this endpoint.
+ *
+ * @return the current appDeviceId as {@link int}
+ */
+ public int getAppDeviceId() {
+ return appDeviceId;
+ }
+
+ /**
+ * Specifies the device description id for this endpoint.
+ *
+ * @param appDeviceId the AppDeviceId to set as {@link int}
+ */
+ public void setAppDeviceId(int appDeviceId) {
+ this.appDeviceId = appDeviceId;
+ }
+
+ /**
+ * Specifies the device version number.
+ *
+ * @return the current appDevVer as {@link int}
+ */
+ public int getAppDevVer() {
+ return appDevVer;
+ }
+
+ /**
+ * Specifies the device version number.
+ *
+ * @param appDevVer the AppDevVer to set as {@link int}
+ */
+ public void setAppDevVer(int appDevVer) {
+ this.appDevVer = appDevVer;
+ }
+
+ /**
+ * Specifies latency. For ZigBee the only applicable value is 0x00. 0x00-No latency 0x01-fast beacons 0x02-slow beacons
+ *
+ * @return the current latencyReq as {@link int}
+ */
+ public int getLatencyReq() {
+ return latencyReq;
+ }
+
+ /**
+ * Specifies latency. For ZigBee the only applicable value is 0x00. 0x00-No latency 0x01-fast beacons 0x02-slow beacons
+ *
+ * @param latencyReq the LatencyReq to set as {@link int}
+ */
+ public void setLatencyReq(int latencyReq) {
+ this.latencyReq = latencyReq;
+ }
+
+ /**
+ * Specifies the list of Input Cluster Ids (2 bytes each).
+ *
+ * @return the current appInClusterList as {@link int[]}
+ */
+ public int[] getAppInClusterList() {
+ return appInClusterList;
+ }
+
+ /**
+ * Specifies the list of Input Cluster Ids (2 bytes each).
+ *
+ * @param appInClusterList the AppInClusterList to set as {@link int[]}
+ */
+ public void setAppInClusterList(int[] appInClusterList) {
+ this.appInClusterList = appInClusterList;
+ }
+
+ /**
+ * Specifies the list of Output Cluster Ids (2 bytes each)
+ *
+ * @return the current appOutClusterList as {@link int[]}
+ */
+ public int[] getAppOutClusterList() {
+ return appOutClusterList;
+ }
+
+ /**
+ * Specifies the list of Output Cluster Ids (2 bytes each)
+ *
+ * @param appOutClusterList the AppOutClusterList to set as {@link int[]}
+ */
+ public void setAppOutClusterList(int[] appOutClusterList) {
+ this.appOutClusterList = appOutClusterList;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_AF) && (response.getReqCmd1() == 0x00));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_AF, 0x00);
+
+ // Serialize the fields
+ serializer.serializeUInt8(endPoint);
+ serializer.serializeUInt16(appProfId);
+ serializer.serializeUInt16(appDeviceId);
+ serializer.serializeUInt8(appDevVer);
+ serializer.serializeUInt8(latencyReq);
+ serializer.serializeUInt8(appInClusterList.length);
+ serializer.serializeUInt16Array(appInClusterList);
+ serializer.serializeUInt8(appOutClusterList.length);
+ serializer.serializeUInt16Array(appOutClusterList);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(248);
+ builder.append("ZstackAfRegisterSreq [endPoint=");
+ builder.append(String.format("%02X", endPoint));
+ builder.append(", appProfId=");
+ builder.append(String.format("%04X", appProfId));
+ builder.append(", appDeviceId=");
+ builder.append(appDeviceId);
+ builder.append(", appDevVer=");
+ builder.append(appDevVer);
+ builder.append(", latencyReq=");
+ builder.append(latencyReq);
+ builder.append(", appInClusterList=");
+ for (int c = 0; c < appInClusterList.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%04X", appInClusterList[c]));
+ }
+ builder.append(", appOutClusterList=");
+ for (int c = 0; c < appOutClusterList.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%04X", appOutClusterList[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfRegisterSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfRegisterSrsp.java
new file mode 100644
index 0000000000..2ae478fb92
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/af/ZstackAfRegisterSrsp.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.af;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command AF_REGISTER.
+ *
+ * This command enables the host processor to register an application’s endpoint description (and its simple descriptor).
+ * Multiple endpoints may be registered with the AF by making multiple calls to AF_REGISTER. This could be useful in the case where
+ * the device needs to support multiple application profiles, where each AF_REGISTER call would register a unique endpoint
+ * description per application profile.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackAfRegisterSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAfRegisterSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(48);
+ builder.append("ZstackAfRegisterSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbAddInstallcodeSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbAddInstallcodeSreq.java
new file mode 100644
index 0000000000..5aff8234c5
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbAddInstallcodeSreq.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.security.ZigBeeKey;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_ADD_INSTALLCODE.
+ *
+ * Add a preconfigured key (plain key or IC) to Trust Center device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbAddInstallcodeSreq extends ZstackFrameRequest {
+
+ /**
+ * This value specifies the format in which the install code is being added. The following list contains the values corresponding
+ * to the supported formats: 0x01 Install Code + CRC 0x02 Key derived from Install Code
+ */
+ private ZstackInstallCodeFormat installCodeFormat;
+
+ /**
+ * Full IEEE address for the device joining the network
+ */
+ private IeeeAddress ieeeAddress;
+
+ /**
+ * 16 Bytes for the Key derived from the IC. 18 Bytes for the Install Code +CRC
+ */
+ private ZigBeeKey installCode;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAppCnfBdbAddInstallcodeSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * This value specifies the format in which the install code is being added. The following list contains the values corresponding
+ * to the supported formats: 0x01 Install Code + CRC 0x02 Key derived from Install Code
+ *
+ * @return the current installCodeFormat as {@link ZstackInstallCodeFormat}
+ */
+ public ZstackInstallCodeFormat getInstallCodeFormat() {
+ return installCodeFormat;
+ }
+
+ /**
+ * This value specifies the format in which the install code is being added. The following list contains the values corresponding
+ * to the supported formats: 0x01 Install Code + CRC 0x02 Key derived from Install Code
+ *
+ * @param installCodeFormat the InstallCodeFormat to set as {@link ZstackInstallCodeFormat}
+ */
+ public void setInstallCodeFormat(ZstackInstallCodeFormat installCodeFormat) {
+ this.installCodeFormat = installCodeFormat;
+ }
+
+ /**
+ * Full IEEE address for the device joining the network
+ *
+ * @return the current ieeeAddress as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddress() {
+ return ieeeAddress;
+ }
+
+ /**
+ * Full IEEE address for the device joining the network
+ *
+ * @param ieeeAddress the IeeeAddress to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddress(IeeeAddress ieeeAddress) {
+ this.ieeeAddress = ieeeAddress;
+ }
+
+ /**
+ * 16 Bytes for the Key derived from the IC. 18 Bytes for the Install Code +CRC
+ *
+ * @return the current installCode as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getInstallCode() {
+ return installCode;
+ }
+
+ /**
+ * 16 Bytes for the Key derived from the IC. 18 Bytes for the Install Code +CRC
+ *
+ * @param installCode the InstallCode to set as {@link ZigBeeKey}
+ */
+ public void setInstallCode(ZigBeeKey installCode) {
+ this.installCode = installCode;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_APP_CNF) && (response.getReqCmd1() == 0x04));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_APP_CNF, 0x04);
+
+ // Serialize the fields
+ serializer.serializeUInt8(installCodeFormat.getKey());
+ serializer.serializeIeeeAddress(ieeeAddress);
+ serializer.serializeZigBeeKey(installCode);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(111);
+ builder.append("ZstackAppCnfBdbAddInstallcodeSreq [installCodeFormat=");
+ builder.append(installCodeFormat);
+ builder.append(", ieeeAddress=");
+ builder.append(ieeeAddress);
+ builder.append(", installCode=");
+ builder.append(installCode);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbAddInstallcodeSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbAddInstallcodeSrsp.java
new file mode 100644
index 0000000000..ab85ac1f78
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbAddInstallcodeSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_ADD_INSTALLCODE.
+ *
+ * Add a preconfigured key (plain key or IC) to Trust Center device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbAddInstallcodeSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status values: 0x00 Success. 0x01 Failure (IC not supported) 0x02 Invalid parameter (bad CRC).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAppCnfBdbAddInstallcodeSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status values: 0x00 Success. 0x01 Failure (IC not supported) 0x02 Invalid parameter (bad CRC).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status values: 0x00 Success. 0x01 Failure (IC not supported) 0x02 Invalid parameter (bad CRC).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(61);
+ builder.append("ZstackAppCnfBdbAddInstallcodeSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbCommissioningNotificationAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbCommissioningNotificationAreq.java
new file mode 100644
index 0000000000..2e28f0105d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbCommissioningNotificationAreq.java
@@ -0,0 +1,137 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.appcnf.ZstackBdbRemainingCommissioningModes;
+import java.util.HashSet;
+import java.util.Set;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_COMMISSIONING_NOTIFICATION.
+ *
+ * Callback to receive notifications from BDB process.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbCommissioningNotificationAreq extends ZstackFrameResponse {
+
+ /**
+ * Status of the commissioning mode being notified
+ */
+ private ZstackBdbStatus status;
+
+ /**
+ * Commissioning mode for which the notification is done and to which the status is related
+ */
+ private ZstackBdbCommissioningMode commissioningMode;
+
+ /**
+ * Bitmask of the remaining commissioning modes after this notification.
+ *
+ * Parameter allows multiple options so implemented as a {@link Set}.
+ */
+ private Set
+ * Sets the policy to mandate or not the usage of an Install Code upon joining.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetActiveDefaultCentralizedKeySreq extends ZstackFrameRequest {
+
+ /**
+ * This parameter controls which key will be used when performing association to a centralized network.
+ */
+ private ZstackCentralizedLinkKeyMode centralizedLinkKeyMode;
+
+ /**
+ * Buffer with the key in any of its formats.
+ */
+ private int[] installCode;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAppCnfBdbSetActiveDefaultCentralizedKeySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * This parameter controls which key will be used when performing association to a centralized network.
+ *
+ * @return the current centralizedLinkKeyMode as {@link ZstackCentralizedLinkKeyMode}
+ */
+ public ZstackCentralizedLinkKeyMode getCentralizedLinkKeyMode() {
+ return centralizedLinkKeyMode;
+ }
+
+ /**
+ * This parameter controls which key will be used when performing association to a centralized network.
+ *
+ * @param centralizedLinkKeyMode the CentralizedLinkKeyMode to set as {@link ZstackCentralizedLinkKeyMode}
+ */
+ public void setCentralizedLinkKeyMode(ZstackCentralizedLinkKeyMode centralizedLinkKeyMode) {
+ this.centralizedLinkKeyMode = centralizedLinkKeyMode;
+ }
+
+ /**
+ * Buffer with the key in any of its formats.
+ *
+ * @return the current installCode as {@link int[]}
+ */
+ public int[] getInstallCode() {
+ return installCode;
+ }
+
+ /**
+ * Buffer with the key in any of its formats.
+ *
+ * @param installCode the InstallCode to set as {@link int[]}
+ */
+ public void setInstallCode(int[] installCode) {
+ this.installCode = installCode;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_APP_CNF) && (response.getReqCmd1() == 0x07));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_APP_CNF, 0x07);
+
+ // Serialize the fields
+ serializer.serializeUInt8(centralizedLinkKeyMode.getKey());
+ serializer.serializeUInt8Array(installCode);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(102);
+ builder.append("ZstackAppCnfBdbSetActiveDefaultCentralizedKeySreq [centralizedLinkKeyMode=");
+ builder.append(centralizedLinkKeyMode);
+ builder.append(", installCode=");
+ for (int c = 0; c < installCode.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", installCode[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp.java
new file mode 100644
index 0000000000..2ebcc7dc4f
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_ACTIVE_DEFAULT_CENTRALIZED_KEY.
+ *
+ * Sets the policy to mandate or not the usage of an Install Code upon joining.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 Success 0x01 Failure (IC not supported) 0x02 Invalid Parameters (bad CRC).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * 0x00 Success 0x01 Failure (IC not supported) 0x02 Invalid Parameters (bad CRC).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 Success 0x01 Failure (IC not supported) 0x02 Invalid Parameters (bad CRC).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(77);
+ builder.append("ZstackAppCnfBdbSetActiveDefaultCentralizedKeySrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetChannelSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetChannelSreq.java
new file mode 100644
index 0000000000..fe98126d5f
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetChannelSreq.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_CHANNEL.
+ *
+ * This command is used to store a channel select bit-mask to be used in commissioning.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetChannelSreq extends ZstackFrameRequest {
+
+ /**
+ * Mask is used for primary channel selection.
+ */
+ private boolean isPrimary;
+
+ /**
+ * A bit-mask representing the channel(s) to scan the next time the target device resets.
+ */
+ private int channels;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAppCnfBdbSetChannelSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Mask is used for primary channel selection.
+ *
+ * @return the current isPrimary as {@link boolean}
+ */
+ public boolean getIsPrimary() {
+ return isPrimary;
+ }
+
+ /**
+ * Mask is used for primary channel selection.
+ *
+ * @param isPrimary the IsPrimary to set as {@link boolean}
+ */
+ public void setIsPrimary(boolean isPrimary) {
+ this.isPrimary = isPrimary;
+ }
+
+ /**
+ * A bit-mask representing the channel(s) to scan the next time the target device resets.
+ *
+ * @return the current channels as {@link int}
+ */
+ public int getChannels() {
+ return channels;
+ }
+
+ /**
+ * A bit-mask representing the channel(s) to scan the next time the target device resets.
+ *
+ * @param channels the Channels to set as {@link int}
+ */
+ public void setChannels(int channels) {
+ this.channels = channels;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_APP_CNF) && (response.getReqCmd1() == 0x08));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_APP_CNF, 0x08);
+
+ // Serialize the fields
+ serializer.serializeBoolean(isPrimary);
+ serializer.serializeUInt32(channels);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(82);
+ builder.append("ZstackAppCnfBdbSetChannelSreq [isPrimary=");
+ builder.append(isPrimary);
+ builder.append(", channels=");
+ builder.append(channels);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetChannelSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetChannelSrsp.java
new file mode 100644
index 0000000000..197e3b04cf
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetChannelSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_CHANNEL.
+ *
+ * This command is used to store a channel select bit-mask to be used in commissioning.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetChannelSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAppCnfBdbSetChannelSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(57);
+ builder.append("ZstackAppCnfBdbSetChannelSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetJoinusesinstallcodekeySreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetJoinusesinstallcodekeySreq.java
new file mode 100644
index 0000000000..5f6c76ef11
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetJoinusesinstallcodekeySreq.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_JOINUSESINSTALLCODEKEY.
+ *
+ * Sets the policy to mandate or not the usage of an Install Code upon joining.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetJoinusesinstallcodekeySreq extends ZstackFrameRequest {
+
+ /**
+ * If it is equal to TRUE and the installation code derived link key is not stored, the Trust Center SHALL terminate the procedure for
+ * adding a new node into the network. If bdbJoinUsesInstall- CodeKey is equal to TRUE and the installation code derived link key is
+ * stored, the Trust Center SHALL first find the entry in apsDeviceKeyPairSet that corresponds to the joining node and then
+ * overwrite the LinkKey entry with the installation code derived link key and set the KeyAttributes field to PROVISIONAL_KEY.
+ * The Trust Center MAY then set OutgoingFrame- Counter to 0 and SHALL set IncomingFrameCounter to 0. If
+ * bdbJoinUsesInstallCodeKey is equal to FALSE, the Trust Center SHALL first find the entry in apsDeviceKeyPairSet that
+ * corresponds to the joining node and then overwrite the LinkKey entry with the default global Trust Center link key and set the
+ * KeyAttributes field to PROVISIONAL_KEY. The Trust Center MAY then set OutgoingFrameCounter to 0 and SHALL set
+ * IncomingFrameCounter to 0.
+ */
+ private boolean joinUsesInstallCodeKey;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAppCnfBdbSetJoinusesinstallcodekeySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * If it is equal to TRUE and the installation code derived link key is not stored, the Trust Center SHALL terminate the procedure for
+ * adding a new node into the network. If bdbJoinUsesInstall- CodeKey is equal to TRUE and the installation code derived link key is
+ * stored, the Trust Center SHALL first find the entry in apsDeviceKeyPairSet that corresponds to the joining node and then
+ * overwrite the LinkKey entry with the installation code derived link key and set the KeyAttributes field to PROVISIONAL_KEY.
+ * The Trust Center MAY then set OutgoingFrame- Counter to 0 and SHALL set IncomingFrameCounter to 0. If
+ * bdbJoinUsesInstallCodeKey is equal to FALSE, the Trust Center SHALL first find the entry in apsDeviceKeyPairSet that
+ * corresponds to the joining node and then overwrite the LinkKey entry with the default global Trust Center link key and set the
+ * KeyAttributes field to PROVISIONAL_KEY. The Trust Center MAY then set OutgoingFrameCounter to 0 and SHALL set
+ * IncomingFrameCounter to 0.
+ *
+ * @return the current joinUsesInstallCodeKey as {@link boolean}
+ */
+ public boolean getJoinUsesInstallCodeKey() {
+ return joinUsesInstallCodeKey;
+ }
+
+ /**
+ * If it is equal to TRUE and the installation code derived link key is not stored, the Trust Center SHALL terminate the procedure for
+ * adding a new node into the network. If bdbJoinUsesInstall- CodeKey is equal to TRUE and the installation code derived link key is
+ * stored, the Trust Center SHALL first find the entry in apsDeviceKeyPairSet that corresponds to the joining node and then
+ * overwrite the LinkKey entry with the installation code derived link key and set the KeyAttributes field to PROVISIONAL_KEY.
+ * The Trust Center MAY then set OutgoingFrame- Counter to 0 and SHALL set IncomingFrameCounter to 0. If
+ * bdbJoinUsesInstallCodeKey is equal to FALSE, the Trust Center SHALL first find the entry in apsDeviceKeyPairSet that
+ * corresponds to the joining node and then overwrite the LinkKey entry with the default global Trust Center link key and set the
+ * KeyAttributes field to PROVISIONAL_KEY. The Trust Center MAY then set OutgoingFrameCounter to 0 and SHALL set
+ * IncomingFrameCounter to 0.
+ *
+ * @param joinUsesInstallCodeKey the JoinUsesInstallCodeKey to set as {@link boolean}
+ */
+ public void setJoinUsesInstallCodeKey(boolean joinUsesInstallCodeKey) {
+ this.joinUsesInstallCodeKey = joinUsesInstallCodeKey;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_APP_CNF) && (response.getReqCmd1() == 0x06));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_APP_CNF, 0x06);
+
+ // Serialize the fields
+ serializer.serializeBoolean(joinUsesInstallCodeKey);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(72);
+ builder.append("ZstackAppCnfBdbSetJoinusesinstallcodekeySreq [joinUsesInstallCodeKey=");
+ builder.append(joinUsesInstallCodeKey);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp.java
new file mode 100644
index 0000000000..a2c435eb1d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_JOINUSESINSTALLCODEKEY.
+ *
+ * Sets the policy to mandate or not the usage of an Install Code upon joining.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(72);
+ builder.append("ZstackAppCnfBdbSetJoinusesinstallcodekeySrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetTcRequireKeyExchangeSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetTcRequireKeyExchangeSreq.java
new file mode 100644
index 0000000000..ed90c12f9b
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetTcRequireKeyExchangeSreq.java
@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_TC_REQUIRE_KEY_EXCHANGE.
+ *
+ * Sets the policy flag on Trust Center device to mandate or not the TCLK exchange procedure.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetTcRequireKeyExchangeSreq extends ZstackFrameRequest {
+
+ /**
+ * The bdbTrustCenterRequireKeyExchange attribute specifies whether the Trust Center requires a joining device to exchange
+ * its initial link key with a new link key generated by the Trust Center. If bdbTrustCenterRequireKeyExchange is equal to TRUE,
+ * the joining node must undergo the link key exchange procedure; failure to exchange the link key will result in the node being
+ * removed from the network. If bdbTrustCenterRequireKeyExchange is equal to FALSE, the Trust Center will permit the joining
+ * node to remain on the network without exchanging its initial link key. This attribute is used by ZigBee coordinator nodes.
+ */
+ private boolean trustCenterRequireKeyExchange;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAppCnfBdbSetTcRequireKeyExchangeSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The bdbTrustCenterRequireKeyExchange attribute specifies whether the Trust Center requires a joining device to exchange
+ * its initial link key with a new link key generated by the Trust Center. If bdbTrustCenterRequireKeyExchange is equal to TRUE,
+ * the joining node must undergo the link key exchange procedure; failure to exchange the link key will result in the node being
+ * removed from the network. If bdbTrustCenterRequireKeyExchange is equal to FALSE, the Trust Center will permit the joining
+ * node to remain on the network without exchanging its initial link key. This attribute is used by ZigBee coordinator nodes.
+ *
+ * @return the current trustCenterRequireKeyExchange as {@link boolean}
+ */
+ public boolean getTrustCenterRequireKeyExchange() {
+ return trustCenterRequireKeyExchange;
+ }
+
+ /**
+ * The bdbTrustCenterRequireKeyExchange attribute specifies whether the Trust Center requires a joining device to exchange
+ * its initial link key with a new link key generated by the Trust Center. If bdbTrustCenterRequireKeyExchange is equal to TRUE,
+ * the joining node must undergo the link key exchange procedure; failure to exchange the link key will result in the node being
+ * removed from the network. If bdbTrustCenterRequireKeyExchange is equal to FALSE, the Trust Center will permit the joining
+ * node to remain on the network without exchanging its initial link key. This attribute is used by ZigBee coordinator nodes.
+ *
+ * @param trustCenterRequireKeyExchange the TrustCenterRequireKeyExchange to set as {@link boolean}
+ */
+ public void setTrustCenterRequireKeyExchange(boolean trustCenterRequireKeyExchange) {
+ this.trustCenterRequireKeyExchange = trustCenterRequireKeyExchange;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_APP_CNF) && (response.getReqCmd1() == 0x09));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_APP_CNF, 0x09);
+
+ // Serialize the fields
+ serializer.serializeBoolean(trustCenterRequireKeyExchange);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(70);
+ builder.append("ZstackAppCnfBdbSetTcRequireKeyExchangeSreq [trustCenterRequireKeyExchange=");
+ builder.append(trustCenterRequireKeyExchange);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp.java
new file mode 100644
index 0000000000..07a3e806c4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_BDB_SET_TC_REQUIRE_KEY_EXCHANGE.
+ *
+ * Sets the policy flag on Trust Center device to mandate or not the TCLK exchange procedure.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(70);
+ builder.append("ZstackAppCnfBdbSetTcRequireKeyExchangeSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfSetAllowrejoinTcPolicySreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfSetAllowrejoinTcPolicySreq.java
new file mode 100644
index 0000000000..16c1267155
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfSetAllowrejoinTcPolicySreq.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_SET_ALLOWREJOIN_TC_POLICY.
+ *
+ * Sets the AllowRejoin TC policy.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfSetAllowrejoinTcPolicySreq extends ZstackFrameRequest {
+
+ /**
+ * This value specifies whether or not the Trust Center allows devices to rejoin.
+ */
+ private boolean allowRejoin;
+
+ /**
+ * Request constructor
+ */
+ public ZstackAppCnfSetAllowrejoinTcPolicySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * This value specifies whether or not the Trust Center allows devices to rejoin.
+ *
+ * @return the current allowRejoin as {@link boolean}
+ */
+ public boolean getAllowRejoin() {
+ return allowRejoin;
+ }
+
+ /**
+ * This value specifies whether or not the Trust Center allows devices to rejoin.
+ *
+ * @param allowRejoin the AllowRejoin to set as {@link boolean}
+ */
+ public void setAllowRejoin(boolean allowRejoin) {
+ this.allowRejoin = allowRejoin;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_APP_CNF) && (response.getReqCmd1() == 0x03));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_APP_CNF, 0x03);
+
+ // Serialize the fields
+ serializer.serializeBoolean(allowRejoin);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(66);
+ builder.append("ZstackAppCnfSetAllowrejoinTcPolicySreq [allowRejoin=");
+ builder.append(allowRejoin);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfSetAllowrejoinTcPolicySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfSetAllowrejoinTcPolicySrsp.java
new file mode 100644
index 0000000000..e4c948a9e4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAppCnfSetAllowrejoinTcPolicySrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command APP_CNF_SET_ALLOWREJOIN_TC_POLICY.
+ *
+ * Sets the AllowRejoin TC policy.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackAppCnfSetAllowrejoinTcPolicySrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackAppCnfSetAllowrejoinTcPolicySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(66);
+ builder.append("ZstackAppCnfSetAllowrejoinTcPolicySrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAuthenticationOption.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAuthenticationOption.java
new file mode 100644
index 0000000000..a07bd1864f
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/appcnf/ZstackAuthenticationOption.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.appcnf;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class to implement the Z-Stack Enumeration ZstackAuthenticationOption.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackAuthenticationOption {
+
+ /**
+ * The device has not been authenticated
+ */
+ NOT_AUTHENTICATED(0x0000),
+
+ /**
+ * The device has been authenticated using CBKE
+ */
+ AUTHENTICATED_CBCK(0x0001),
+
+ /**
+ * The device has been authenticated using EA
+ */
+ AUTHENTICATED_EA(0x0002);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackBdbCommissioningMode {
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_INITIALIZATION(0x0000),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_NWK_STEERING(0x0001),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FORMATION(0x0002),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FINDING_BINDING(0x0003),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_TOUCHLINK(0x0004),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_PARENT_LOST(0x0005);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackBdbRemainingCommissioningModes {
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_MODE_INITIATOR_TL(0x0001),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_MODE_NWK_STEERING(0x0002),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_MODE_NWK_FORMATION(0x0004),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_MODE_FINDING_BINDING(0x0008),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_MODE_INITIALIZATION(0x0010),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_MODE_PARENT_LOST(0x0020);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackBdbStatus {
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_SUCCESS(0x0000),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_IN_PROGRESS(0x0001),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_NO_NETWORK(0x0002),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_TL_TARGET_FAILURE(0x0003),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_TL_NOT_AA_CAPABLE(0x0004),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_TL_NO_SCAN_RESPONSE(0x0005),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_TL_NOT_PERMITTED(0x0006),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_TCLK_EX_FAILURE(0x0007),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FORMATION_FAILURE(0x0008),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FB_TARGET_IN_PROGRESS(0x0009),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FB_INITIATOR_IN_PROGRESS(0x000A),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FB_NO_IDENTIFY_QUERY_RESPONSE(0x000B),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FB_BINDING_TABLE_FULL(0x000C),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_NETWORK_RESTORED(0x000D),
+
+ /**
+ *
+ */
+ BDB_COMMISSIONING_FAILURE(0x000E);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Central link key policies
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackCentralizedLinkKeyMode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * Instruct joining node to use Default Global Trust Center link key. No key buffer required
+ */
+ DEFAULT_GLOBAL_KEY(0x0000),
+
+ /**
+ * Instruct the joining node to use the provided install code (16 bytes + 2 CRC bytes) to derive APS Link key to be used during joining
+ */
+ PROVIDED_INSTALL_CODE(0x0001),
+
+ /**
+ * Instruct the joining node to use the provided install code (16 bytes + 2 CRC bytes) to derive APS Link key to be used during joining.
+ * If it fails to decrypt Transport Key, it will automatically try Default Global Trust Center Link Key
+ */
+ PROVIDED_INSTALL_CODE_THEN_DEFAULT_GLOBAL_KEY(0x0002),
+
+ /**
+ * Instruct the joining node to use the provided APS Link key to be used during joining (key size is 16 bytes)
+ */
+ PROVIDED_APS_KEY(0x0003),
+
+ /**
+ * Instruct the joining node to use the provided APS Link key to be used during joining (key size is 16 bytes). If it fails to decrypt
+ * Transport Key, it will automatically try Default Global Trust Center Link Key
+ */
+ PROVIDED_APS_CODE_THEN_DEFAULT_GLOBAL_KEY(0x0004);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackInstallCodeFormat {
+
+ /**
+ *
+ */
+ INSTALL_CODE(0x0001),
+
+ /**
+ *
+ */
+ DERIVED_KEY(0x0002);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * This command is used to send a request to the device to perform a network scan.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackMacScanReqSreq extends ZstackFrameRequest {
+
+ /**
+ * This represents a bit-mask of channels to be scanned when starting the device: NONE = 0x00000000, ALL_CHANNELS = 0x07FFF800,
+ * CHANNEL 11 = 0x00000800, CHANNEL 12 = 0x00001000, CHANNEL 13 = 0x00002000, CHANNEL 14 = 0x00004000, CHANNEL 15 = 0x00008000,
+ * CHANNEL 16 = 0x00010000, CHANNEL 17 = 0x00020000, CHANNEL 18 = 0x00040000, CHANNEL_19 = 0x00080000, CHANNEL 20 = 0x00100000,
+ * CHANNEL 21 = 0x00200000, CHANNEL 22 = 0x00400000, CHANNEL 23 = 0x00800000, CHANNEL 24 = 0x01000000 CHANNEL 25 = 0x02000000,
+ * CHANNEL 26 = 0x04000000
+ */
+ private int scanChannels;
+
+ /**
+ * Specifies the scan type:
+ */
+ private int scanType;
+
+ /**
+ * Duration of the scan - The exponent used in the scan duration calculation.
+ */
+ private int scanDuration;
+
+ /**
+ * The channel page on which to perform the scan.
+ */
+ private int channelPage;
+
+ /**
+ * Key Source of this data frame.
+ */
+ private int keySource;
+
+ /**
+ * Security Level of this data frame:
+ */
+ private int securityLevel;
+
+ /**
+ * Key Id Mode of this data frame:
+ */
+ private int keyIdMode;
+
+ /**
+ * Key Index of this data frame.
+ */
+ private int keyIndex;
+
+ /**
+ * Request constructor
+ */
+ public ZstackMacScanReqSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * This represents a bit-mask of channels to be scanned when starting the device: NONE = 0x00000000, ALL_CHANNELS = 0x07FFF800,
+ * CHANNEL 11 = 0x00000800, CHANNEL 12 = 0x00001000, CHANNEL 13 = 0x00002000, CHANNEL 14 = 0x00004000, CHANNEL 15 = 0x00008000,
+ * CHANNEL 16 = 0x00010000, CHANNEL 17 = 0x00020000, CHANNEL 18 = 0x00040000, CHANNEL_19 = 0x00080000, CHANNEL 20 = 0x00100000,
+ * CHANNEL 21 = 0x00200000, CHANNEL 22 = 0x00400000, CHANNEL 23 = 0x00800000, CHANNEL 24 = 0x01000000 CHANNEL 25 = 0x02000000,
+ * CHANNEL 26 = 0x04000000
+ *
+ * @return the current scanChannels as {@link int}
+ */
+ public int getScanChannels() {
+ return scanChannels;
+ }
+
+ /**
+ * This represents a bit-mask of channels to be scanned when starting the device: NONE = 0x00000000, ALL_CHANNELS = 0x07FFF800,
+ * CHANNEL 11 = 0x00000800, CHANNEL 12 = 0x00001000, CHANNEL 13 = 0x00002000, CHANNEL 14 = 0x00004000, CHANNEL 15 = 0x00008000,
+ * CHANNEL 16 = 0x00010000, CHANNEL 17 = 0x00020000, CHANNEL 18 = 0x00040000, CHANNEL_19 = 0x00080000, CHANNEL 20 = 0x00100000,
+ * CHANNEL 21 = 0x00200000, CHANNEL 22 = 0x00400000, CHANNEL 23 = 0x00800000, CHANNEL 24 = 0x01000000 CHANNEL 25 = 0x02000000,
+ * CHANNEL 26 = 0x04000000
+ *
+ * @param scanChannels the ScanChannels to set as {@link int}
+ */
+ public void setScanChannels(int scanChannels) {
+ this.scanChannels = scanChannels;
+ }
+
+ /**
+ * Specifies the scan type:
+ *
+ * @return the current scanType as {@link int}
+ */
+ public int getScanType() {
+ return scanType;
+ }
+
+ /**
+ * Specifies the scan type:
+ *
+ * @param scanType the ScanType to set as {@link int}
+ */
+ public void setScanType(int scanType) {
+ this.scanType = scanType;
+ }
+
+ /**
+ * Duration of the scan - The exponent used in the scan duration calculation.
+ *
+ * @return the current scanDuration as {@link int}
+ */
+ public int getScanDuration() {
+ return scanDuration;
+ }
+
+ /**
+ * Duration of the scan - The exponent used in the scan duration calculation.
+ *
+ * @param scanDuration the ScanDuration to set as {@link int}
+ */
+ public void setScanDuration(int scanDuration) {
+ this.scanDuration = scanDuration;
+ }
+
+ /**
+ * The channel page on which to perform the scan.
+ *
+ * @return the current channelPage as {@link int}
+ */
+ public int getChannelPage() {
+ return channelPage;
+ }
+
+ /**
+ * The channel page on which to perform the scan.
+ *
+ * @param channelPage the ChannelPage to set as {@link int}
+ */
+ public void setChannelPage(int channelPage) {
+ this.channelPage = channelPage;
+ }
+
+ /**
+ * Key Source of this data frame.
+ *
+ * @return the current keySource as {@link int}
+ */
+ public int getKeySource() {
+ return keySource;
+ }
+
+ /**
+ * Key Source of this data frame.
+ *
+ * @param keySource the KeySource to set as {@link int}
+ */
+ public void setKeySource(int keySource) {
+ this.keySource = keySource;
+ }
+
+ /**
+ * Security Level of this data frame:
+ *
+ * @return the current securityLevel as {@link int}
+ */
+ public int getSecurityLevel() {
+ return securityLevel;
+ }
+
+ /**
+ * Security Level of this data frame:
+ *
+ * @param securityLevel the SecurityLevel to set as {@link int}
+ */
+ public void setSecurityLevel(int securityLevel) {
+ this.securityLevel = securityLevel;
+ }
+
+ /**
+ * Key Id Mode of this data frame:
+ *
+ * @return the current keyIdMode as {@link int}
+ */
+ public int getKeyIdMode() {
+ return keyIdMode;
+ }
+
+ /**
+ * Key Id Mode of this data frame:
+ *
+ * @param keyIdMode the KeyIdMode to set as {@link int}
+ */
+ public void setKeyIdMode(int keyIdMode) {
+ this.keyIdMode = keyIdMode;
+ }
+
+ /**
+ * Key Index of this data frame.
+ *
+ * @return the current keyIndex as {@link int}
+ */
+ public int getKeyIndex() {
+ return keyIndex;
+ }
+
+ /**
+ * Key Index of this data frame.
+ *
+ * @param keyIndex the KeyIndex to set as {@link int}
+ */
+ public void setKeyIndex(int keyIndex) {
+ this.keyIndex = keyIndex;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_MAC) && (response.getReqCmd1() == 0x0C));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_MAC, 0x0C);
+
+ // Serialize the fields
+ serializer.serializeUInt32(scanChannels);
+ serializer.serializeUInt8(scanType);
+ serializer.serializeUInt8(scanDuration);
+ serializer.serializeUInt8(channelPage);
+ serializer.serializeUInt8(keySource);
+ serializer.serializeUInt8(securityLevel);
+ serializer.serializeUInt8(keyIdMode);
+ serializer.serializeUInt8(keyIndex);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(223);
+ builder.append("ZstackMacScanReqSreq [scanChannels=");
+ builder.append(scanChannels);
+ builder.append(", scanType=");
+ builder.append(scanType);
+ builder.append(", scanDuration=");
+ builder.append(scanDuration);
+ builder.append(", channelPage=");
+ builder.append(channelPage);
+ builder.append(", keySource=");
+ builder.append(keySource);
+ builder.append(", securityLevel=");
+ builder.append(securityLevel);
+ builder.append(", keyIdMode=");
+ builder.append(keyIdMode);
+ builder.append(", keyIndex=");
+ builder.append(keyIndex);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/mac/ZstackMacScanReqSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/mac/ZstackMacScanReqSrsp.java
new file mode 100644
index 0000000000..0ecc68682a
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/mac/ZstackMacScanReqSrsp.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.mac;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command MAC_SCAN_REQ.
+ *
+ * This command is used to send a request to the device to perform a network scan.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackMacScanReqSrsp extends ZstackFrameResponse {
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackMacScanReqSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackMacScanReqSrsp []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/rpc/ZstackRpcSreqErrorSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/rpc/ZstackRpcSreqErrorSrsp.java
new file mode 100644
index 0000000000..3b713f2da6
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/rpc/ZstackRpcSreqErrorSrsp.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.rpc;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command RPC_SREQ_ERROR.
+ *
+ * When the ZNP cannot recognize an SREQ command from the host processor, the following SRSP is returned.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackRpcSreqErrorSrsp extends ZstackFrameResponse {
+
+ /**
+ * The error code maps to one of the enumerated values.
+ */
+ private ZstackSreqErrorCode errorCode;
+
+ /**
+ * The Cmd0 value of the processed SREQ
+ */
+ private int reqCmd0;
+
+ /**
+ * The Cmd1 value of the processed SREQ
+ */
+ private int reqCmd1;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackRpcSreqErrorSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ errorCode = ZstackSreqErrorCode.valueOf(deserializer.deserializeUInt8());
+ reqCmd0 = deserializer.deserializeUInt8();
+ reqCmd1 = deserializer.deserializeUInt8();
+ }
+
+ /**
+ * The error code maps to one of the enumerated values.
+ *
+ * @return the current errorCode as {@link ZstackSreqErrorCode}
+ */
+ public ZstackSreqErrorCode getErrorCode() {
+ return errorCode;
+ }
+
+ /**
+ * The error code maps to one of the enumerated values.
+ *
+ * @param errorCode the ErrorCode to set as {@link ZstackSreqErrorCode}
+ */
+ public void setErrorCode(ZstackSreqErrorCode errorCode) {
+ this.errorCode = errorCode;
+ }
+
+ /**
+ * The Cmd0 value of the processed SREQ
+ *
+ * @return the current reqCmd0 as {@link int}
+ */
+ public int getReqCmd0() {
+ return reqCmd0;
+ }
+
+ /**
+ * The Cmd0 value of the processed SREQ
+ *
+ * @param reqCmd0 the ReqCmd0 to set as {@link int}
+ */
+ public void setReqCmd0(int reqCmd0) {
+ this.reqCmd0 = reqCmd0;
+ }
+
+ /**
+ * The Cmd1 value of the processed SREQ
+ *
+ * @return the current reqCmd1 as {@link int}
+ */
+ public int getReqCmd1() {
+ return reqCmd1;
+ }
+
+ /**
+ * The Cmd1 value of the processed SREQ
+ *
+ * @param reqCmd1 the ReqCmd1 to set as {@link int}
+ */
+ public void setReqCmd1(int reqCmd1) {
+ this.reqCmd1 = reqCmd1;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(100);
+ builder.append("ZstackRpcSreqErrorSrsp [errorCode=");
+ builder.append(errorCode);
+ builder.append(", reqCmd0=");
+ builder.append(String.format("%02X", reqCmd0));
+ builder.append(", reqCmd1=");
+ builder.append(String.format("%02X", reqCmd1));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/rpc/ZstackSreqErrorCode.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/rpc/ZstackSreqErrorCode.java
new file mode 100644
index 0000000000..1c9a4ed1d8
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/rpc/ZstackSreqErrorCode.java
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.rpc;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class to implement the Z-Stack Enumeration ZstackSreqErrorCode.
+ *
+ * SREQ RPC Error code
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackSreqErrorCode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ INVALID_SUBSYSTEM(0x0001),
+
+ /**
+ *
+ */
+ INVALID_COMMAND_ID(0x0002),
+
+ /**
+ *
+ */
+ INVALID_PARAMETER(0x0003),
+
+ /**
+ *
+ */
+ INVALID_LENGTH(0x0003);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Device Info Constants
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackDeviceInformation {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ ZB_INFO_DEV_STATE(0x0000),
+
+ /**
+ *
+ */
+ ZB_INFO_IEEE_ADDR(0x0001),
+
+ /**
+ *
+ */
+ ZB_INFO_SHORT_ADDR(0x0002),
+
+ /**
+ *
+ */
+ ZB_INFO_PARENT_SHORT_ADDR(0x0003),
+
+ /**
+ *
+ */
+ ZB_INFO_PARENT_IEEE_ADDR(0x0004),
+
+ /**
+ *
+ */
+ ZB_INFO_CHANNEL(0x0005),
+
+ /**
+ *
+ */
+ ZB_INFO_PAN_ID(0x0006),
+
+ /**
+ *
+ */
+ ZB_INFO_EXT_PAN_ID(0x0007);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * This command retrieves a Device Information Property.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZbGetDeviceInfoSreq extends ZstackFrameRequest {
+
+ /**
+ * The Identifier for the device information.
+ */
+ private int param;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZbGetDeviceInfoSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The Identifier for the device information.
+ *
+ * @return the current param as {@link int}
+ */
+ public int getParam() {
+ return param;
+ }
+
+ /**
+ * The Identifier for the device information.
+ *
+ * @param param the Param to set as {@link int}
+ */
+ public void setParam(int param) {
+ this.param = param;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SAPI) && (response.getReqCmd1() == 0x06));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SAPI, 0x06);
+
+ // Serialize the fields
+ serializer.serializeUInt8(param);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(53);
+ builder.append("ZstackZbGetDeviceInfoSreq [param=");
+ builder.append(param);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbGetDeviceInfoSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbGetDeviceInfoSrsp.java
new file mode 100644
index 0000000000..1810fe370e
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbGetDeviceInfoSrsp.java
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sapi;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZB_GET_DEVICE_INFO.
+ *
+ * This command retrieves a Device Information Property.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZbGetDeviceInfoSrsp extends ZstackFrameResponse {
+
+ /**
+ * The Identifier for the device information.
+ */
+ private int param;
+
+ /**
+ * A buffer to hold the device information
+ */
+ private int value;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZbGetDeviceInfoSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ param = deserializer.deserializeUInt8();
+ value = deserializer.deserializeUInt16();
+ }
+
+ /**
+ * The Identifier for the device information.
+ *
+ * @return the current param as {@link int}
+ */
+ public int getParam() {
+ return param;
+ }
+
+ /**
+ * The Identifier for the device information.
+ *
+ * @param param the Param to set as {@link int}
+ */
+ public void setParam(int param) {
+ this.param = param;
+ }
+
+ /**
+ * A buffer to hold the device information
+ *
+ * @return the current value as {@link int}
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * A buffer to hold the device information
+ *
+ * @param value the Value to set as {@link int}
+ */
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(78);
+ builder.append("ZstackZbGetDeviceInfoSrsp [param=");
+ builder.append(param);
+ builder.append(", value=");
+ builder.append(value);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbReadConfigurationSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbReadConfigurationSreq.java
new file mode 100644
index 0000000000..c560bcccd7
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbReadConfigurationSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sapi;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackConfigId;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZB_READ_CONFIGURATION.
+ *
+ * This command is used to get a configuration property from non-volatile memory.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZbReadConfigurationSreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ */
+ private ZstackConfigId configId;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZbReadConfigurationSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ *
+ * @return the current configId as {@link ZstackConfigId}
+ */
+ public ZstackConfigId getConfigId() {
+ return configId;
+ }
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ *
+ * @param configId the ConfigId to set as {@link ZstackConfigId}
+ */
+ public void setConfigId(ZstackConfigId configId) {
+ this.configId = configId;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SAPI) && (response.getReqCmd1() == 0x04));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SAPI, 0x04);
+
+ // Serialize the fields
+ serializer.serializeUInt16(configId.getKey());
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(57);
+ builder.append("ZstackZbReadConfigurationSreq [configId=");
+ builder.append(configId);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbReadConfigurationSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbReadConfigurationSrsp.java
new file mode 100644
index 0000000000..e8f250afd7
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbReadConfigurationSrsp.java
@@ -0,0 +1,128 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sapi;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackConfigId;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZB_READ_CONFIGURATION.
+ *
+ * This command is used to get a configuration property from non-volatile memory.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZbReadConfigurationSrsp extends ZstackFrameResponse {
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ */
+ private ZstackConfigId configId;
+
+ /**
+ * Buffer to hold the configuration property.
+ */
+ private int[] value;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZbReadConfigurationSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ configId = ZstackConfigId.valueOf(deserializer.deserializeUInt16());
+ int len = deserializer.deserializeUInt8();
+ value = deserializer.deserializeUInt8Array(len);
+ }
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ *
+ * @return the current configId as {@link ZstackConfigId}
+ */
+ public ZstackConfigId getConfigId() {
+ return configId;
+ }
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ *
+ * @param configId the ConfigId to set as {@link ZstackConfigId}
+ */
+ public void setConfigId(ZstackConfigId configId) {
+ this.configId = configId;
+ }
+
+ /**
+ * Buffer to hold the configuration property.
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ /**
+ * Buffer to hold the configuration property.
+ *
+ * @param value the Value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(132);
+ builder.append("ZstackZbReadConfigurationSrsp [status=");
+ builder.append(status);
+ builder.append(", configId=");
+ builder.append(configId);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbWriteConfigurationSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbWriteConfigurationSreq.java
new file mode 100644
index 0000000000..d8eda56e24
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbWriteConfigurationSreq.java
@@ -0,0 +1,111 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sapi;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackConfigId;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZB_WRITE_CONFIGURATION.
+ *
+ * This command is used to write a configuration property to nonvolatile memory.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZbWriteConfigurationSreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ */
+ private ZstackConfigId configId;
+
+ /**
+ * Buffer to hold the configuration property.
+ */
+ private int[] value;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZbWriteConfigurationSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ *
+ * @return the current configId as {@link ZstackConfigId}
+ */
+ public ZstackConfigId getConfigId() {
+ return configId;
+ }
+
+ /**
+ * Specifies the Identifier for the configuration property.
+ *
+ * @param configId the ConfigId to set as {@link ZstackConfigId}
+ */
+ public void setConfigId(ZstackConfigId configId) {
+ this.configId = configId;
+ }
+
+ /**
+ * Buffer to hold the configuration property.
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ /**
+ * Buffer to hold the configuration property.
+ *
+ * @param value the Value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SAPI) && (response.getReqCmd1() == 0x05));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SAPI, 0x05);
+
+ // Serialize the fields
+ serializer.serializeUInt16(configId.getKey());
+ serializer.serializeUInt8(value.length);
+ serializer.serializeUInt8Array(value);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(108);
+ builder.append("ZstackZbWriteConfigurationSreq [configId=");
+ builder.append(configId);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbWriteConfigurationSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbWriteConfigurationSrsp.java
new file mode 100644
index 0000000000..5f6b240139
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sapi/ZstackZbWriteConfigurationSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sapi;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZB_WRITE_CONFIGURATION.
+ *
+ * This command is used to write a configuration property to nonvolatile memory.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZbWriteConfigurationSrsp extends ZstackFrameResponse {
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZbWriteConfigurationSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(58);
+ builder.append("ZstackZbWriteConfigurationSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbHandshakeCmdSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbHandshakeCmdSreq.java
new file mode 100644
index 0000000000..2f6fd7cc8d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbHandshakeCmdSreq.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sbl;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SB_HANDSHAKE_CMD.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackSbHandshakeCmdSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackSbHandshakeCmdSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SBL) && (response.getReqCmd1() == 0x04));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SBL, 0x04);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackSbHandshakeCmdSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbHandshakeCmdSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbHandshakeCmdSrsp.java
new file mode 100644
index 0000000000..0c64230295
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbHandshakeCmdSrsp.java
@@ -0,0 +1,169 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sbl;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SB_HANDSHAKE_CMD.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackSbHandshakeCmdSrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 - SUCCESS 0x01 - FAILURE
+ */
+ private ZstackResponseCode status;
+
+ /**
+ */
+ private int bootloaderRevision;
+
+ /**
+ */
+ private int deviceType;
+
+ /**
+ * The maximum data size to use with Read / Write command
+ */
+ private int bufferLength;
+
+ /**
+ * 0x800 – CC2538 flash page size
+ */
+ private int pageSize;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSbHandshakeCmdSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ bootloaderRevision = deserializer.deserializeUInt32();
+ deviceType = deserializer.deserializeUInt8();
+ bufferLength = deserializer.deserializeUInt32();
+ pageSize = deserializer.deserializeUInt32();
+ }
+
+ /**
+ * 0x00 - SUCCESS 0x01 - FAILURE
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 - SUCCESS 0x01 - FAILURE
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ *
+ *
+ * @return the current bootloaderRevision as {@link int}
+ */
+ public int getBootloaderRevision() {
+ return bootloaderRevision;
+ }
+
+ /**
+ *
+ *
+ * @param bootloaderRevision the BootloaderRevision to set as {@link int}
+ */
+ public void setBootloaderRevision(int bootloaderRevision) {
+ this.bootloaderRevision = bootloaderRevision;
+ }
+
+ /**
+ *
+ *
+ * @return the current deviceType as {@link int}
+ */
+ public int getDeviceType() {
+ return deviceType;
+ }
+
+ /**
+ *
+ *
+ * @param deviceType the DeviceType to set as {@link int}
+ */
+ public void setDeviceType(int deviceType) {
+ this.deviceType = deviceType;
+ }
+
+ /**
+ * The maximum data size to use with Read / Write command
+ *
+ * @return the current bufferLength as {@link int}
+ */
+ public int getBufferLength() {
+ return bufferLength;
+ }
+
+ /**
+ * The maximum data size to use with Read / Write command
+ *
+ * @param bufferLength the BufferLength to set as {@link int}
+ */
+ public void setBufferLength(int bufferLength) {
+ this.bufferLength = bufferLength;
+ }
+
+ /**
+ * 0x800 – CC2538 flash page size
+ *
+ * @return the current pageSize as {@link int}
+ */
+ public int getPageSize() {
+ return pageSize;
+ }
+
+ /**
+ * 0x800 – CC2538 flash page size
+ *
+ * @param pageSize the PageSize to set as {@link int}
+ */
+ public void setPageSize(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(152);
+ builder.append("ZstackSbHandshakeCmdSrsp [status=");
+ builder.append(status);
+ builder.append(", bootloaderRevision=");
+ builder.append(bootloaderRevision);
+ builder.append(", deviceType=");
+ builder.append(deviceType);
+ builder.append(", bufferLength=");
+ builder.append(bufferLength);
+ builder.append(", pageSize=");
+ builder.append(pageSize);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbWriteCmdSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbWriteCmdSreq.java
new file mode 100644
index 0000000000..2becfbb9b4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbWriteCmdSreq.java
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sbl;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SB_WRITE_CMD.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackSbWriteCmdSreq extends ZstackFrameRequest {
+
+ /**
+ * Payload data.
+ */
+ private int[] payload;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSbWriteCmdSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Payload data.
+ *
+ * @return the current payload as {@link int[]}
+ */
+ public int[] getPayload() {
+ return payload;
+ }
+
+ /**
+ * Payload data.
+ *
+ * @param payload the Payload to set as {@link int[]}
+ */
+ public void setPayload(int[] payload) {
+ this.payload = payload;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SBL) && (response.getReqCmd1() == 0x00));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SBL, 0x00);
+
+ // Serialize the fields
+ serializer.serializeUInt32(payload.length);
+ serializer.serializeUInt8Array(payload);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(73);
+ builder.append("ZstackSbWriteCmdSreq [payload=");
+ for (int c = 0; c < payload.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", payload[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbWriteCmdSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbWriteCmdSrsp.java
new file mode 100644
index 0000000000..b4a09e3e9f
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sbl/ZstackSbWriteCmdSrsp.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sbl;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SB_WRITE_CMD.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackSbWriteCmdSrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 - SUCCESS 0x01 - FAILURE
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSbWriteCmdSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * 0x00 - SUCCESS 0x01 - FAILURE
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 - SUCCESS 0x01 - FAILURE
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(48);
+ builder.append("ZstackSbWriteCmdSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackConfigId.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackConfigId.java
new file mode 100644
index 0000000000..65f43f4955
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackConfigId.java
@@ -0,0 +1,663 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class to implement the Z-Stack Enumeration ZstackConfigId.
+ *
+ * Device specific configuration parameters.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackConfigId {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ ZCD_NV_EXTADDR(0x0000),
+
+ /**
+ *
+ */
+ ZCD_NV_BOOTCOUNTER(0x0001),
+
+ /**
+ * This parameter controls the device startup options. Size: 1 byte; Default value: 0
+ */
+ ZCD_NV_STARTUP_OPTION(0x0003),
+
+ /**
+ *
+ */
+ ZCD_NV_START_DELAY(0x0004),
+
+ /**
+ * This item holds all kinds of network information.
+ */
+ ZCD_NV_NIB(0x0021),
+
+ /**
+ * If this parameter is set to a non-zero value, a CC2530-ZNP device that is configured as an end- device will wake up periodically
+ * with this duration to check for data with its parent device. This value is specified in milliseconds and can range from 1 to 65000.
+ * If this parameter is set to zero, the device will not automatically wake up to poll for data. Instead, an external trigger or an
+ * internal event (for example, via a software timer event) can be used to wake up the device. Size: 4 bytes; Default value: 2000
+ */
+ ZCD_NV_POLL_RATE_OLD16(0x0035),
+
+ /**
+ * When an end-device polls for data with its parent and finds that it does have data, it can poll again with a shorter duration in case
+ * there is more data queued for it at its parent device. This value is specified in milliseconds. This feature can be turned off by
+ * setting this value to zero. Size: 2 bytes; Default value: 100
+ */
+ ZCD_NV_QUEUED_POLL_RATE(0x0025),
+
+ /**
+ * When an end-device sends a data packet, it can poll again with a shorter duration, specified by this parameter, if the
+ * application is expecting to receive an application level packet in response. This value is specified in milliseconds. This
+ * feature can be turned off by setting the value to zero.
+ *
+ * Note: The setting of the queued and response poll rates has to be done with caution if the device is sending and receiving
+ * at the same time or if the device is sending data too fast. If the device is sending data too fast, setting a queued poll rate with a
+ * higher duration than the sending rate will cause the poll event to be continuously rescheduled to the future. Then the device
+ * will never poll for data with its parent and consequently it may miss any packets destined for it. Size: 2 bytes; Default value:
+ * 100
+ */
+ ZCD_NV_RESPONSE_POLL_RATE(0x0026),
+
+ /**
+ *
+ */
+ ZCD_NV_REJOIN_POLL_RATE(0x0027),
+
+ /**
+ *
+ */
+ ZCD_NV_DATA_RETRIES(0x0028),
+
+ /**
+ * The number of times an end-device will fail when communicating with its parent before invoking the rejoin mechanism to find and
+ * join a new parent. Size: 1 byte; Default value: 2.
+ */
+ ZCD_NV_POLL_FAILURE_RETRIES(0x0029),
+
+ /**
+ *
+ */
+ ZCD_NV_STACK_PROFILE(0x002A),
+
+ /**
+ * The amount of time (in seconds) that a router or coordinator device will buffer messages destined to their end-device child
+ * nodes. It is recommended that this is at least greater than the poll rate (ZCD_NV_POLL_RATE) to ensure that end-device will have
+ * a chance to wakeup and poll for the data. Size: 1 byte; Default value: 7
+ */
+ ZCD_NV_INDIRECT_MSG_TIMEOUT(0x002B),
+
+ /**
+ * The amount of time (in seconds) for which a route must be idle (i.e. no packets are transmitted on that route) before that routing
+ * entry is marked as expired. An expired entry may be deleted if the table is full and the space is needed for another new routing
+ * entry. This can be set to a special value of 0 to turn off route expiry. In this case, route entries are not expired. Size: 1 byte;
+ * Default value: 60.
+ */
+ ZCD_NV_ROUTE_EXPIRY_TIME(0x002C),
+
+ /**
+ * This parameter configures the EXTENDED PAN ID in Z-Stack. The extended pan id is used to further segregate the sub network(s)
+ * among a bigger PAN network.
+ */
+ ZCD_NV_EXTPANID(0x002D),
+
+ /**
+ * The maximum number of retransmissions that a device will attempt when trying to transmit a broadcast packet. The typical range
+ * is from 1 through 3. Size: 1 byte; Default value: 2.
+ */
+ ZCD_NV_BCAST_RETRIES(0x002E),
+
+ /**
+ * The amount of time (in units of 100milliseconds) a device will wait before retransmitting a broadcast packet. The
+ * retransmission will not happen if the node hears that each of its neighbor nodes have all transmitted that packet. Size: 1 byte;
+ * Default value: 5
+ */
+ ZCD_NV_PASSIVE_ACK_TIMEOUT(0x002F),
+
+ /**
+ * The maximum amount of time (in units of 100ms) that it can take for a broadcast packet to propagate through the entire network.
+ * This includes time for all retransmissions.
+ *
+ * Note: This parameter must be set with caution. It must be set to a value of at least (ZCD_NV_BCAST_RETRIES + 1) *
+ * ZCD_NV_PASSIVE_ACK_TIMEOUT To be safe, the actual value should be higher than the above minimum by about 500ms or more. Size: 1
+ * byte; Default value: 30.
+ */
+ ZCD_NV_BCAST_DELIVERY_TIME(0x0030),
+
+ /**
+ * Holds the value of the network operational mode. The default value is NWK_MODE_MESH and must not be modified.
+ */
+ ZCD_NV_NWK_MODE(0x0031),
+
+ /**
+ *
+ */
+ ZCD_NV_CONCENTRATOR_ENABLE(0x0032),
+
+ /**
+ *
+ */
+ ZCD_NV_CONCENTRATOR_DISCOVERY(0x0033),
+
+ /**
+ *
+ */
+ ZCD_NV_CONCENTRATOR_RADIUS(0x0034),
+
+ /**
+ * If this parameter is set to a non-zero value, a CC2530-ZNP device that is configured as an end- device will wake up periodically
+ * with this duration to check for data with its parent device. This value is specified in milliseconds and can range from 1 to 65000.
+ * If this parameter is set to zero, the device will not automatically wake up to poll for data. Instead, an external trigger or an
+ * internal event (for example, via a software timer event) can be used to wake up the device. Size: 4 bytes; Default value: 2000
+ */
+ ZCD_NV_POLL_RATE(0x0035),
+
+ /**
+ * Holds the value of route cache flag. This enables or disables the route cache for coordinator and is FALSE by default.
+ */
+ ZCD_NV_CONCENTRATOR_RC(0x0036),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_MGR_MODE(0x0037),
+
+ /**
+ *
+ */
+ ZCD_NV_SRC_RTG_EXPIRY_TIME(0x0038),
+
+ /**
+ *
+ */
+ ZCD_NV_ROUTE_DISCOVERY_TIME(0x0039),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_ACTIVE_KEY_INFO(0x003A),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_ALTERN_KEY_INFO(0x003B),
+
+ /**
+ *
+ */
+ ZCD_NV_ROUTER_OFF_ASSOC_CLEANUP(0x003C),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_LEAVE_REQ_ALLOWED(0x003D),
+
+ /**
+ * Holds the value of Child Aging capability flag. This enables or disables child aging and must be set to TRUE for Zigbee 3.0
+ * compliance.
+ */
+ ZCD_NV_NWK_CHILD_AGE_ENABLE(0x003E),
+
+ /**
+ *
+ */
+ ZCD_NV_DEVICE_LIST_KA_TIMEOUT(0x003F),
+
+ /**
+ *
+ */
+ ZCD_NV_BINDING_TABLE(0x0041),
+
+ /**
+ *
+ */
+ ZCD_NV_GROUP_TABLE(0x0042),
+
+ /**
+ * The number of retransmissions performed on a data packet at the application layer if the packet was transmitted with the
+ * end-to-end acknowledgement option enabled. Size: 1 byte; Default value: 3
+ */
+ ZCD_NV_APS_FRAME_RETRIES(0x0043),
+
+ /**
+ * The amount of time (in milliseconds) a device will wait before re-transmitting a packet that used the APS acknowledgement
+ * option. If the APS acknowledgement is not received by this time, the sending device will assume a failure and attempt a
+ * re-transmission.
+ *
+ * Note: This is recommended to be set to approximately the expected round trip time for the packet. Note that if the
+ * destination (or source) device is an end-device, the round trip time for the packet will include an additional delay up to the
+ * poll duration. This is in addition to the delay normally caused by the network. Size: 2 bytes; Default value: 3000
+ */
+ ZCD_NV_APS_ACK_WAIT_DURATION(0x0044),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_ACK_WAIT_MULTIPLIER(0x0045),
+
+ /**
+ * The amount of time (in milliseconds) a device will wait for a response to a binding request. Size: 2 bytes; Default value: 8000
+ */
+ ZCD_NV_BINDING_TIME(0x0046),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_USE_EXT_PANID(0x0047),
+
+ /**
+ *
+ */
+ ZCD_NV_COMMISSIONED_NWK_ADDR(0x0049),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_NONMEMBER_RADIUS(0x004B),
+
+ /**
+ * Holds the security manager entries of type ZDSecMgrEntry_t to store the TCKL used to talk with devices in the network that
+ * require APS security. The number of entries is controled by ZDSECMGR_DEVICE_MAX=3 by default.
+ */
+ ZCD_NV_APS_LINK_KEY_TABLE(0x004C),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_DUPREJ_TIMEOUT_INC(0x004D),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_DUPREJ_TIMEOUT_COUNT(0x004E),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_DUPREJ_TABLE_SIZE(0x004F),
+
+ /**
+ *
+ */
+ ZCD_NV_DIAGNOSTIC_STATS(0x0050),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_PARENT_INFO(0x0051),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_ENDDEV_TIMEOUT_DEF(0x0052),
+
+ /**
+ * Holds the value of Child Aging Timeout. This is the time in seconds used by END DEVICE when sending End Device Timeout Request that
+ * tells a COORDINATOR the timeout to remove this END DEVICE after no data poll is received.
+ */
+ ZCD_NV_END_DEV_TIMEOUT_VALUE(0x0053),
+
+ /**
+ * Holds the value of End Device Configuration field when END DEVICE when sending End Device Timeout Request. Is set to 0x00 by
+ * default which is the only valid value accourding to Zigbee Core spec R21.
+ */
+ ZCD_NV_END_DEV_CONFIGURATION(0x0054),
+
+ /**
+ *
+ */
+ ZCD_NV_BDBNODEISONANETWORK(0x0055),
+
+ /**
+ *
+ */
+ ZCD_NV_BDBREPORTINGCONFIG(0x0056),
+
+ /**
+ * holds the value of network key that is generated by default. The key can be set to a fixed value by setting DEFAULT_KEY macro. This
+ * is used for securing and un-securing packets in the network, if security is enabled for the network.
+ *
+ * Note: Use of this configuration item requires the ZNP code to be built with the SECURE=1 compile option. Size: 16 bytes;
+ * Default value: [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F]
+ */
+ ZCD_NV_PRECFGKEY(0x0062),
+
+ /**
+ * If security functionality is enabled, there are two options to distribute the security key to all devices in the network. If this
+ * parameter is true, the same security key is assumed to be pre-configured in all devices in the network.If it is set to false, then
+ * the key only needs to be configured on the coordinator device. In this case, the key is distributed to each device upon joining by
+ * the coordinator. This key distribution will happen in the “clear” on the last hop of the packet transmission and this
+ * constitutes a brief “period of vulnerability” during which a malicious device can capture the key. Hence it is not recommended
+ * unless it can be ensured that there are no malicious devices in the vicinity at the time of network formation.
+ *
+ * Note: Use of this configuration item requires the ZNP code to be built with the SECURE=1 compile option. Size: 1 byte;
+ * Default value: TRUE
+ */
+ ZCD_NV_PRECFGKEYS_ENABLE(0x0063),
+
+ /**
+ * This parameter determines if security is used or not in this network. It can be set to 0 (to turn off NWK security) or 1 (to turn on NWK
+ * security). Size: 1 byte; Default value: 0.
+ */
+ ZCD_NV_SECURITY_MODE(0x0064),
+
+ /**
+ * This value tells if only secure joins are allowed. Set to TRUE by default which is the only valid value according to Zigbee Core
+ * spec R21.
+ */
+ ZCD_NV_SECURE_PERMIT_JOIN(0x0065),
+
+ /**
+ * Is equal to ZG_GLOBAL_LINK_KEY=1 and must not be modified according to Zigbee Core spec R21.
+ */
+ ZCD_NV_APS_LINK_KEY_TYPE(0x0066),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_ALLOW_R19_SECURITY(0x0067),
+
+ /**
+ * Default distributed nwk key Id. Nv ID not in use
+ */
+ ZCD_NV_DISTRIBUTED_KEY(0x0068),
+
+ /**
+ *
+ */
+ ZCD_NV_IMPLICIT_CERTIFICATE(0x0069),
+
+ /**
+ *
+ */
+ ZCD_NV_DEVICE_PRIVATE_KEY(0x006A),
+
+ /**
+ *
+ */
+ ZCD_NV_CA_PUBLIC_KEY(0x006B),
+
+ /**
+ *
+ */
+ ZCD_NV_KE_MAX_DEVICES(0x006C),
+
+ /**
+ * Controls whether a single pre-configured trust center link key is used or whether multiple pre- configured trust center link
+ * keys are used, hereby referred to as Single Key Mode and Multiple Key Mode, respectively. In multiple key mode, unique
+ * pre-configured trust center link keys are used between the trust center and each individual device joining the network.
+ * Multiple key mode is required by the recommended secure procedure in ZigBeeSE profile Specification. In single key mode, all
+ * devices are using the same pre-configured trust center link key to join the network. The single key mode provides a simplified
+ * alternative procedure to set up the network. It can be used for testing and debugging purpose. Size: 1 byte; Default value: TRUE
+ */
+ ZCD_NV_USE_DEFAULT_TCLK(0x006D),
+
+ /**
+ *
+ */
+ ZCD_NV_RNG_COUNTER(0x006F),
+
+ /**
+ *
+ */
+ ZCD_NV_RANDOM_SEED(0x0070),
+
+ /**
+ *
+ */
+ ZCD_NV_TRUSTCENTER_ADDR(0x0071),
+
+ /**
+ *
+ */
+ ZCD_NV_CERT_283(0x0072),
+
+ /**
+ *
+ */
+ ZCD_NV_PRIVATE_KEY_283(0x0073),
+
+ /**
+ *
+ */
+ ZCD_NV_PUBLIC_KEY_283(0x0074),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_SEC_MATERIAL_TABLE_START(0x0075),
+
+ /**
+ *
+ */
+ ZCD_NV_NWK_SEC_MATERIAL_TABLE_END(0x0080),
+
+ /**
+ * An optional user-defined data (up to 16bytes) that can be configured in a CC2530-ZNP device so that it can easily identified or
+ * described later. The first byte is the length of the user descriptor data and must not be greater than 16. Size: 17 bytes; Default
+ * value: “CC2530-ZNP x......” (dots represent the device IEEE address)
+ */
+ ZCD_NV_USERDESC(0x0081),
+
+ /**
+ * This holds the value of nwkActiveKeyItems structure and restores the NWK key counter after power cycles.
+ */
+ ZCD_NV_NWKKEY(0x0082),
+
+ /**
+ * This parameter identifies the ZigBee network. This should be set to a value between 0 and 0x3FFF. Networks that exist in the same
+ * vicinity must have different values for this parameter. It can be set to a special value of 0xFFFF to indicate “don’t care”. Size:
+ * 2 bytes; Default value: 0xFFFF
+ */
+ ZCD_NV_PANID(0x0083),
+
+ /**
+ * This parameter is a bit mask of the channels on which this network can operate (note that multiple channels can be selected). See
+ * section 4.5.16 for a table of the bitmap representation that maps to each channel. Multiple networks that exist in the same
+ * vicinity are encouraged to have different values. If multiple channels are selected, the coordinator will pick one of the
+ * channels for network operation. First, an energy scan is performed on each channel and those channels with a high energy level
+ * are discarded. Then, the coordinator determines the number of existing ZigBee networks on each of the remaining channels and
+ * picks the one with the fewest networks. For routers and end-devices, the device will simply scan all the selected channels until
+ * it finds the ZigBee network. Size: 4 bytes; Default value: 0x00000800
+ */
+ ZCD_NV_CHANLIST(0x0084),
+
+ /**
+ *
+ */
+ ZCD_NV_SCAN_DURATION(0x0086),
+
+ /**
+ * This is the logical type of the device in the ZigBee network. This can be set to a COORDINATOR (0x00), ROUTER (0x01) or ENDDEVICE
+ * (0x02).
+ *
+ * Note: This parameter is read by the CC2530-ZNP device immediately when it powers up after a reset. Size: 1 byte; Default
+ * value: 0x00
+ */
+ ZCD_NV_LOGICAL_TYPE(0x0087),
+
+ /**
+ *
+ */
+ ZCD_NV_NWKMGR_MIN_TX(0x0088),
+
+ /**
+ *
+ */
+ ZCD_NV_NWKMGR_ADDR(0x0089),
+
+ /**
+ * This configures the manner in which ZDO responses (hereby referred to as callbacks) are issued to the host processor. By
+ * default, this item is set to FALSE, which means that the host processor must use the ZDO_MSG_CB_REGISTER command to subscribe to
+ * a specific ZDO callback in order to receive it. The ZDO callback is then conveyed as part of the ZDO_MSG_CB_INCOMING command. If
+ * ZCD_NV_ZDO_DIRECT_CB is set TRUE, then the host processor will receive the “verbose” response. For example, the host
+ * processor would receive the ZDO_IEEE_ADDR_RSP command in response to ZDO_IEEE_ADDR_REQ. Size: 1 byte; Default value: FALSE
+ */
+ ZCD_NV_ZDO_DIRECT_CB(0x008F),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_SHORT_ADDR(0x00B1),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_EXT_PANID(0x00B2),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_PANID(0x00B3),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_CHANNEL_MASK(0x00B4),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_PROTOCOL_VER(0x00B5),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_STACK_PROFILE(0x00B6),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_STARTUP_CTRL(0x00B7),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_TC_ADDR(0x00C1),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_TC_MASTER_KEY(0x00C2),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_NWK_KEY(0x00C3),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_USE_INSEC_JOIN(0x00C4),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_PRECFG_LINK_KEY(0x00C5),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_NWK_KEY_SEQ_NUM(0x00C6),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_NWK_KEY_TYPE(0x00C7),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_NWK_MGR_ADDR(0x00C8),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_CURR_TC_MASTER_KEY(0x00D1),
+
+ /**
+ *
+ */
+ ZCD_NV_SAS_CURR_NWK_KEY(0x00D2),
+
+ /**
+ *
+ */
+ ZCD_NV_TCLK_TABLE_START(0x0101),
+
+ /**
+ *
+ */
+ ZCD_NV_TCLK_TABLE_END(0x01FF),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_LINK_KEY_DATA_START(0x0201),
+
+ /**
+ *
+ */
+ ZCD_NV_APS_LINK_KEY_DATA_END(0x02FF);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Diagnostics attribute IDs.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackDiagnosticAttribute {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * System Clock when stats were saved/cleared
+ */
+ ZDIAGS_SYSTEM_CLOCK(0x0000),
+
+ /**
+ * Increments every time the system resets
+ */
+ ZDIAGS_NUMBER_OF_RESETS(0x0001),
+
+ /**
+ * MAC diagnostic CRC success counter
+ */
+ ZDIAGS_MAC_RX_CRC_PASS(0x0064),
+
+ /**
+ * MAC diagnostic CRC failure counter
+ */
+ ZDIAGS_MAC_RX_CRC_FAIL(0x0065),
+
+ /**
+ * MAC layer retries a unicast
+ */
+ ZDIAGS_MAC_TX_UCAST_RETRY(0x006A),
+
+ /**
+ * Mac layer fails to send a unicast
+ */
+ ZDIAGS_MAC_TX_UCAST_FAIL(0x006B),
+
+ /**
+ * NWK packet decryption failed
+ */
+ ZDIAGS_NWK_DECRYPT_FAILURES(0x00CF),
+
+ /**
+ * NWK packet drop because of validation error
+ */
+ ZDIAGS_PACKET_VALIDATE_DROP_COUNT(0x00D3),
+
+ /**
+ * APS layer transmits broadcast
+ */
+ ZDIAGS_APS_TX_BCAST(0x012D),
+
+ /**
+ * APS layer successfully transmits a unicast
+ */
+ ZDIAGS_APS_TX_UCAST_SUCCESS(0x012F),
+
+ /**
+ * APS layer retries the sending of a unicast
+ */
+ ZDIAGS_APS_TX_UCAST_RETRY(0x0130),
+
+ /**
+ * APS layer fails to send a unicast
+ */
+ ZDIAGS_APS_TX_UCAST_FAIL(0x0131),
+
+ /**
+ * APS packet decryption failed
+ */
+ ZDIAGS_APS_DECRYPT_FAILURES(0x0134),
+
+ /**
+ * APS invalid packet dropped
+ */
+ ZDIAGS_APS_INVALID_PACKETS(0x0135),
+
+ /**
+ * Number of MAC retries per APS message
+ */
+ ZDIAGS_MAC_RETRIES_PER_APS_TX_SUCCESS(0x0136);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public class ZstackNwkKeyDesc {
+
+ /**
+ */
+ private int keySeqNum;
+
+ /**
+ */
+ private ZigBeeKey key;
+
+ /**
+ *
+ *
+ * @return the current keySeqNum as {@link int}
+ */
+ public int getKeySeqNum() {
+ return keySeqNum;
+ }
+
+ /**
+ *
+ *
+ * @param keySeqNum the keySeqNum to set as {@link int}
+ */
+ public void setKeySeqNum(int keySeqNum) {
+ this.keySeqNum = keySeqNum;
+ }
+
+ /**
+ *
+ *
+ * @return the current key as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getKey() {
+ return key;
+ }
+
+ /**
+ *
+ *
+ * @param key the key to set as {@link ZigBeeKey}
+ */
+ public void setKey(ZigBeeKey key) {
+ this.key = key;
+ }
+
+ /**
+ * Serialize the data from this structure class to an integer array
+ *
+ * @param serializer the {@link ZstackSerializer} to use
+ */
+ public int[] serialize(ZstackSerializer serializer) {
+ // Serialize the fields
+ serializer.serializeUInt8(keySeqNum);
+ serializer.serializeZigBeeKey(key);
+ return serializer.getBuffer();
+ }
+
+ /**
+ * Deserialize the data into this structure class
+ *
+ * @param deserializer the {@link ZstackDeserializer} to use
+ */
+ public void deserialize (ZstackDeserializer deserializer) {
+ // Deserialize the fields
+ keySeqNum = deserializer.deserializeUInt8();
+ key = deserializer.deserializeZigBeeKey();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(69);
+ builder.append("ZstackNwkKeyDesc [keySeqNum=");
+ builder.append(keySeqNum);
+ builder.append(", key=");
+ builder.append(key);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackResetReason.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackResetReason.java
new file mode 100644
index 0000000000..0e421b35d2
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackResetReason.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class to implement the Z-Stack Enumeration ZstackResetReason.
+ *
+ * Reasons for reset
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackResetReason {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ POWER_UP(0x0000),
+
+ /**
+ *
+ */
+ EXTERNAL(0x0001),
+
+ /**
+ *
+ */
+ WATCH_DOG(0x0002);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Reset Command Type
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackResetType {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ TARGET_DEVICE(0x0000),
+
+ /**
+ *
+ */
+ SERIAL_BOOTLOADER(0x0001);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public class ZstackSecMgrEntry {
+
+ /**
+ * Address manager index that holds the IEEE address of destination device. INVALID_NODE_ADDR = 0xFFFE
+ */
+ private int ami;
+
+ /**
+ * Index to the Link Key table in NV
+ */
+ private int keyNvId;
+
+ /**
+ */
+ private ZstackAuthenticationOption authenticateOption;
+
+ /**
+ * Address manager index that holds the IEEE address of destination device. INVALID_NODE_ADDR = 0xFFFE
+ *
+ * @return the current ami as {@link int}
+ */
+ public int getAmi() {
+ return ami;
+ }
+
+ /**
+ * Address manager index that holds the IEEE address of destination device. INVALID_NODE_ADDR = 0xFFFE
+ *
+ * @param ami the ami to set as {@link int}
+ */
+ public void setAmi(int ami) {
+ this.ami = ami;
+ }
+
+ /**
+ * Index to the Link Key table in NV
+ *
+ * @return the current keyNvId as {@link int}
+ */
+ public int getKeyNvId() {
+ return keyNvId;
+ }
+
+ /**
+ * Index to the Link Key table in NV
+ *
+ * @param keyNvId the keyNvId to set as {@link int}
+ */
+ public void setKeyNvId(int keyNvId) {
+ this.keyNvId = keyNvId;
+ }
+
+ /**
+ *
+ *
+ * @return the current authenticateOption as {@link ZstackAuthenticationOption}
+ */
+ public ZstackAuthenticationOption getAuthenticateOption() {
+ return authenticateOption;
+ }
+
+ /**
+ *
+ *
+ * @param authenticateOption the authenticateOption to set as {@link ZstackAuthenticationOption}
+ */
+ public void setAuthenticateOption(ZstackAuthenticationOption authenticateOption) {
+ this.authenticateOption = authenticateOption;
+ }
+
+ /**
+ * Serialize the data from this structure class to an integer array
+ *
+ * @param serializer the {@link ZstackSerializer} to use
+ */
+ public int[] serialize(ZstackSerializer serializer) {
+ // Serialize the fields
+ serializer.serializeUInt16(ami);
+ serializer.serializeUInt16(keyNvId);
+ serializer.serializeUInt8(authenticateOption.getKey());
+ return serializer.getBuffer();
+ }
+
+ /**
+ * Deserialize the data into this structure class
+ *
+ * @param deserializer the {@link ZstackDeserializer} to use
+ */
+ public void deserialize (ZstackDeserializer deserializer) {
+ // Deserialize the fields
+ ami = deserializer.deserializeUInt16();
+ keyNvId = deserializer.deserializeUInt16();
+ authenticateOption = ZstackAuthenticationOption.valueOf(deserializer.deserializeUInt8());
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(95);
+ builder.append("ZstackSecMgrEntry [ami=");
+ builder.append(ami);
+ builder.append(", keyNvId=");
+ builder.append(keyNvId);
+ builder.append(", authenticateOption=");
+ builder.append(authenticateOption);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysGetExtAddrSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysGetExtAddrSreq.java
new file mode 100644
index 0000000000..4f5a525cf9
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysGetExtAddrSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_GET_EXT_ADDR.
+ *
+ * This command is used to set the extended address of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysGetExtAddrSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysGetExtAddrSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x04));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x04);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackSysGetExtAddrSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysGetExtAddrSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysGetExtAddrSrsp.java
new file mode 100644
index 0000000000..a442488952
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysGetExtAddrSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_GET_EXT_ADDR.
+ *
+ * This command is used to set the extended address of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysGetExtAddrSrsp extends ZstackFrameResponse {
+
+ /**
+ * The device’s extended address.
+ */
+ private IeeeAddress extAddress;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysGetExtAddrSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ extAddress = deserializer.deserializeIeeeAddress();
+ }
+
+ /**
+ * The device’s extended address.
+ *
+ * @return the current extAddress as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtAddress() {
+ return extAddress;
+ }
+
+ /**
+ * The device’s extended address.
+ *
+ * @param extAddress the ExtAddress to set as {@link IeeeAddress}
+ */
+ public void setExtAddress(IeeeAddress extAddress) {
+ this.extAddress = extAddress;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackSysGetExtAddrSrsp [extAddress=");
+ builder.append(extAddress);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysNvReadSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysNvReadSreq.java
new file mode 100644
index 0000000000..765500bf4b
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysNvReadSreq.java
@@ -0,0 +1,182 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_NV_READ.
+ *
+ * This command is used to read a single memory item from the target non-volatile memory. The command returns the item requested
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysNvReadSreq extends ZstackFrameRequest {
+
+ /**
+ * The system id (1 for zstack)
+ */
+ private int sysId;
+
+ /**
+ * The sub id (0 for legacy)
+ */
+ private int itemId;
+
+ /**
+ * The Id of the NV item.
+ */
+ private int subId;
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ */
+ private int offset;
+
+ /**
+ * Number of bytes to read
+ */
+ private int length;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysNvReadSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The system id (1 for zstack)
+ *
+ * @return the current sysId as {@link int}
+ */
+ public int getSysId() {
+ return sysId;
+ }
+
+ /**
+ * The system id (1 for zstack)
+ *
+ * @param sysId the sysId to set as {@link int}
+ */
+ public void setSysId(int sysId) {
+ this.sysId = sysId;
+ }
+
+ /**
+ * The sub id (0 for legacy)
+ *
+ * @return the current itemId as {@link int}
+ */
+ public int getItemId() {
+ return itemId;
+ }
+
+ /**
+ * The sub id (0 for legacy)
+ *
+ * @param itemId the itemId to set as {@link int}
+ */
+ public void setItemId(int itemId) {
+ this.itemId = itemId;
+ }
+
+ /**
+ * The Id of the NV item.
+ *
+ * @return the current subId as {@link int}
+ */
+ public int getSubId() {
+ return subId;
+ }
+
+ /**
+ * The Id of the NV item.
+ *
+ * @param subId the subId to set as {@link int}
+ */
+ public void setSubId(int subId) {
+ this.subId = subId;
+ }
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ *
+ * @return the current offset as {@link int}
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ *
+ * @param offset the offset to set as {@link int}
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ /**
+ * Number of bytes to read
+ *
+ * @return the current length as {@link int}
+ */
+ public int getLength() {
+ return length;
+ }
+
+ /**
+ * Number of bytes to read
+ *
+ * @param length the length to set as {@link int}
+ */
+ public void setLength(int length) {
+ this.length = length;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x33));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x33);
+
+ // Serialize the fields
+ serializer.serializeUInt8(sysId);
+ serializer.serializeUInt16(itemId);
+ serializer.serializeUInt16(subId);
+ serializer.serializeUInt16(offset);
+ serializer.serializeUInt8(length);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(147);
+ builder.append("ZstackSysNvReadSreq [sysId=");
+ builder.append(sysId);
+ builder.append(", itemId=");
+ builder.append(itemId);
+ builder.append(", subId=");
+ builder.append(subId);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", length=");
+ builder.append(length);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysNvReadSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysNvReadSrsp.java
new file mode 100644
index 0000000000..264d2a5511
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysNvReadSrsp.java
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_NV_READ.
+ *
+ * This command is used to read a single memory item from the target non-volatile memory. The command returns the item requested
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysNvReadSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * value of the NV item.
+ */
+ private int[] value;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysNvReadSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ int length = deserializer.deserializeUInt8();
+ value = deserializer.deserializeUInt8Array(length);
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * value of the NV item.
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ /**
+ * value of the NV item.
+ *
+ * @param value the value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(97);
+ builder.append("ZstackSysNvReadSrsp [status=");
+ builder.append(status);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvReadSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvReadSreq.java
new file mode 100644
index 0000000000..34175f9b6f
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvReadSreq.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_OSAL_NV_READ.
+ *
+ * This command is used to read a single memory item from the target non-volatile memory. The command accepts an attribute Id value
+ * and data offset and returns the memory value present in the target for the specified attribute Id.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysOsalNvReadSreq extends ZstackFrameRequest {
+
+ /**
+ * The Id of the NV item.
+ */
+ private ZstackConfigId id;
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ */
+ private int offset;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysOsalNvReadSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The Id of the NV item.
+ *
+ * @return the current id as {@link ZstackConfigId}
+ */
+ public ZstackConfigId getId() {
+ return id;
+ }
+
+ /**
+ * The Id of the NV item.
+ *
+ * @param id the id to set as {@link ZstackConfigId}
+ */
+ public void setId(ZstackConfigId id) {
+ this.id = id;
+ }
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ *
+ * @return the current offset as {@link int}
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ *
+ * @param offset the Offset to set as {@link int}
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x08));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x08);
+
+ // Serialize the fields
+ serializer.serializeUInt16(id.getKey());
+ serializer.serializeUInt8(offset);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(76);
+ builder.append("ZstackSysOsalNvReadSreq [id=");
+ builder.append(id);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvReadSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvReadSrsp.java
new file mode 100644
index 0000000000..8b65727b5b
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvReadSrsp.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_OSAL_NV_READ.
+ *
+ * This command is used to read a single memory item from the target non-volatile memory. The command accepts an attribute Id value
+ * and data offset and returns the memory value present in the target for the specified attribute Id.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysOsalNvReadSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Value of the NV item.
+ */
+ private int[] value;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysOsalNvReadSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ int len = deserializer.deserializeUInt8();
+ value = deserializer.deserializeUInt8Array(len);
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * Value of the NV item.
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ /**
+ * Value of the NV item.
+ *
+ * @param value the Value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(101);
+ builder.append("ZstackSysOsalNvReadSrsp [status=");
+ builder.append(status);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvWriteSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvWriteSreq.java
new file mode 100644
index 0000000000..ff91e7f81a
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvWriteSreq.java
@@ -0,0 +1,137 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_OSAL_NV_WRITE.
+ *
+ * This command is used to write to a particular item in non-volatile memory. The command accepts an attribute Id, data offset, data
+ * length, and attribute value. The attribute value is written to the location specified for the attribute Id in the target.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysOsalNvWriteSreq extends ZstackFrameRequest {
+
+ /**
+ * The Id of the NV item.
+ */
+ private ZstackConfigId id;
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ */
+ private int offset;
+
+ /**
+ * Value of the NV item.
+ */
+ private int[] value;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysOsalNvWriteSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The Id of the NV item.
+ *
+ * @return the current id as {@link ZstackConfigId}
+ */
+ public ZstackConfigId getId() {
+ return id;
+ }
+
+ /**
+ * The Id of the NV item.
+ *
+ * @param id the Id to set as {@link ZstackConfigId}
+ */
+ public void setId(ZstackConfigId id) {
+ this.id = id;
+ }
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ *
+ * @return the current offset as {@link int}
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ /**
+ * Number of bytes offset from the beginning or the NV value.
+ *
+ * @param offset the Offset to set as {@link int}
+ */
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ /**
+ * Value of the NV item.
+ *
+ * @return the current value as {@link int[]}
+ */
+ public int[] getValue() {
+ return value;
+ }
+
+ /**
+ * Value of the NV item.
+ *
+ * @param value the Value to set as {@link int[]}
+ */
+ public void setValue(int[] value) {
+ this.value = value;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x09));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x09);
+
+ // Serialize the fields
+ serializer.serializeUInt16(id.getKey());
+ serializer.serializeUInt8(offset);
+ serializer.serializeUInt8(value.length);
+ serializer.serializeUInt8Array(value);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(127);
+ builder.append("ZstackSysOsalNvWriteSreq [id=");
+ builder.append(id);
+ builder.append(", offset=");
+ builder.append(offset);
+ builder.append(", value=");
+ for (int c = 0; c < value.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", value[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvWriteSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvWriteSrsp.java
new file mode 100644
index 0000000000..4f1fc56a20
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysOsalNvWriteSrsp.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_OSAL_NV_WRITE.
+ *
+ * This command is used to write to a particular item in non-volatile memory. The command accepts an attribute Id, data offset, data
+ * length, and attribute value. The attribute value is written to the location specified for the attribute Id in the target.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysOsalNvWriteSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysOsalNvWriteSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(52);
+ builder.append("ZstackSysOsalNvWriteSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysPingSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysPingSreq.java
new file mode 100644
index 0000000000..36052be44a
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysPingSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_PING.
+ *
+ * This command issues PING requests to verify if a device is active and check the capability of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysPingSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysPingSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x01));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x01);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackSysPingSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysPingSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysPingSrsp.java
new file mode 100644
index 0000000000..1c2a48169b
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysPingSrsp.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_PING.
+ *
+ * This command issues PING requests to verify if a device is active and check the capability of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysPingSrsp extends ZstackFrameResponse {
+
+ /**
+ * This field represents the interfaces that this device can handle (compiled into the device).
+ */
+ private int capabilities;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysPingSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ capabilities = deserializer.deserializeUInt16();
+ }
+
+ /**
+ * This field represents the interfaces that this device can handle (compiled into the device).
+ *
+ * @return the current capabilities as {@link int}
+ */
+ public int getCapabilities() {
+ return capabilities;
+ }
+
+ /**
+ * This field represents the interfaces that this device can handle (compiled into the device).
+ *
+ * @param capabilities the Capabilities to set as {@link int}
+ */
+ public void setCapabilities(int capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(45);
+ builder.append("ZstackSysPingSrsp [capabilities=");
+ builder.append(String.format("%04X", capabilities));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysResetIndAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysResetIndAreq.java
new file mode 100644
index 0000000000..48042c97f0
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysResetIndAreq.java
@@ -0,0 +1,196 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_RESET_IND.
+ *
+ * This command is generated by the CC2530 device automatically immediately after a reset.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysResetIndAreq extends ZstackFrameResponse {
+
+ /**
+ * One of the following values indicating the reason for the reset. Power=0x00, External=0x01, Watchdog=0x02
+ */
+ private ZstackResetReason reason;
+
+ /**
+ * Transport protocol revision
+ */
+ private int transportRev;
+
+ /**
+ * Product Id
+ */
+ private int product;
+
+ /**
+ * Software major release number
+ */
+ private int majorRel;
+
+ /**
+ * Software minor release number
+ */
+ private int minorRel;
+
+ /**
+ * Hardware revision number.
+ */
+ private int hwRev;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysResetIndAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ reason = ZstackResetReason.valueOf(deserializer.deserializeUInt8());
+ transportRev = deserializer.deserializeUInt8();
+ product = deserializer.deserializeUInt8();
+ majorRel = deserializer.deserializeUInt8();
+ minorRel = deserializer.deserializeUInt8();
+ hwRev = deserializer.deserializeUInt8();
+ }
+
+ /**
+ * One of the following values indicating the reason for the reset. Power=0x00, External=0x01, Watchdog=0x02
+ *
+ * @return the current reason as {@link ZstackResetReason}
+ */
+ public ZstackResetReason getReason() {
+ return reason;
+ }
+
+ /**
+ * One of the following values indicating the reason for the reset. Power=0x00, External=0x01, Watchdog=0x02
+ *
+ * @param reason the Reason to set as {@link ZstackResetReason}
+ */
+ public void setReason(ZstackResetReason reason) {
+ this.reason = reason;
+ }
+
+ /**
+ * Transport protocol revision
+ *
+ * @return the current transportRev as {@link int}
+ */
+ public int getTransportRev() {
+ return transportRev;
+ }
+
+ /**
+ * Transport protocol revision
+ *
+ * @param transportRev the TransportRev to set as {@link int}
+ */
+ public void setTransportRev(int transportRev) {
+ this.transportRev = transportRev;
+ }
+
+ /**
+ * Product Id
+ *
+ * @return the current product as {@link int}
+ */
+ public int getProduct() {
+ return product;
+ }
+
+ /**
+ * Product Id
+ *
+ * @param product the Product to set as {@link int}
+ */
+ public void setProduct(int product) {
+ this.product = product;
+ }
+
+ /**
+ * Software major release number
+ *
+ * @return the current majorRel as {@link int}
+ */
+ public int getMajorRel() {
+ return majorRel;
+ }
+
+ /**
+ * Software major release number
+ *
+ * @param majorRel the MajorRel to set as {@link int}
+ */
+ public void setMajorRel(int majorRel) {
+ this.majorRel = majorRel;
+ }
+
+ /**
+ * Software minor release number
+ *
+ * @return the current minorRel as {@link int}
+ */
+ public int getMinorRel() {
+ return minorRel;
+ }
+
+ /**
+ * Software minor release number
+ *
+ * @param minorRel the MinorRel to set as {@link int}
+ */
+ public void setMinorRel(int minorRel) {
+ this.minorRel = minorRel;
+ }
+
+ /**
+ * Hardware revision number.
+ *
+ * @return the current hwRev as {@link int}
+ */
+ public int getHwRev() {
+ return hwRev;
+ }
+
+ /**
+ * Hardware revision number.
+ *
+ * @param hwRev the HwRev to set as {@link int}
+ */
+ public void setHwRev(int hwRev) {
+ this.hwRev = hwRev;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(174);
+ builder.append("ZstackSysResetIndAreq [reason=");
+ builder.append(reason);
+ builder.append(", transportRev=");
+ builder.append(transportRev);
+ builder.append(", product=");
+ builder.append(product);
+ builder.append(", majorRel=");
+ builder.append(majorRel);
+ builder.append(", minorRel=");
+ builder.append(minorRel);
+ builder.append(", hwRev=");
+ builder.append(hwRev);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysResetReqAcmd.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysResetReqAcmd.java
new file mode 100644
index 0000000000..134ecc1df8
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysResetReqAcmd.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_RESET_REQ.
+ *
+ * This command is issued by the application processor to reset the CC2530 device. The reset is achieved through an internal
+ * watchdog reset on the CC2530. Note that the hardware reset interface is recommended over using this interface.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysResetReqAcmd extends ZstackFrameRequest {
+
+ /**
+ * This requests a target device reset (0) or serial bootloader reset (1). If the target device does not support serial
+ * bootloading, bootloader reset commands are ignored and no response is sent from the target.
+ */
+ private ZstackResetType type;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysResetReqAcmd() {
+ }
+
+ /**
+ * This requests a target device reset (0) or serial bootloader reset (1). If the target device does not support serial
+ * bootloading, bootloader reset commands are ignored and no response is sent from the target.
+ *
+ * @return the current type as {@link ZstackResetType}
+ */
+ public ZstackResetType getType() {
+ return type;
+ }
+
+ /**
+ * This requests a target device reset (0) or serial bootloader reset (1). If the target device does not support serial
+ * bootloading, bootloader reset commands are ignored and no response is sent from the target.
+ *
+ * @param type the Type to set as {@link ZstackResetType}
+ */
+ public void setType(ZstackResetType type) {
+ this.type = type;
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_ACMD, ZSTACK_SYS, 0x00);
+
+ // Serialize the fields
+ serializer.serializeUInt8(type.getKey());
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(49);
+ builder.append("ZstackSysResetReqAcmd [type=");
+ builder.append(type);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetExtAddrSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetExtAddrSreq.java
new file mode 100644
index 0000000000..c5ee41c813
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetExtAddrSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_SET_EXT_ADDR.
+ *
+ * This command is used to set the extended address of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysSetExtAddrSreq extends ZstackFrameRequest {
+
+ /**
+ * The device’s extended address.
+ */
+ private IeeeAddress extAddress;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysSetExtAddrSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The device’s extended address.
+ *
+ * @return the current extAddress as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtAddress() {
+ return extAddress;
+ }
+
+ /**
+ * The device’s extended address.
+ *
+ * @param extAddress the ExtAddress to set as {@link IeeeAddress}
+ */
+ public void setExtAddress(IeeeAddress extAddress) {
+ this.extAddress = extAddress;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x03));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x03);
+
+ // Serialize the fields
+ serializer.serializeIeeeAddress(extAddress);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackSysSetExtAddrSreq [extAddress=");
+ builder.append(extAddress);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetExtAddrSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetExtAddrSrsp.java
new file mode 100644
index 0000000000..ecc48af616
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetExtAddrSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_SET_EXT_ADDR.
+ *
+ * This command is used to set the extended address of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysSetExtAddrSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (1) or Failure (0)
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysSetExtAddrSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (1) or Failure (0)
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (1) or Failure (0)
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackSysSetExtAddrSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetTxPowerSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetTxPowerSreq.java
new file mode 100644
index 0000000000..202deb6af0
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetTxPowerSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_SET_TX_POWER.
+ *
+ * This command is used by the tester to set the target system radio transmit power. The returned TX power is the actual setting
+ * applied to the radio – nearest characterized value for the specific radio.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysSetTxPowerSreq extends ZstackFrameRequest {
+
+ /**
+ * Requested TX power setting, in dBm.
+ */
+ private int txPower;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysSetTxPowerSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Requested TX power setting, in dBm.
+ *
+ * @return the current txPower as {@link int}
+ */
+ public int getTxPower() {
+ return txPower;
+ }
+
+ /**
+ * Requested TX power setting, in dBm.
+ *
+ * @param txPower the TxPower to set as {@link int}
+ */
+ public void setTxPower(int txPower) {
+ this.txPower = txPower;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x14));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x14);
+
+ // Serialize the fields
+ serializer.serializeUInt8(txPower);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackSysSetTxPowerSreq [txPower=");
+ builder.append(txPower);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetTxPowerSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetTxPowerSrsp.java
new file mode 100644
index 0000000000..17be7820a4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysSetTxPowerSrsp.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_SET_TX_POWER.
+ *
+ * This command is used by the tester to set the target system radio transmit power. The returned TX power is the actual setting
+ * applied to the radio – nearest characterized value for the specific radio.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysSetTxPowerSrsp extends ZstackFrameResponse {
+
+ /**
+ * Staus is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysSetTxPowerSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Staus is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Staus is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackSysSetTxPowerSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysVersionSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysVersionSreq.java
new file mode 100644
index 0000000000..aa66cd2d12
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysVersionSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_VERSION.
+ *
+ * This command issues PING requests to verify if a device is active and check the capability of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysVersionSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysVersionSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x02));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x02);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackSysVersionSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysVersionSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysVersionSrsp.java
new file mode 100644
index 0000000000..f443257479
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysVersionSrsp.java
@@ -0,0 +1,172 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_VERSION.
+ *
+ * This command issues PING requests to verify if a device is active and check the capability of the device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysVersionSrsp extends ZstackFrameResponse {
+
+ /**
+ * Transport protocol revision
+ */
+ private int transportRev;
+
+ /**
+ * Product Id
+ */
+ private int product;
+
+ /**
+ * Software major release number
+ */
+ private int majorRel;
+
+ /**
+ * Software minor release number
+ */
+ private int minorRel;
+
+ /**
+ * Software maintenance release number
+ */
+ private int maintRel;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysVersionSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ transportRev = deserializer.deserializeUInt8();
+ product = deserializer.deserializeUInt8();
+ majorRel = deserializer.deserializeUInt8();
+ minorRel = deserializer.deserializeUInt8();
+ maintRel = deserializer.deserializeUInt8();
+ }
+
+ /**
+ * Transport protocol revision
+ *
+ * @return the current transportRev as {@link int}
+ */
+ public int getTransportRev() {
+ return transportRev;
+ }
+
+ /**
+ * Transport protocol revision
+ *
+ * @param transportRev the TransportRev to set as {@link int}
+ */
+ public void setTransportRev(int transportRev) {
+ this.transportRev = transportRev;
+ }
+
+ /**
+ * Product Id
+ *
+ * @return the current product as {@link int}
+ */
+ public int getProduct() {
+ return product;
+ }
+
+ /**
+ * Product Id
+ *
+ * @param product the Product to set as {@link int}
+ */
+ public void setProduct(int product) {
+ this.product = product;
+ }
+
+ /**
+ * Software major release number
+ *
+ * @return the current majorRel as {@link int}
+ */
+ public int getMajorRel() {
+ return majorRel;
+ }
+
+ /**
+ * Software major release number
+ *
+ * @param majorRel the MajorRel to set as {@link int}
+ */
+ public void setMajorRel(int majorRel) {
+ this.majorRel = majorRel;
+ }
+
+ /**
+ * Software minor release number
+ *
+ * @return the current minorRel as {@link int}
+ */
+ public int getMinorRel() {
+ return minorRel;
+ }
+
+ /**
+ * Software minor release number
+ *
+ * @param minorRel the MinorRel to set as {@link int}
+ */
+ public void setMinorRel(int minorRel) {
+ this.minorRel = minorRel;
+ }
+
+ /**
+ * Software maintenance release number
+ *
+ * @return the current maintRel as {@link int}
+ */
+ public int getMaintRel() {
+ return maintRel;
+ }
+
+ /**
+ * Software maintenance release number
+ *
+ * @param maintRel the MaintRel to set as {@link int}
+ */
+ public void setMaintRel(int maintRel) {
+ this.maintRel = maintRel;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(148);
+ builder.append("ZstackSysVersionSrsp [transportRev=");
+ builder.append(transportRev);
+ builder.append(", product=");
+ builder.append(product);
+ builder.append(", majorRel=");
+ builder.append(majorRel);
+ builder.append(", minorRel=");
+ builder.append(minorRel);
+ builder.append(", maintRel=");
+ builder.append(maintRel);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsClearStatsSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsClearStatsSreq.java
new file mode 100644
index 0000000000..6ca2be8786
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsClearStatsSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_CLEAR_STATS.
+ *
+ * This command is used to clear the statistics table. To clear data in NV (including the Boot Counter) the clearNV flag shall be set
+ * to TRUE.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsClearStatsSreq extends ZstackFrameRequest {
+
+ /**
+ * TRUE – Clears statistics in NV memory including Boot Counter. FALSE – Clears statistics in RAM only. Boot Counter is preserved.
+ */
+ private boolean clearNv;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysZdiagsClearStatsSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * TRUE – Clears statistics in NV memory including Boot Counter. FALSE – Clears statistics in RAM only. Boot Counter is preserved.
+ *
+ * @return the current clearNv as {@link boolean}
+ */
+ public boolean getClearNV() {
+ return clearNv;
+ }
+
+ /**
+ * TRUE – Clears statistics in NV memory including Boot Counter. FALSE – Clears statistics in RAM only. Boot Counter is preserved.
+ *
+ * @param clearNv the clearNV to set as {@link boolean}
+ */
+ public void setClearNV(boolean clearNv) {
+ this.clearNv = clearNv;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x18));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x18);
+
+ // Serialize the fields
+ serializer.serializeBoolean(clearNv);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(57);
+ builder.append("ZstackSysZdiagsClearStatsSreq [clearNv=");
+ builder.append(clearNv);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsClearStatsSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsClearStatsSrsp.java
new file mode 100644
index 0000000000..1ef77fa0f4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsClearStatsSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_CLEAR_STATS.
+ *
+ * This command is used to clear the statistics table. To clear data in NV (including the Boot Counter) the clearNV flag shall be set
+ * to TRUE.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsClearStatsSrsp extends ZstackFrameResponse {
+
+ /**
+ * Milliseconds since last reset.
+ */
+ private int sysClock;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysZdiagsClearStatsSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ sysClock = deserializer.deserializeUInt32();
+ }
+
+ /**
+ * Milliseconds since last reset.
+ *
+ * @return the current sysClock as {@link int}
+ */
+ public int getSysClock() {
+ return sysClock;
+ }
+
+ /**
+ * Milliseconds since last reset.
+ *
+ * @param sysClock the SysClock to set as {@link int}
+ */
+ public void setSysClock(int sysClock) {
+ this.sysClock = sysClock;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(57);
+ builder.append("ZstackSysZdiagsClearStatsSrsp [sysClock=");
+ builder.append(sysClock);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsGetStatsSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsGetStatsSreq.java
new file mode 100644
index 0000000000..36eaa9609d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsGetStatsSreq.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_GET_STATS.
+ *
+ * This command is used to read a specific system (attribute) ID statistics and/or metrics value.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsGetStatsSreq extends ZstackFrameRequest {
+
+ /**
+ * System Diagnostics (ZDiags) attribute ID, as defined in ZDiags.h module.
+ */
+ private ZstackDiagnosticAttribute attributeId;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysZdiagsGetStatsSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * System Diagnostics (ZDiags) attribute ID, as defined in ZDiags.h module.
+ *
+ * @return the current attributeId as {@link ZstackDiagnosticAttribute}
+ */
+ public ZstackDiagnosticAttribute getAttributeID() {
+ return attributeId;
+ }
+
+ /**
+ * System Diagnostics (ZDiags) attribute ID, as defined in ZDiags.h module.
+ *
+ * @param attributeId the AttributeID to set as {@link ZstackDiagnosticAttribute}
+ */
+ public void setAttributeID(ZstackDiagnosticAttribute attributeId) {
+ this.attributeId = attributeId;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x19));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x19);
+
+ // Serialize the fields
+ serializer.serializeUInt16(attributeId.getKey());
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(55);
+ builder.append("ZstackSysZdiagsGetStatsSreq [attributeId=");
+ builder.append(attributeId);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsGetStatsSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsGetStatsSrsp.java
new file mode 100644
index 0000000000..e676c801fb
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsGetStatsSrsp.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_GET_STATS.
+ *
+ * This command is used to read a specific system (attribute) ID statistics and/or metrics value.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsGetStatsSrsp extends ZstackFrameResponse {
+
+ /**
+ * Value of the requested attribute.
+ */
+ private int attributeValue;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysZdiagsGetStatsSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ attributeValue = deserializer.deserializeUInt32();
+ }
+
+ /**
+ * Value of the requested attribute.
+ *
+ * @return the current attributeValue as {@link int}
+ */
+ public int getAttributeValue() {
+ return attributeValue;
+ }
+
+ /**
+ * Value of the requested attribute.
+ *
+ * @param attributeValue the AttributeValue to set as {@link int}
+ */
+ public void setAttributeValue(int attributeValue) {
+ this.attributeValue = attributeValue;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(55);
+ builder.append("ZstackSysZdiagsGetStatsSrsp [attributeValue=");
+ builder.append(attributeValue);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsInitStatsSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsInitStatsSreq.java
new file mode 100644
index 0000000000..217e821b34
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsInitStatsSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_INIT_STATS.
+ *
+ * This command is used to initialize the statistics table in NV memory.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsInitStatsSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysZdiagsInitStatsSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x17));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x17);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackSysZdiagsInitStatsSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsInitStatsSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsInitStatsSrsp.java
new file mode 100644
index 0000000000..86a2d05803
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsInitStatsSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_INIT_STATS.
+ *
+ * This command is used to initialize the statistics table in NV memory.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsInitStatsSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysZdiagsInitStatsSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(56);
+ builder.append("ZstackSysZdiagsInitStatsSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsRestoreStatsNvSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsRestoreStatsNvSreq.java
new file mode 100644
index 0000000000..ba276ecb9d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsRestoreStatsNvSreq.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_RESTORE_STATS_NV.
+ *
+ * This command is used to restore the statistics table from NV into the RAM table.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsRestoreStatsNvSreq extends ZstackFrameRequest {
+
+ /**
+ * System Diagnostics (ZDiags) attribute ID, as defined in ZDiags.h module.
+ */
+ private ZstackDiagnosticAttribute attributeId;
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysZdiagsRestoreStatsNvSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * System Diagnostics (ZDiags) attribute ID, as defined in ZDiags.h module.
+ *
+ * @return the current attributeId as {@link ZstackDiagnosticAttribute}
+ */
+ public ZstackDiagnosticAttribute getAttributeID() {
+ return attributeId;
+ }
+
+ /**
+ * System Diagnostics (ZDiags) attribute ID, as defined in ZDiags.h module.
+ *
+ * @param attributeId the AttributeID to set as {@link ZstackDiagnosticAttribute}
+ */
+ public void setAttributeID(ZstackDiagnosticAttribute attributeId) {
+ this.attributeId = attributeId;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x1A));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x1A);
+
+ // Serialize the fields
+ serializer.serializeUInt16(attributeId.getKey());
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(61);
+ builder.append("ZstackSysZdiagsRestoreStatsNvSreq [attributeId=");
+ builder.append(attributeId);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsRestoreStatsNvSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsRestoreStatsNvSrsp.java
new file mode 100644
index 0000000000..a6591d213d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsRestoreStatsNvSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_RESTORE_STATS_NV.
+ *
+ * This command is used to restore the statistics table from NV into the RAM table.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsRestoreStatsNvSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysZdiagsRestoreStatsNvSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(61);
+ builder.append("ZstackSysZdiagsRestoreStatsNvSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsSaveStatsToNvSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsSaveStatsToNvSreq.java
new file mode 100644
index 0000000000..56ab2a8038
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsSaveStatsToNvSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_SAVE_STATS_TO_NV.
+ *
+ * This command is used to save the statistics table from RAM to NV.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsSaveStatsToNvSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackSysZdiagsSaveStatsToNvSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_SYS) && (response.getReqCmd1() == 0x1B));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_SYS, 0x1B);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackSysZdiagsSaveStatsToNvSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsSaveStatsToNvSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsSaveStatsToNvSrsp.java
new file mode 100644
index 0000000000..bff97ff3ff
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSysZdiagsSaveStatsToNvSrsp.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command SYS_ZDIAGS_SAVE_STATS_TO_NV.
+ *
+ * This command is used to save the statistics table from RAM to NV.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackSysZdiagsSaveStatsToNvSrsp extends ZstackFrameResponse {
+
+ /**
+ * Milliseconds since last reset.
+ */
+ private int sysClock;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackSysZdiagsSaveStatsToNvSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ sysClock = deserializer.deserializeUInt32();
+ }
+
+ /**
+ * Milliseconds since last reset.
+ *
+ * @return the current sysClock as {@link int}
+ */
+ public int getSysClock() {
+ return sysClock;
+ }
+
+ /**
+ * Milliseconds since last reset.
+ *
+ * @param sysClock the SysClock to set as {@link int}
+ */
+ public void setSysClock(int sysClock) {
+ this.sysClock = sysClock;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(60);
+ builder.append("ZstackSysZdiagsSaveStatsToNvSrsp [sysClock=");
+ builder.append(sysClock);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSystemCapabilities.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSystemCapabilities.java
new file mode 100644
index 0000000000..a7f24914be
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/sys/ZstackSystemCapabilities.java
@@ -0,0 +1,119 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.sys;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Class to implement the Z-Stack Enumeration ZstackSystemCapabilities.
+ *
+ * Subsystem capabilities bitmap
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackSystemCapabilities {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ *
+ */
+ MT_CAP_SYS(0x0001),
+
+ /**
+ *
+ */
+ MT_CAP_MAC(0x0002),
+
+ /**
+ *
+ */
+ MT_CAP_NWK(0x0004),
+
+ /**
+ *
+ */
+ MT_CAP_AF(0x0008),
+
+ /**
+ *
+ */
+ MT_CAP_ZDO(0x0010),
+
+ /**
+ *
+ */
+ MT_CAP_SAPI(0x0020),
+
+ /**
+ *
+ */
+ MT_CAP_UTIL(0x0040),
+
+ /**
+ *
+ */
+ MT_CAP_DEBUG(0x0080),
+
+ /**
+ *
+ */
+ MT_CAP_APP(0x0100),
+
+ /**
+ *
+ */
+ MT_CAP_ZOAD(0x1000);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson
+ */
+public enum ZstackZdoState {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * Initialized - not started automatically
+ */
+ DEV_HOLD(0x0000),
+
+ /**
+ * Initialized - not connected to anything
+ */
+ DEV_INIT(0x0001),
+
+ /**
+ * Discovering PAN's to join
+ */
+ DEV_NWK_DISC(0x0002),
+
+ /**
+ * Joining a PAN
+ */
+ DEV_NWK_JOINING(0x0003),
+
+ /**
+ * ReJoining a PAN, only for end devices
+ */
+ DEV_NWK_REJOIN(0x0004),
+
+ /**
+ * Joined but not yet authenticated by trust center
+ */
+ DEV_END_DEVICE_UNAUTH(0x0005),
+
+ /**
+ * Started as device after authentication
+ */
+ DEV_END_DEVICE(0x0006),
+
+ /**
+ * Device joined, authenticated and is a router
+ */
+ DEV_ROUTER(0x0007),
+
+ /**
+ * Starting as Zigbee Coordinator
+ */
+ DEV_COORD_STARTING(0x0008),
+
+ /**
+ * Started as Zigbee Coordinator
+ */
+ DEV_ZB_COORD(0x0009),
+
+ /**
+ * Device has lost information about its parent
+ */
+ DEV_NWK_ORPHAN(0x000A);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * This command retrieves APS link key data, Tx and Rx frame counters.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilApsmeLinkKeyDataGetSreq extends ZstackFrameRequest {
+
+ /**
+ * The extended address for which to get the link key data.
+ */
+ private IeeeAddress extAddr;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilApsmeLinkKeyDataGetSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The extended address for which to get the link key data.
+ *
+ * @return the current extAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtAddr() {
+ return extAddr;
+ }
+
+ /**
+ * The extended address for which to get the link key data.
+ *
+ * @param extAddr the ExtAddr to set as {@link IeeeAddress}
+ */
+ public void setExtAddr(IeeeAddress extAddr) {
+ this.extAddr = extAddr;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x44));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x44);
+
+ // Serialize the fields
+ serializer.serializeIeeeAddress(extAddr);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(61);
+ builder.append("ZstackUtilApsmeLinkKeyDataGetSreq [extAddr=");
+ builder.append(extAddr);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyDataGetSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyDataGetSrsp.java
new file mode 100644
index 0000000000..f8a7bcef95
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyDataGetSrsp.java
@@ -0,0 +1,148 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import com.zsmartsystems.zigbee.security.ZigBeeKey;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_APSME_LINK_KEY_DATA_GET.
+ *
+ * This command retrieves APS link key data, Tx and Rx frame counters.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilApsmeLinkKeyDataGetSrsp extends ZstackFrameResponse {
+
+ /**
+ * The ZStatus_t returned by the proxy call to APSME_LinkKeyNVIdGet().
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * On success, the security key looked up; otherwise N/A.
+ */
+ private ZigBeeKey secKey;
+
+ /**
+ * On success, the TX frame counter; otherwise N/A.
+ */
+ private int txFrmCntr;
+
+ /**
+ * On success, the RX frame counter; otherwise N/A.
+ */
+ private int rxFrmCntr;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilApsmeLinkKeyDataGetSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ secKey = deserializer.deserializeZigBeeKey();
+ txFrmCntr = deserializer.deserializeUInt32();
+ rxFrmCntr = deserializer.deserializeUInt32();
+ }
+
+ /**
+ * The ZStatus_t returned by the proxy call to APSME_LinkKeyNVIdGet().
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * The ZStatus_t returned by the proxy call to APSME_LinkKeyNVIdGet().
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * On success, the security key looked up; otherwise N/A.
+ *
+ * @return the current secKey as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getSecKey() {
+ return secKey;
+ }
+
+ /**
+ * On success, the security key looked up; otherwise N/A.
+ *
+ * @param secKey the SecKey to set as {@link ZigBeeKey}
+ */
+ public void setSecKey(ZigBeeKey secKey) {
+ this.secKey = secKey;
+ }
+
+ /**
+ * On success, the TX frame counter; otherwise N/A.
+ *
+ * @return the current txFrmCntr as {@link int}
+ */
+ public int getTxFrmCntr() {
+ return txFrmCntr;
+ }
+
+ /**
+ * On success, the TX frame counter; otherwise N/A.
+ *
+ * @param txFrmCntr the TxFrmCntr to set as {@link int}
+ */
+ public void setTxFrmCntr(int txFrmCntr) {
+ this.txFrmCntr = txFrmCntr;
+ }
+
+ /**
+ * On success, the RX frame counter; otherwise N/A.
+ *
+ * @return the current rxFrmCntr as {@link int}
+ */
+ public int getRxFrmCntr() {
+ return rxFrmCntr;
+ }
+
+ /**
+ * On success, the RX frame counter; otherwise N/A.
+ *
+ * @param rxFrmCntr the RxFrmCntr to set as {@link int}
+ */
+ public void setRxFrmCntr(int rxFrmCntr) {
+ this.rxFrmCntr = rxFrmCntr;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(136);
+ builder.append("ZstackUtilApsmeLinkKeyDataGetSrsp [status=");
+ builder.append(status);
+ builder.append(", secKey=");
+ builder.append(secKey);
+ builder.append(", txFrmCntr=");
+ builder.append(String.format("%08X", txFrmCntr));
+ builder.append(", rxFrmCntr=");
+ builder.append(String.format("%08X", rxFrmCntr));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyNvIdGetSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyNvIdGetSreq.java
new file mode 100644
index 0000000000..61751a1a01
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyNvIdGetSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_APSME_LINK_KEY_NV_ID_GET.
+ *
+ * This command is a proxy call to the APSME_LinkKeyNvIdGet() function.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilApsmeLinkKeyNvIdGetSreq extends ZstackFrameRequest {
+
+ /**
+ * The extended address for which to get the link key NV Id.
+ */
+ private IeeeAddress extAddr;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilApsmeLinkKeyNvIdGetSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The extended address for which to get the link key NV Id.
+ *
+ * @return the current extAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtAddr() {
+ return extAddr;
+ }
+
+ /**
+ * The extended address for which to get the link key NV Id.
+ *
+ * @param extAddr the ExtAddr to set as {@link IeeeAddress}
+ */
+ public void setExtAddr(IeeeAddress extAddr) {
+ this.extAddr = extAddr;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x45));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x45);
+
+ // Serialize the fields
+ serializer.serializeIeeeAddress(extAddr);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(61);
+ builder.append("ZstackUtilApsmeLinkKeyNvIdGetSreq [extAddr=");
+ builder.append(extAddr);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyNvIdGetSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyNvIdGetSrsp.java
new file mode 100644
index 0000000000..d4d97a1fdc
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilApsmeLinkKeyNvIdGetSrsp.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_APSME_LINK_KEY_NV_ID_GET.
+ *
+ * This command is a proxy call to the APSME_LinkKeyNvIdGet() function.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilApsmeLinkKeyNvIdGetSrsp extends ZstackFrameResponse {
+
+ /**
+ * The ZStatus_t returned by the proxy call to APSME_LinkKeyNVIdGet().
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * On success, link key NV ID. Otherwise 0xFFFF
+ */
+ private int linkKeyNvId;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilApsmeLinkKeyNvIdGetSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ linkKeyNvId = deserializer.deserializeUInt16();
+ }
+
+ /**
+ * The ZStatus_t returned by the proxy call to APSME_LinkKeyNVIdGet().
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * The ZStatus_t returned by the proxy call to APSME_LinkKeyNVIdGet().
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * On success, link key NV ID. Otherwise 0xFFFF
+ *
+ * @return the current linkKeyNvId as {@link int}
+ */
+ public int getLinkKeyNvId() {
+ return linkKeyNvId;
+ }
+
+ /**
+ * On success, link key NV ID. Otherwise 0xFFFF
+ *
+ * @param linkKeyNvId the LinkKeyNvId to set as {@link int}
+ */
+ public void setLinkKeyNvId(int linkKeyNvId) {
+ this.linkKeyNvId = linkKeyNvId;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(86);
+ builder.append("ZstackUtilApsmeLinkKeyNvIdGetSrsp [status=");
+ builder.append(status);
+ builder.append(", linkKeyNvId=");
+ builder.append(linkKeyNvId);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetDeviceInfoSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetDeviceInfoSreq.java
new file mode 100644
index 0000000000..8f8696dfe5
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetDeviceInfoSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_GET_DEVICE_INFO.
+ *
+ * This command is used to retrieve the device info.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilGetDeviceInfoSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilGetDeviceInfoSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x00));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x00);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackUtilGetDeviceInfoSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetDeviceInfoSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetDeviceInfoSrsp.java
new file mode 100644
index 0000000000..bd2cacd6ad
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetDeviceInfoSrsp.java
@@ -0,0 +1,213 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackZdoState;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_GET_DEVICE_INFO.
+ *
+ * This command is used to retrieve the device info.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilGetDeviceInfoSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is a one byte field and is either success(0) or fail(1). The fail status is returned if the address value in the command
+ * message was not within the valid range.
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * IEEE address of the device.
+ */
+ private IeeeAddress ieeeAddress;
+
+ /**
+ * Short address of the device.
+ */
+ private int shortAddr;
+
+ /**
+ * Indicates device type, where bits 0 to 2 indicate the capability for the device to operate as a coordinator, router, or end
+ * device, respectively.
+ */
+ private int deviceType;
+
+ /**
+ * Indicates the state of the device.
+ */
+ private ZstackZdoState deviceState;
+
+ /**
+ * Array of 16-bits specifies the network address associated with the device.
+ */
+ private int[] assocDevicesList;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilGetDeviceInfoSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ ieeeAddress = deserializer.deserializeIeeeAddress();
+ shortAddr = deserializer.deserializeUInt16();
+ deviceType = deserializer.deserializeUInt8();
+ deviceState = ZstackZdoState.valueOf(deserializer.deserializeUInt8());
+ int numAssocDevices = deserializer.deserializeUInt8();
+ assocDevicesList = deserializer.deserializeUInt16Array(numAssocDevices);
+ }
+
+ /**
+ * Status is a one byte field and is either success(0) or fail(1). The fail status is returned if the address value in the command
+ * message was not within the valid range.
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is a one byte field and is either success(0) or fail(1). The fail status is returned if the address value in the command
+ * message was not within the valid range.
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * IEEE address of the device.
+ *
+ * @return the current ieeeAddress as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddress() {
+ return ieeeAddress;
+ }
+
+ /**
+ * IEEE address of the device.
+ *
+ * @param ieeeAddress the IeeeAddress to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddress(IeeeAddress ieeeAddress) {
+ this.ieeeAddress = ieeeAddress;
+ }
+
+ /**
+ * Short address of the device.
+ *
+ * @return the current shortAddr as {@link int}
+ */
+ public int getShortAddr() {
+ return shortAddr;
+ }
+
+ /**
+ * Short address of the device.
+ *
+ * @param shortAddr the ShortAddr to set as {@link int}
+ */
+ public void setShortAddr(int shortAddr) {
+ this.shortAddr = shortAddr;
+ }
+
+ /**
+ * Indicates device type, where bits 0 to 2 indicate the capability for the device to operate as a coordinator, router, or end
+ * device, respectively.
+ *
+ * @return the current deviceType as {@link int}
+ */
+ public int getDeviceType() {
+ return deviceType;
+ }
+
+ /**
+ * Indicates device type, where bits 0 to 2 indicate the capability for the device to operate as a coordinator, router, or end
+ * device, respectively.
+ *
+ * @param deviceType the DeviceType to set as {@link int}
+ */
+ public void setDeviceType(int deviceType) {
+ this.deviceType = deviceType;
+ }
+
+ /**
+ * Indicates the state of the device.
+ *
+ * @return the current deviceState as {@link ZstackZdoState}
+ */
+ public ZstackZdoState getDeviceState() {
+ return deviceState;
+ }
+
+ /**
+ * Indicates the state of the device.
+ *
+ * @param deviceState the DeviceState to set as {@link ZstackZdoState}
+ */
+ public void setDeviceState(ZstackZdoState deviceState) {
+ this.deviceState = deviceState;
+ }
+
+ /**
+ * Array of 16-bits specifies the network address associated with the device.
+ *
+ * @return the current assocDevicesList as {@link int[]}
+ */
+ public int[] getAssocDevicesList() {
+ return assocDevicesList;
+ }
+
+ /**
+ * Array of 16-bits specifies the network address associated with the device.
+ *
+ * @param assocDevicesList the AssocDevicesList to set as {@link int[]}
+ */
+ public void setAssocDevicesList(int[] assocDevicesList) {
+ this.assocDevicesList = assocDevicesList;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(205);
+ builder.append("ZstackUtilGetDeviceInfoSrsp [status=");
+ builder.append(status);
+ builder.append(", ieeeAddress=");
+ builder.append(ieeeAddress);
+ builder.append(", shortAddr=");
+ builder.append(String.format("%04X", shortAddr));
+ builder.append(", deviceType=");
+ builder.append(deviceType);
+ builder.append(", deviceState=");
+ builder.append(deviceState);
+ builder.append(", assocDevicesList=");
+ for (int c = 0; c < assocDevicesList.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", assocDevicesList[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetNvInfoSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetNvInfoSreq.java
new file mode 100644
index 0000000000..397a951638
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetNvInfoSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_GET_NV_INFO.
+ *
+ * This command is used to read a block of parameters from non-volatile storage of the target device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilGetNvInfoSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilGetNvInfoSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x01));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x01);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackUtilGetNvInfoSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetNvInfoSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetNvInfoSrsp.java
new file mode 100644
index 0000000000..a1c7a7e3d1
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilGetNvInfoSrsp.java
@@ -0,0 +1,206 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.security.ZigBeeKey;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_GET_NV_INFO.
+ *
+ * This command is used to read a block of parameters from non-volatile storage of the target device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilGetNvInfoSrsp extends ZstackFrameResponse {
+
+ /**
+ * A value of zero indicates success. Failure is indicated by a non-zero value, representing a bit mask of each item that failed to be
+ * retrieved from NV memory. Bit0 is used for the first item (IEEEAddress), bit1 for the second item (ScanChannels), and so forth.
+ * Data values for failed items are returned as one or more bytes of 0xFF, the typical value read from erased NV memory.
+ */
+ private int status;
+
+ /**
+ * IEEE address of the device.
+ */
+ private IeeeAddress ieeeAddress;
+
+ /**
+ * This represents a bit-mask of channels to be scanned when starting the device.
+ */
+ private int scanChannels;
+
+ /**
+ * Specifies the Pan Id to start or join. Set to 0xFFFF to select a PAN after scanning.
+ */
+ private int panId;
+
+ /**
+ * This specifies the network messaging security level, zero disables security.
+ */
+ private int securityLevel;
+
+ /**
+ * This specifies the pre-configured security key.
+ */
+ private ZigBeeKey preConfigKey;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilGetNvInfoSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = deserializer.deserializeUInt8();
+ ieeeAddress = deserializer.deserializeIeeeAddress();
+ scanChannels = deserializer.deserializeUInt32();
+ panId = deserializer.deserializeUInt16();
+ securityLevel = deserializer.deserializeUInt8();
+ preConfigKey = deserializer.deserializeZigBeeKey();
+ }
+
+ /**
+ * A value of zero indicates success. Failure is indicated by a non-zero value, representing a bit mask of each item that failed to be
+ * retrieved from NV memory. Bit0 is used for the first item (IEEEAddress), bit1 for the second item (ScanChannels), and so forth.
+ * Data values for failed items are returned as one or more bytes of 0xFF, the typical value read from erased NV memory.
+ *
+ * @return the current status as {@link int}
+ */
+ public int getStatus() {
+ return status;
+ }
+
+ /**
+ * A value of zero indicates success. Failure is indicated by a non-zero value, representing a bit mask of each item that failed to be
+ * retrieved from NV memory. Bit0 is used for the first item (IEEEAddress), bit1 for the second item (ScanChannels), and so forth.
+ * Data values for failed items are returned as one or more bytes of 0xFF, the typical value read from erased NV memory.
+ *
+ * @param status the Status to set as {@link int}
+ */
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ /**
+ * IEEE address of the device.
+ *
+ * @return the current ieeeAddress as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddress() {
+ return ieeeAddress;
+ }
+
+ /**
+ * IEEE address of the device.
+ *
+ * @param ieeeAddress the IeeeAddress to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddress(IeeeAddress ieeeAddress) {
+ this.ieeeAddress = ieeeAddress;
+ }
+
+ /**
+ * This represents a bit-mask of channels to be scanned when starting the device.
+ *
+ * @return the current scanChannels as {@link int}
+ */
+ public int getScanChannels() {
+ return scanChannels;
+ }
+
+ /**
+ * This represents a bit-mask of channels to be scanned when starting the device.
+ *
+ * @param scanChannels the ScanChannels to set as {@link int}
+ */
+ public void setScanChannels(int scanChannels) {
+ this.scanChannels = scanChannels;
+ }
+
+ /**
+ * Specifies the Pan Id to start or join. Set to 0xFFFF to select a PAN after scanning.
+ *
+ * @return the current panId as {@link int}
+ */
+ public int getPanId() {
+ return panId;
+ }
+
+ /**
+ * Specifies the Pan Id to start or join. Set to 0xFFFF to select a PAN after scanning.
+ *
+ * @param panId the PanId to set as {@link int}
+ */
+ public void setPanId(int panId) {
+ this.panId = panId;
+ }
+
+ /**
+ * This specifies the network messaging security level, zero disables security.
+ *
+ * @return the current securityLevel as {@link int}
+ */
+ public int getSecurityLevel() {
+ return securityLevel;
+ }
+
+ /**
+ * This specifies the network messaging security level, zero disables security.
+ *
+ * @param securityLevel the SecurityLevel to set as {@link int}
+ */
+ public void setSecurityLevel(int securityLevel) {
+ this.securityLevel = securityLevel;
+ }
+
+ /**
+ * This specifies the pre-configured security key.
+ *
+ * @return the current preConfigKey as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getPreConfigKey() {
+ return preConfigKey;
+ }
+
+ /**
+ * This specifies the pre-configured security key.
+ *
+ * @param preConfigKey the PreConfigKey to set as {@link ZigBeeKey}
+ */
+ public void setPreConfigKey(ZigBeeKey preConfigKey) {
+ this.preConfigKey = preConfigKey;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(176);
+ builder.append("ZstackUtilGetNvInfoSrsp [status=");
+ builder.append(status);
+ builder.append(", ieeeAddress=");
+ builder.append(ieeeAddress);
+ builder.append(", scanChannels=");
+ builder.append(scanChannels);
+ builder.append(", panId=");
+ builder.append(String.format("%04X", panId));
+ builder.append(", securityLevel=");
+ builder.append(securityLevel);
+ builder.append(", preConfigKey=");
+ builder.append(preConfigKey);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilLedControlSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilLedControlSreq.java
new file mode 100644
index 0000000000..f8ee89812e
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilLedControlSreq.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_LED_CONTROL.
+ *
+ * This command is used by the tester to control the LEDs on the board.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilLedControlSreq extends ZstackFrameRequest {
+
+ /**
+ * The LED number.
+ */
+ private int ledId;
+
+ /**
+ * 0: OFF, 1: ON.
+ */
+ private boolean mode;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilLedControlSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * The LED number.
+ *
+ * @return the current ledId as {@link int}
+ */
+ public int getLedId() {
+ return ledId;
+ }
+
+ /**
+ * The LED number.
+ *
+ * @param ledId the LedId to set as {@link int}
+ */
+ public void setLedId(int ledId) {
+ this.ledId = ledId;
+ }
+
+ /**
+ * 0: OFF, 1: ON.
+ *
+ * @return the current mode as {@link boolean}
+ */
+ public boolean getMode() {
+ return mode;
+ }
+
+ /**
+ * 0: OFF, 1: ON.
+ *
+ * @param mode the Mode to set as {@link boolean}
+ */
+ public void setMode(boolean mode) {
+ this.mode = mode;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x09));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x09);
+
+ // Serialize the fields
+ serializer.serializeUInt8(ledId);
+ serializer.serializeBoolean(mode);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(77);
+ builder.append("ZstackUtilLedControlSreq [ledId=");
+ builder.append(ledId);
+ builder.append(", mode=");
+ builder.append(mode);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilLedControlSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilLedControlSrsp.java
new file mode 100644
index 0000000000..5ed5e20c57
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilLedControlSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_LED_CONTROL.
+ *
+ * This command is used by the tester to control the LEDs on the board.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilLedControlSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilLedControlSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(52);
+ builder.append("ZstackUtilLedControlSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetChannelsSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetChannelsSreq.java
new file mode 100644
index 0000000000..593828f5c1
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetChannelsSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_CHANNELS.
+ *
+ * This command is used to store a channel select bit-mask into Non-Volatile memory to be used the next time the target device
+ * resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetChannelsSreq extends ZstackFrameRequest {
+
+ /**
+ * A bit-mask representing the channel(s) to scan the next time the target device resets.
+ */
+ private int channels;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilSetChannelsSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * A bit-mask representing the channel(s) to scan the next time the target device resets.
+ *
+ * @return the current channels as {@link int}
+ */
+ public int getChannels() {
+ return channels;
+ }
+
+ /**
+ * A bit-mask representing the channel(s) to scan the next time the target device resets.
+ *
+ * @param channels the Channels to set as {@link int}
+ */
+ public void setChannels(int channels) {
+ this.channels = channels;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x03));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x03);
+
+ // Serialize the fields
+ serializer.serializeUInt32(channels);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(53);
+ builder.append("ZstackUtilSetChannelsSreq [channels=");
+ builder.append(channels);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetChannelsSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetChannelsSrsp.java
new file mode 100644
index 0000000000..407968472c
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetChannelsSrsp.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_CHANNELS.
+ *
+ * This command is used to store a channel select bit-mask into Non-Volatile memory to be used the next time the target device
+ * resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetChannelsSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilSetChannelsSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(53);
+ builder.append("ZstackUtilSetChannelsSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPanidSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPanidSreq.java
new file mode 100644
index 0000000000..8db559b960
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPanidSreq.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_PANID.
+ *
+ * Store a PanId value into Non-Volatile memory to be used the next time the target device resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetPanidSreq extends ZstackFrameRequest {
+
+ /**
+ * PanId that will be set.
+ */
+ private int panId;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilSetPanidSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * PanId that will be set.
+ *
+ * @return the current panId as {@link int}
+ */
+ public int getPanId() {
+ return panId;
+ }
+
+ /**
+ * PanId that will be set.
+ *
+ * @param panId the PanId to set as {@link int}
+ */
+ public void setPanId(int panId) {
+ this.panId = panId;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x02));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x02);
+
+ // Serialize the fields
+ serializer.serializeUInt16(panId);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(50);
+ builder.append("ZstackUtilSetPanidSreq [panId=");
+ builder.append(String.format("%04X", panId));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPanidSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPanidSrsp.java
new file mode 100644
index 0000000000..e88a10fa17
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPanidSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_PANID.
+ *
+ * Store a PanId value into Non-Volatile memory to be used the next time the target device resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetPanidSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilSetPanidSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(50);
+ builder.append("ZstackUtilSetPanidSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPrecfgkeySreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPrecfgkeySreq.java
new file mode 100644
index 0000000000..6f9259db16
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPrecfgkeySreq.java
@@ -0,0 +1,80 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.security.ZigBeeKey;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_PRECFGKEY.
+ *
+ * This command is used to store a pre-configured key array into Non-Volatile memory to be used the next time the target device
+ * resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetPrecfgkeySreq extends ZstackFrameRequest {
+
+ /**
+ * An array representing the pre-configured key to use the next time the target device resets.
+ */
+ private ZigBeeKey preCfgKey;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilSetPrecfgkeySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * An array representing the pre-configured key to use the next time the target device resets.
+ *
+ * @return the current preCfgKey as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getPreCfgKey() {
+ return preCfgKey;
+ }
+
+ /**
+ * An array representing the pre-configured key to use the next time the target device resets.
+ *
+ * @param preCfgKey the PreCfgKey to set as {@link ZigBeeKey}
+ */
+ public void setPreCfgKey(ZigBeeKey preCfgKey) {
+ this.preCfgKey = preCfgKey;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x05));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x05);
+
+ // Serialize the fields
+ serializer.serializeZigBeeKey(preCfgKey);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(54);
+ builder.append("ZstackUtilSetPrecfgkeySreq [preCfgKey=");
+ builder.append(preCfgKey);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPrecfgkeySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPrecfgkeySrsp.java
new file mode 100644
index 0000000000..34ad7650a4
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetPrecfgkeySrsp.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_PRECFGKEY.
+ *
+ * This command is used to store a pre-configured key array into Non-Volatile memory to be used the next time the target device
+ * resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetPrecfgkeySrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilSetPrecfgkeySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(54);
+ builder.append("ZstackUtilSetPrecfgkeySrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetSeclevelSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetSeclevelSreq.java
new file mode 100644
index 0000000000..f0fa408118
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetSeclevelSreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_SECLEVEL.
+ *
+ * This command is used to store a channel select bit-mask into Non-Volatile memory to be used the next time the target device
+ * resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetSeclevelSreq extends ZstackFrameRequest {
+
+ /**
+ * Security level to use the next time the target device resets. Zero is used to disable security.
+ */
+ private int secLevel;
+
+ /**
+ * Request constructor
+ */
+ public ZstackUtilSetSeclevelSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Security level to use the next time the target device resets. Zero is used to disable security.
+ *
+ * @return the current secLevel as {@link int}
+ */
+ public int getSecLevel() {
+ return secLevel;
+ }
+
+ /**
+ * Security level to use the next time the target device resets. Zero is used to disable security.
+ *
+ * @param secLevel the SecLevel to set as {@link int}
+ */
+ public void setSecLevel(int secLevel) {
+ this.secLevel = secLevel;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_UTIL) && (response.getReqCmd1() == 0x04));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_UTIL, 0x04);
+
+ // Serialize the fields
+ serializer.serializeUInt8(secLevel);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(53);
+ builder.append("ZstackUtilSetSeclevelSreq [secLevel=");
+ builder.append(secLevel);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetSeclevelSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetSeclevelSrsp.java
new file mode 100644
index 0000000000..ca23f20958
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/util/ZstackUtilSetSeclevelSrsp.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.util;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command UTIL_SET_SECLEVEL.
+ *
+ * This command is used to store a channel select bit-mask into Non-Volatile memory to be used the next time the target device
+ * resets.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackUtilSetSeclevelSrsp extends ZstackFrameResponse {
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackUtilSetSeclevelSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Status is either Success (0) or Failure (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(53);
+ builder.append("ZstackUtilSetSeclevelSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoExtNwkInfoSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoExtNwkInfoSreq.java
new file mode 100644
index 0000000000..92875f84fb
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoExtNwkInfoSreq.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_EXT_NWK_INFO.
+ *
+ * Get the network info from the device
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoExtNwkInfoSreq extends ZstackFrameRequest {
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoExtNwkInfoSreq() {
+ synchronousCommand = true;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x50));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x50);
+
+ // Serialize the fields
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ return "ZstackZdoExtNwkInfoSreq []";
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoExtNwkInfoSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoExtNwkInfoSrsp.java
new file mode 100644
index 0000000000..e8595f0de6
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoExtNwkInfoSrsp.java
@@ -0,0 +1,226 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.ExtendedPanId;
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_EXT_NWK_INFO.
+ *
+ * Get the network info from the device
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoExtNwkInfoSrsp extends ZstackFrameResponse {
+
+ /**
+ * Short address
+ */
+ private int shortAddress;
+
+ /**
+ * Unknown field
+ */
+ private int padding;
+
+ /**
+ * Pan id
+ */
+ private int panId;
+
+ /**
+ * Parent address
+ */
+ private int parentAddress;
+
+ /**
+ * Extended pan id
+ */
+ private ExtendedPanId extendedPanId;
+
+ /**
+ * Extended parent address
+ */
+ private IeeeAddress extendedParentAddress;
+
+ /**
+ * Channel
+ */
+ private int channel;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoExtNwkInfoSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ shortAddress = deserializer.deserializeUInt16();
+ padding = deserializer.deserializeUInt8();
+ panId = deserializer.deserializeUInt16();
+ parentAddress = deserializer.deserializeUInt16();
+ extendedPanId = deserializer.deserializeExtendedPanId();
+ extendedParentAddress = deserializer.deserializeIeeeAddress();
+ channel = deserializer.deserializeUInt8();
+ }
+
+ /**
+ * Short address
+ *
+ * @return the current shortAddress as {@link int}
+ */
+ public int getShortAddress() {
+ return shortAddress;
+ }
+
+ /**
+ * Short address
+ *
+ * @param shortAddress the ShortAddress to set as {@link int}
+ */
+ public void setShortAddress(int shortAddress) {
+ this.shortAddress = shortAddress;
+ }
+
+ /**
+ * Unknown field
+ *
+ * @return the current padding as {@link int}
+ */
+ public int getPadding() {
+ return padding;
+ }
+
+ /**
+ * Unknown field
+ *
+ * @param padding the Padding to set as {@link int}
+ */
+ public void setPadding(int padding) {
+ this.padding = padding;
+ }
+
+ /**
+ * Pan id
+ *
+ * @return the current panId as {@link int}
+ */
+ public int getPanId() {
+ return panId;
+ }
+
+ /**
+ * Pan id
+ *
+ * @param panId the PanId to set as {@link int}
+ */
+ public void setPanId(int panId) {
+ this.panId = panId;
+ }
+
+ /**
+ * Parent address
+ *
+ * @return the current parentAddress as {@link int}
+ */
+ public int getParentAddress() {
+ return parentAddress;
+ }
+
+ /**
+ * Parent address
+ *
+ * @param parentAddress the ParentAddress to set as {@link int}
+ */
+ public void setParentAddress(int parentAddress) {
+ this.parentAddress = parentAddress;
+ }
+
+ /**
+ * Extended pan id
+ *
+ * @return the current extendedPanId as {@link ExtendedPanId}
+ */
+ public ExtendedPanId getExtendedPanId() {
+ return extendedPanId;
+ }
+
+ /**
+ * Extended pan id
+ *
+ * @param extendedPanId the ExtendedPanId to set as {@link ExtendedPanId}
+ */
+ public void setExtendedPanId(ExtendedPanId extendedPanId) {
+ this.extendedPanId = extendedPanId;
+ }
+
+ /**
+ * Extended parent address
+ *
+ * @return the current extendedParentAddress as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtendedParentAddress() {
+ return extendedParentAddress;
+ }
+
+ /**
+ * Extended parent address
+ *
+ * @param extendedParentAddress the ExtendedParentAddress to set as {@link IeeeAddress}
+ */
+ public void setExtendedParentAddress(IeeeAddress extendedParentAddress) {
+ this.extendedParentAddress = extendedParentAddress;
+ }
+
+ /**
+ * Channel
+ *
+ * @return the current channel as {@link int}
+ */
+ public int getChannel() {
+ return channel;
+ }
+
+ /**
+ * Channel
+ *
+ * @param channel the Channel to set as {@link int}
+ */
+ public void setChannel(int channel) {
+ this.channel = channel;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(201);
+ builder.append("ZstackZdoExtNwkInfoSrsp [shortAddress=");
+ builder.append(String.format("%02X", shortAddress));
+ builder.append(", padding=");
+ builder.append(String.format("%01X", padding));
+ builder.append(", panId=");
+ builder.append(String.format("%02X", panId));
+ builder.append(", parentAddress=");
+ builder.append(String.format("%02X", parentAddress));
+ builder.append(", extendedPanId=");
+ builder.append(extendedPanId);
+ builder.append(", extendedParentAddress=");
+ builder.append(extendedParentAddress);
+ builder.append(", channel=");
+ builder.append(channel);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoGetLinkKeySreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoGetLinkKeySreq.java
new file mode 100644
index 0000000000..deb230b452
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoGetLinkKeySreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_GET_LINK_KEY.
+ *
+ * This command retrieves the application link key of a given device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoGetLinkKeySreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ */
+ private IeeeAddress ieeeAddr;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoGetLinkKeySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @return the current ieeeAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddr() {
+ return ieeeAddr;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @param ieeeAddr the IeeeAddr to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddr(IeeeAddress ieeeAddr) {
+ this.ieeeAddr = ieeeAddr;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x25));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x25);
+
+ // Serialize the fields
+ serializer.serializeIeeeAddress(ieeeAddr);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackZdoGetLinkKeySreq [ieeeAddr=");
+ builder.append(ieeeAddr);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoGetLinkKeySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoGetLinkKeySrsp.java
new file mode 100644
index 0000000000..b80e4736a7
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoGetLinkKeySrsp.java
@@ -0,0 +1,123 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import com.zsmartsystems.zigbee.security.ZigBeeKey;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_GET_LINK_KEY.
+ *
+ * This command retrieves the application link key of a given device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoGetLinkKeySrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 – Success. 0xC8 – Unknown device.
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ */
+ private IeeeAddress ieeeAddr;
+
+ /**
+ * Link key data of the device
+ */
+ private ZigBeeKey linkKeyData;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoGetLinkKeySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ ieeeAddr = deserializer.deserializeIeeeAddress();
+ linkKeyData = deserializer.deserializeZigBeeKey();
+ }
+
+ /**
+ * 0x00 – Success. 0xC8 – Unknown device.
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 – Success. 0xC8 – Unknown device.
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @return the current ieeeAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddr() {
+ return ieeeAddr;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @param ieeeAddr the IeeeAddr to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddr(IeeeAddress ieeeAddr) {
+ this.ieeeAddr = ieeeAddr;
+ }
+
+ /**
+ * Link key data of the device
+ *
+ * @return the current linkKeyData as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getLinkKeyData() {
+ return linkKeyData;
+ }
+
+ /**
+ * Link key data of the device
+ *
+ * @param linkKeyData the LinkKeyData to set as {@link ZigBeeKey}
+ */
+ public void setLinkKeyData(ZigBeeKey linkKeyData) {
+ this.linkKeyData = linkKeyData;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(101);
+ builder.append("ZstackZdoGetLinkKeySrsp [status=");
+ builder.append(status);
+ builder.append(", ieeeAddr=");
+ builder.append(ieeeAddr);
+ builder.append(", linkKeyData=");
+ builder.append(linkKeyData);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoLeaveIndAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoLeaveIndAreq.java
new file mode 100644
index 0000000000..7c364a5c1a
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoLeaveIndAreq.java
@@ -0,0 +1,171 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_LEAVE_IND.
+ *
+ * This message is an indication to inform the host of a device leaving the network.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoLeaveIndAreq extends ZstackFrameResponse {
+
+ /**
+ * Short address (LSB-MSB) of the source of the leave indication.
+ */
+ private int srcAddr;
+
+ /**
+ * Extended address (LSB-MSB) of the source of the leave indication.
+ */
+ private IeeeAddress extAddr;
+
+ /**
+ * Boolean, TRUE = request, FALSE = indication.
+ */
+ private boolean request;
+
+ /**
+ * Boolean, TRUE = remove children.
+ */
+ private boolean remove;
+
+ /**
+ * Boolean, TRUE = rejoin.
+ */
+ private boolean rejoin;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoLeaveIndAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ srcAddr = deserializer.deserializeUInt16();
+ extAddr = deserializer.deserializeIeeeAddress();
+ request = deserializer.deserializeBoolean();
+ remove = deserializer.deserializeBoolean();
+ rejoin = deserializer.deserializeBoolean();
+ }
+
+ /**
+ * Short address (LSB-MSB) of the source of the leave indication.
+ *
+ * @return the current srcAddr as {@link int}
+ */
+ public int getSrcAddr() {
+ return srcAddr;
+ }
+
+ /**
+ * Short address (LSB-MSB) of the source of the leave indication.
+ *
+ * @param srcAddr the SrcAddr to set as {@link int}
+ */
+ public void setSrcAddr(int srcAddr) {
+ this.srcAddr = srcAddr;
+ }
+
+ /**
+ * Extended address (LSB-MSB) of the source of the leave indication.
+ *
+ * @return the current extAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtAddr() {
+ return extAddr;
+ }
+
+ /**
+ * Extended address (LSB-MSB) of the source of the leave indication.
+ *
+ * @param extAddr the ExtAddr to set as {@link IeeeAddress}
+ */
+ public void setExtAddr(IeeeAddress extAddr) {
+ this.extAddr = extAddr;
+ }
+
+ /**
+ * Boolean, TRUE = request, FALSE = indication.
+ *
+ * @return the current request as {@link boolean}
+ */
+ public boolean getRequest() {
+ return request;
+ }
+
+ /**
+ * Boolean, TRUE = request, FALSE = indication.
+ *
+ * @param request the Request to set as {@link boolean}
+ */
+ public void setRequest(boolean request) {
+ this.request = request;
+ }
+
+ /**
+ * Boolean, TRUE = remove children.
+ *
+ * @return the current remove as {@link boolean}
+ */
+ public boolean getRemove() {
+ return remove;
+ }
+
+ /**
+ * Boolean, TRUE = remove children.
+ *
+ * @param remove the Remove to set as {@link boolean}
+ */
+ public void setRemove(boolean remove) {
+ this.remove = remove;
+ }
+
+ /**
+ * Boolean, TRUE = rejoin.
+ *
+ * @return the current rejoin as {@link boolean}
+ */
+ public boolean getRejoin() {
+ return rejoin;
+ }
+
+ /**
+ * Boolean, TRUE = rejoin.
+ *
+ * @param rejoin the Rejoin to set as {@link boolean}
+ */
+ public void setRejoin(boolean rejoin) {
+ this.rejoin = rejoin;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(149);
+ builder.append("ZstackZdoLeaveIndAreq [srcAddr=");
+ builder.append(String.format("%04X", srcAddr));
+ builder.append(", extAddr=");
+ builder.append(extAddr);
+ builder.append(", request=");
+ builder.append(request);
+ builder.append(", remove=");
+ builder.append(remove);
+ builder.append(", rejoin=");
+ builder.append(rejoin);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbIncomingAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbIncomingAreq.java
new file mode 100644
index 0000000000..18d73629f3
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbIncomingAreq.java
@@ -0,0 +1,227 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_MSG_CB_INCOMING.
+ *
+ * This message is a ZDO callback for a Cluster Id that the host requested to receive with a ZDO_ MSG_CB_REGISTER request.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoMsgCbIncomingAreq extends ZstackFrameResponse {
+
+ /**
+ * Short address (LSB-MSB) of the source of the ZDO message.
+ */
+ private int srcAddr;
+
+ /**
+ * This field indicates whether or not this ZDO message was broadcast.
+ */
+ private boolean wasBroadcast;
+
+ /**
+ * The ZDO Cluster Id of this message.
+ */
+ private int clusterId;
+
+ /**
+ * N/A – not used.
+ */
+ private boolean securityUse;
+
+ /**
+ * The sequence number of this ZDO message.
+ */
+ private int seqNumber;
+
+ /**
+ * The MAC destination short address (LSB-MSB) of the ZDO message.
+ */
+ private int dstAddr;
+
+ /**
+ * The data that corresponds to the Cluster Id of the message
+ */
+ private int[] data;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoMsgCbIncomingAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ srcAddr = deserializer.deserializeUInt16();
+ wasBroadcast = deserializer.deserializeBoolean();
+ clusterId = deserializer.deserializeUInt16();
+ securityUse = deserializer.deserializeBoolean();
+ seqNumber = deserializer.deserializeUInt8();
+ dstAddr = deserializer.deserializeUInt16();
+ data = deserializer.deserializeUInt8Array();
+ }
+
+ /**
+ * Short address (LSB-MSB) of the source of the ZDO message.
+ *
+ * @return the current srcAddr as {@link int}
+ */
+ public int getSrcAddr() {
+ return srcAddr;
+ }
+
+ /**
+ * Short address (LSB-MSB) of the source of the ZDO message.
+ *
+ * @param srcAddr the SrcAddr to set as {@link int}
+ */
+ public void setSrcAddr(int srcAddr) {
+ this.srcAddr = srcAddr;
+ }
+
+ /**
+ * This field indicates whether or not this ZDO message was broadcast.
+ *
+ * @return the current wasBroadcast as {@link boolean}
+ */
+ public boolean getWasBroadcast() {
+ return wasBroadcast;
+ }
+
+ /**
+ * This field indicates whether or not this ZDO message was broadcast.
+ *
+ * @param wasBroadcast the WasBroadcast to set as {@link boolean}
+ */
+ public void setWasBroadcast(boolean wasBroadcast) {
+ this.wasBroadcast = wasBroadcast;
+ }
+
+ /**
+ * The ZDO Cluster Id of this message.
+ *
+ * @return the current clusterId as {@link int}
+ */
+ public int getClusterId() {
+ return clusterId;
+ }
+
+ /**
+ * The ZDO Cluster Id of this message.
+ *
+ * @param clusterId the ClusterId to set as {@link int}
+ */
+ public void setClusterId(int clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ /**
+ * N/A – not used.
+ *
+ * @return the current securityUse as {@link boolean}
+ */
+ public boolean getSecurityUse() {
+ return securityUse;
+ }
+
+ /**
+ * N/A – not used.
+ *
+ * @param securityUse the SecurityUse to set as {@link boolean}
+ */
+ public void setSecurityUse(boolean securityUse) {
+ this.securityUse = securityUse;
+ }
+
+ /**
+ * The sequence number of this ZDO message.
+ *
+ * @return the current seqNumber as {@link int}
+ */
+ public int getSeqNumber() {
+ return seqNumber;
+ }
+
+ /**
+ * The sequence number of this ZDO message.
+ *
+ * @param seqNumber the SeqNumber to set as {@link int}
+ */
+ public void setSeqNumber(int seqNumber) {
+ this.seqNumber = seqNumber;
+ }
+
+ /**
+ * The MAC destination short address (LSB-MSB) of the ZDO message.
+ *
+ * @return the current dstAddr as {@link int}
+ */
+ public int getDstAddr() {
+ return dstAddr;
+ }
+
+ /**
+ * The MAC destination short address (LSB-MSB) of the ZDO message.
+ *
+ * @param dstAddr the DstAddr to set as {@link int}
+ */
+ public void setDstAddr(int dstAddr) {
+ this.dstAddr = dstAddr;
+ }
+
+ /**
+ * The data that corresponds to the Cluster Id of the message
+ *
+ * @return the current data as {@link int[]}
+ */
+ public int[] getData() {
+ return data;
+ }
+
+ /**
+ * The data that corresponds to the Cluster Id of the message
+ *
+ * @param data the Data to set as {@link int[]}
+ */
+ public void setData(int[] data) {
+ this.data = data;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(204);
+ builder.append("ZstackZdoMsgCbIncomingAreq [srcAddr=");
+ builder.append(String.format("%04X", srcAddr));
+ builder.append(", wasBroadcast=");
+ builder.append(wasBroadcast);
+ builder.append(", clusterId=");
+ builder.append(String.format("%04X", clusterId));
+ builder.append(", securityUse=");
+ builder.append(securityUse);
+ builder.append(", seqNumber=");
+ builder.append(String.format("%02X", seqNumber));
+ builder.append(", dstAddr=");
+ builder.append(String.format("%04X", dstAddr));
+ builder.append(", data=");
+ for (int c = 0; c < data.length; c++) {
+ if (c > 0) {
+ builder.append(' ');
+ }
+ builder.append(String.format("%02X", data[c]));
+ }
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbRegisterSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbRegisterSreq.java
new file mode 100644
index 0000000000..a9a6a63b51
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbRegisterSreq.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_MSG_CB_REGISTER.
+ *
+ * This command registers for a ZDO callback.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoMsgCbRegisterSreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the ZDO Cluster Id for which to receive a ZDO callback.
+ */
+ private int clusterId;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoMsgCbRegisterSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the ZDO Cluster Id for which to receive a ZDO callback.
+ *
+ * @return the current clusterId as {@link int}
+ */
+ public int getClusterId() {
+ return clusterId;
+ }
+
+ /**
+ * Specifies the ZDO Cluster Id for which to receive a ZDO callback.
+ *
+ * @param clusterId the ClusterId to set as {@link int}
+ */
+ public void setClusterId(int clusterId) {
+ this.clusterId = clusterId;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x3E));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x3E);
+
+ // Serialize the fields
+ serializer.serializeUInt16(clusterId);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(54);
+ builder.append("ZstackZdoMsgCbRegisterSreq [clusterId=");
+ builder.append(String.format("%04X", clusterId));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbRegisterSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbRegisterSrsp.java
new file mode 100644
index 0000000000..54d4866750
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoMsgCbRegisterSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_MSG_CB_REGISTER.
+ *
+ * This command registers for a ZDO callback.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoMsgCbRegisterSrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 – Success.
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoMsgCbRegisterSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * 0x00 – Success.
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 – Success.
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(54);
+ builder.append("ZstackZdoMsgCbRegisterSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoNwkDiscoveryReqSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoNwkDiscoveryReqSreq.java
new file mode 100644
index 0000000000..47ab5dc7e9
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoNwkDiscoveryReqSreq.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_NWK_DISCOVERY_REQ.
+ *
+ * This command is used to initiate a network discovery (active scan).
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoNwkDiscoveryReqSreq extends ZstackFrameRequest {
+
+ /**
+ * Bit mask for channels to scan.
+ */
+ private int scanChannels;
+
+ /**
+ * A value used to calculate the length of time to spend scanning each channel
+ */
+ private int scanDuration;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoNwkDiscoveryReqSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Bit mask for channels to scan.
+ *
+ * @return the current scanChannels as {@link int}
+ */
+ public int getScanChannels() {
+ return scanChannels;
+ }
+
+ /**
+ * Bit mask for channels to scan.
+ *
+ * @param scanChannels the ScanChannels to set as {@link int}
+ */
+ public void setScanChannels(int scanChannels) {
+ this.scanChannels = scanChannels;
+ }
+
+ /**
+ * A value used to calculate the length of time to spend scanning each channel
+ *
+ * @return the current scanDuration as {@link int}
+ */
+ public int getScanDuration() {
+ return scanDuration;
+ }
+
+ /**
+ * A value used to calculate the length of time to spend scanning each channel
+ *
+ * @param scanDuration the ScanDuration to set as {@link int}
+ */
+ public void setScanDuration(int scanDuration) {
+ this.scanDuration = scanDuration;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x26));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x26);
+
+ // Serialize the fields
+ serializer.serializeUInt32(scanChannels);
+ serializer.serializeUInt8(scanDuration);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(81);
+ builder.append("ZstackZdoNwkDiscoveryReqSreq [scanChannels=");
+ builder.append(scanChannels);
+ builder.append(", scanDuration=");
+ builder.append(scanDuration);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoNwkDiscoveryReqSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoNwkDiscoveryReqSrsp.java
new file mode 100644
index 0000000000..ddbbac0296
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoNwkDiscoveryReqSrsp.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_NWK_DISCOVERY_REQ.
+ *
+ * This command is used to initiate a network discovery (active scan).
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoNwkDiscoveryReqSrsp extends ZstackFrameResponse {
+
+ /**
+ * Success (0) Invalid_Parameter (0x02). ZNwkInvalidRequest (0xC2) if the device is already on a network. User
+ * ZDO_MGMT_NWK_DISC_REQ instead. Or leave the network first, then initiate the request. MAC_SCAN_IN_PROGRESS (0xFC) if a
+ * channel change is in progress. MAC_NO_RESOURCE (0x1A) if the operation could not complete because no memory resource were
+ * available.
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoNwkDiscoveryReqSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Success (0) Invalid_Parameter (0x02). ZNwkInvalidRequest (0xC2) if the device is already on a network. User
+ * ZDO_MGMT_NWK_DISC_REQ instead. Or leave the network first, then initiate the request. MAC_SCAN_IN_PROGRESS (0xFC) if a
+ * channel change is in progress. MAC_NO_RESOURCE (0x1A) if the operation could not complete because no memory resource were
+ * available.
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * Success (0) Invalid_Parameter (0x02). ZNwkInvalidRequest (0xC2) if the device is already on a network. User
+ * ZDO_MGMT_NWK_DISC_REQ instead. Or leave the network first, then initiate the request. MAC_SCAN_IN_PROGRESS (0xFC) if a
+ * channel change is in progress. MAC_NO_RESOURCE (0x1A) if the operation could not complete because no memory resource were
+ * available.
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(56);
+ builder.append("ZstackZdoNwkDiscoveryReqSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoRemoveLinkKeySreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoRemoveLinkKeySreq.java
new file mode 100644
index 0000000000..94080ada84
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoRemoveLinkKeySreq.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_REMOVE_LINK_KEY.
+ *
+ * This command removes the application link key of a given device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoRemoveLinkKeySreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ */
+ private IeeeAddress ieeeAddr;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoRemoveLinkKeySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @return the current ieeeAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddr() {
+ return ieeeAddr;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @param ieeeAddr the IeeeAddr to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddr(IeeeAddress ieeeAddr) {
+ this.ieeeAddr = ieeeAddr;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x24));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x24);
+
+ // Serialize the fields
+ serializer.serializeIeeeAddress(ieeeAddr);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(54);
+ builder.append("ZstackZdoRemoveLinkKeySreq [ieeeAddr=");
+ builder.append(ieeeAddr);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoRemoveLinkKeySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoRemoveLinkKeySrsp.java
new file mode 100644
index 0000000000..de7b4f087d
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoRemoveLinkKeySrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_REMOVE_LINK_KEY.
+ *
+ * This command removes the application link key of a given device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoRemoveLinkKeySrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 – Success. 0xC8 – Unknown device.
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoRemoveLinkKeySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * 0x00 – Success. 0xC8 – Unknown device.
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 – Success. 0xC8 – Unknown device.
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(54);
+ builder.append("ZstackZdoRemoveLinkKeySrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoSetLinkKeySreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoSetLinkKeySreq.java
new file mode 100644
index 0000000000..50e1cbd525
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoSetLinkKeySreq.java
@@ -0,0 +1,132 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.security.ZigBeeKey;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_SET_LINK_KEY.
+ *
+ * This command sets the application link key for a given device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoSetLinkKeySreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the short address of the pair device of the link key.
+ */
+ private int shortAddr;
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ */
+ private IeeeAddress ieeeAddr;
+
+ /**
+ * 128 bit link key data of the device.
+ */
+ private ZigBeeKey linkKeyData;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoSetLinkKeySreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the short address of the pair device of the link key.
+ *
+ * @return the current shortAddr as {@link int}
+ */
+ public int getShortAddr() {
+ return shortAddr;
+ }
+
+ /**
+ * Specifies the short address of the pair device of the link key.
+ *
+ * @param shortAddr the ShortAddr to set as {@link int}
+ */
+ public void setShortAddr(int shortAddr) {
+ this.shortAddr = shortAddr;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @return the current ieeeAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getIeeeAddr() {
+ return ieeeAddr;
+ }
+
+ /**
+ * Specifies the IEEE address of the pair device of the link key
+ *
+ * @param ieeeAddr the IeeeAddr to set as {@link IeeeAddress}
+ */
+ public void setIeeeAddr(IeeeAddress ieeeAddr) {
+ this.ieeeAddr = ieeeAddr;
+ }
+
+ /**
+ * 128 bit link key data of the device.
+ *
+ * @return the current linkKeyData as {@link ZigBeeKey}
+ */
+ public ZigBeeKey getLinkKeyData() {
+ return linkKeyData;
+ }
+
+ /**
+ * 128 bit link key data of the device.
+ *
+ * @param linkKeyData the LinkKeyData to set as {@link ZigBeeKey}
+ */
+ public void setLinkKeyData(ZigBeeKey linkKeyData) {
+ this.linkKeyData = linkKeyData;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x23));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x23);
+
+ // Serialize the fields
+ serializer.serializeUInt16(shortAddr);
+ serializer.serializeIeeeAddress(ieeeAddr);
+ serializer.serializeZigBeeKey(linkKeyData);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(101);
+ builder.append("ZstackZdoSetLinkKeySreq [shortAddr=");
+ builder.append(String.format("%04X", shortAddr));
+ builder.append(", ieeeAddr=");
+ builder.append(ieeeAddr);
+ builder.append(", linkKeyData=");
+ builder.append(linkKeyData);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoSetLinkKeySrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoSetLinkKeySrsp.java
new file mode 100644
index 0000000000..73ab3f1719
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoSetLinkKeySrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_SET_LINK_KEY.
+ *
+ * This command sets the application link key for a given device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:47 CEST 2023")
+public class ZstackZdoSetLinkKeySrsp extends ZstackFrameResponse {
+
+ /**
+ * 0x00 – Success. 0x01 – Fail to add to address manager. 0x11 – Security manager key table full
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoSetLinkKeySrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * 0x00 – Success. 0x01 – Fail to add to address manager. 0x11 – Security manager key table full
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * 0x00 – Success. 0x01 – Fail to add to address manager. 0x11 – Security manager key table full
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(51);
+ builder.append("ZstackZdoSetLinkKeySrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStartupFromAppSreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStartupFromAppSreq.java
new file mode 100644
index 0000000000..3a72af0e95
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStartupFromAppSreq.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_STARTUP_FROM_APP.
+ *
+ * This command starts the device in the network.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoStartupFromAppSreq extends ZstackFrameRequest {
+
+ /**
+ * Specifies the time delay before the device starts in milliseconds.
+ */
+ private int startDelay;
+
+ /**
+ * Request constructor
+ */
+ public ZstackZdoStartupFromAppSreq() {
+ synchronousCommand = true;
+ }
+
+ /**
+ * Specifies the time delay before the device starts in milliseconds.
+ *
+ * @return the current startDelay as {@link int}
+ */
+ public int getStartDelay() {
+ return startDelay;
+ }
+
+ /**
+ * Specifies the time delay before the device starts in milliseconds.
+ *
+ * @param startDelay the StartDelay to set as {@link int}
+ */
+ public void setStartDelay(int startDelay) {
+ this.startDelay = startDelay;
+ }
+
+ @Override
+ public boolean matchSreqError(ZstackRpcSreqErrorSrsp response) {
+ return (((response.getReqCmd0() & 0x1F) == ZSTACK_ZDO) && (response.getReqCmd1() == 0x40));
+ }
+
+ @Override
+ public int[] serialize() {
+ // Serialize the header
+ serializeHeader(ZSTACK_SREQ, ZSTACK_ZDO, 0x40);
+
+ // Serialize the fields
+ serializer.serializeUInt16(startDelay);
+ return getPayload();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(55);
+ builder.append("ZstackZdoStartupFromAppSreq [startDelay=");
+ builder.append(startDelay);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStartupFromAppSrsp.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStartupFromAppSrsp.java
new file mode 100644
index 0000000000..34b390603f
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStartupFromAppSrsp.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackResponseCode;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_STARTUP_FROM_APP.
+ *
+ * This command starts the device in the network.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoStartupFromAppSrsp extends ZstackFrameResponse {
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ */
+ private ZstackResponseCode status;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoStartupFromAppSrsp(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ synchronousCommand = true;
+
+ // Deserialize the fields
+ status = ZstackResponseCode.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ *
+ * @return the current status as {@link ZstackResponseCode}
+ */
+ public ZstackResponseCode getStatus() {
+ return status;
+ }
+
+ /**
+ * This field indicates either SUCCESS (0) or FAILURE (1).
+ *
+ * @param status the Status to set as {@link ZstackResponseCode}
+ */
+ public void setStatus(ZstackResponseCode status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(55);
+ builder.append("ZstackZdoStartupFromAppSrsp [status=");
+ builder.append(status);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStateChangeIndAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStateChangeIndAreq.java
new file mode 100644
index 0000000000..5a8bc095d5
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoStateChangeIndAreq.java
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.sys.ZstackZdoState;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_STATE_CHANGE_IND.
+ *
+ * This callback message indicates the ZDO state change.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoStateChangeIndAreq extends ZstackFrameResponse {
+
+ /**
+ * Specifies the changed ZDO state. An enumerated list starting from 0.
+ */
+ private ZstackZdoState state;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoStateChangeIndAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ state = ZstackZdoState.valueOf(deserializer.deserializeUInt8());
+ }
+
+ /**
+ * Specifies the changed ZDO state. An enumerated list starting from 0.
+ *
+ * @return the current state as {@link ZstackZdoState}
+ */
+ public ZstackZdoState getState() {
+ return state;
+ }
+
+ /**
+ * Specifies the changed ZDO state. An enumerated list starting from 0.
+ *
+ * @param state the State to set as {@link ZstackZdoState}
+ */
+ public void setState(ZstackZdoState state) {
+ this.state = state;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(55);
+ builder.append("ZstackZdoStateChangeIndAreq [state=");
+ builder.append(state);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoTcDevIndAreq.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoTcDevIndAreq.java
new file mode 100644
index 0000000000..6ae35f7b32
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/api/zdo/ZstackZdoTcDevIndAreq.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.api.zdo;
+
+import com.zsmartsystems.zigbee.IeeeAddress;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import javax.annotation.Generated;
+
+/**
+ * Class to implement the Z-Stack command ZDO_TC_DEV_IND.
+ *
+ * This message is a ZDO callback for TC Device Indication. This is an indication that the TC has delivered the key to a recently
+ * joined device.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ */
+
+@Generated(value = "com.zsmartsystems.zigbee.dongle.zstack.autocode.CommandGenerator", date = "Sun Mar 26 09:52:48 CEST 2023")
+public class ZstackZdoTcDevIndAreq extends ZstackFrameResponse {
+
+ /**
+ * Source network Address
+ */
+ private int srcAddr;
+
+ /**
+ * IEEE Address of the source
+ */
+ private IeeeAddress extAddr;
+
+ /**
+ * Network address of the parent
+ */
+ private int parentAddr;
+
+ /**
+ * Response and Handler constructor
+ */
+ public ZstackZdoTcDevIndAreq(int[] inputBuffer) {
+ // Super creates deserializer and reads header fields
+ super(inputBuffer);
+
+ // Deserialize the fields
+ srcAddr = deserializer.deserializeUInt16();
+ extAddr = deserializer.deserializeIeeeAddress();
+ parentAddr = deserializer.deserializeUInt16();
+ }
+
+ /**
+ * Source network Address
+ *
+ * @return the current srcAddr as {@link int}
+ */
+ public int getSrcAddr() {
+ return srcAddr;
+ }
+
+ /**
+ * Source network Address
+ *
+ * @param srcAddr the SrcAddr to set as {@link int}
+ */
+ public void setSrcAddr(int srcAddr) {
+ this.srcAddr = srcAddr;
+ }
+
+ /**
+ * IEEE Address of the source
+ *
+ * @return the current extAddr as {@link IeeeAddress}
+ */
+ public IeeeAddress getExtAddr() {
+ return extAddr;
+ }
+
+ /**
+ * IEEE Address of the source
+ *
+ * @param extAddr the ExtAddr to set as {@link IeeeAddress}
+ */
+ public void setExtAddr(IeeeAddress extAddr) {
+ this.extAddr = extAddr;
+ }
+
+ /**
+ * Network address of the parent
+ *
+ * @return the current parentAddr as {@link int}
+ */
+ public int getParentAddr() {
+ return parentAddr;
+ }
+
+ /**
+ * Network address of the parent
+ *
+ * @param parentAddr the ParentAddr to set as {@link int}
+ */
+ public void setParentAddr(int parentAddr) {
+ this.parentAddr = parentAddr;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(99);
+ builder.append("ZstackZdoTcDevIndAreq [srcAddr=");
+ builder.append(String.format("%04X", srcAddr));
+ builder.append(", extAddr=");
+ builder.append(extAddr);
+ builder.append(", parentAddr=");
+ builder.append(String.format("%04X", parentAddr));
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/internal/ZstackProtocolHandler.java b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/internal/ZstackProtocolHandler.java
new file mode 100644
index 0000000000..30dbd9a609
--- /dev/null
+++ b/com.zsmartsystems.zigbee.dongle.zstack/src/main/java/com/zsmartsystems/zigbee/dongle/zstack/internal/ZstackProtocolHandler.java
@@ -0,0 +1,476 @@
+/**
+ * Copyright (c) 2016-2022 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.zstack.internal;
+
+import static java.util.Objects.requireNonNull;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.zsmartsystems.zigbee.ZigBeeExecutors;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackCommand;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameFactory;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameRequest;
+import com.zsmartsystems.zigbee.dongle.zstack.api.ZstackFrameResponse;
+import com.zsmartsystems.zigbee.dongle.zstack.api.rpc.ZstackRpcSreqErrorSrsp;
+import com.zsmartsystems.zigbee.transport.ZigBeePort;
+
+/**
+ * Class for the ZStack protocol handler. The protocol handler manages the low level data transfer of ZStack frames.
+ *
+ * @author Chris Jackson
+ *
+ */
+public class ZstackProtocolHandler {
+ private static int ZSTACK_MAX_LENGTH = 100;
+
+ /**
+ * Time to wait for a SRSP response to an SREQ before moving on
+ */
+ private static int TIMEOUT = 3500;
+
+ private static int ZSTACK_SOF = 0xFE;
+
+ private enum ZstackState {
+ SOF,
+ LENGTH,
+ DATA,
+ FCS
+ }
+
+ /**
+ * The logger.
+ */
+ private final Logger logger = LoggerFactory.getLogger(ZstackProtocolHandler.class);
+
+ /**
+ * The port.
+ */
+ private ZigBeePort port;
+
+ /**
+ * Flag reflecting that parser has been closed and parser parserThread should exit.
+ */
+ private boolean closeHandler = false;
+
+ /**
+ * The queue of {@link ZstackFrameRequest} frames waiting to be sent
+ */
+ private final BlockingQueue
+ *
+ *
+ * @author Chris Jackson
+ *
+ */
+public class ZigBeeDongleZstack implements ZigBeeTransportTransmit {
+ /**
+ * The {@link Logger}.
+ */
+ private final Logger logger = LoggerFactory.getLogger(ZigBeeDongleZstack.class);
+
+ /**
+ * The default link key
+ */
+ private static final ZigBeeKey DEFAULT_TCLK = new ZigBeeKey(new int[] { 0x5A, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41,
+ 0x6C, 0x6C, 0x69, 0x61, 0x6E, 0x63, 0x65, 0x30, 0x39 });
+
+ /**
+ * The serial port used to connect to the dongle
+ */
+ private final ZigBeePort serialPort;
+
+ /**
+ * The protocol handler used to send and receive ZStack packets
+ */
+ private final ZstackProtocolHandler protocolHandler;
+
+ /**
+ * The NCP is used for convenient access to the protocol handler
+ */
+ private final ZstackNcp ncp;
+
+ /**
+ * The stack configuration we need for the NCP
+ */
+ private Map
- * Value must be one of {@link ConcentratorConfigs}.
+ * Value must be one of {@link ConcentratorConfig}.
*/
CONCENTRATOR_CONFIG,
diff --git a/pom.xml b/pom.xml
index a2c29c8a7d..8f787256ed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -76,10 +76,13 @@