+ * Returns the current radio parameters based on phy index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspGetRadioParametersRequest extends EzspFrameRequest { + public static final int FRAME_ID = 0xFD; + + /** + * The number of children the node currently has. + *
+ * EZSP type is uint8_t - Java type is {@link int} + */ + private int childCount; + + /** + * Serialiser used to serialise to binary line data + */ + private EzspSerializer serializer; + + /** + * Request constructor + */ + public EzspGetRadioParametersRequest() { + frameId = FRAME_ID; + serializer = new EzspSerializer(); + } + + /** + * The number of children the node currently has. + *
+ * EZSP type is uint8_t - Java type is {@link int} + * + * @return the current childCount as {@link int} + */ + public int getChildCount() { + return childCount; + } + + /** + * The number of children the node currently has. + * + * @param childCount the childCount to set as {@link int} + */ + public void setChildCount(int childCount) { + this.childCount = childCount; + } + + @Override + public int[] serialize() { + // Serialize the header + serializeHeader(serializer); + + // Serialize the fields + serializer.serializeUInt8(childCount); + return serializer.getPayload(); + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(82); + builder.append("EzspGetRadioParametersRequest [networkId="); + builder.append(networkId); + builder.append(", childCount="); + builder.append(childCount); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspGetRadioParametersResponse.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspGetRadioParametersResponse.java new file mode 100644 index 0000000000..cb32ef97ef --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspGetRadioParametersResponse.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016-2023 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.command; + +import com.zsmartsystems.zigbee.dongle.ember.ezsp.EzspFrameResponse; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberMultiPhyRadioParameters; +import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberStatus; + +/** + * Class to implement the Ember EZSP command getRadioParameters. + *
+ * Returns the current radio parameters based on phy index. + *
+ * This class provides methods for processing EZSP commands. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten. + * + * @author Chris Jackson - Initial contribution of Java code generator + */ +public class EzspGetRadioParametersResponse extends EzspFrameResponse { + public static final int FRAME_ID = 0xFD; + + /** + * The result of the CBKE operation. + *
+ * EZSP type is EmberStatus - Java type is {@link EmberStatus} + */ + private EmberStatus status; + + /** + * The current radio parameters. + *
+ * EZSP type is EmberMultiPhyRadioParameters - Java type is {@link EmberMultiPhyRadioParameters} + */ + private EmberMultiPhyRadioParameters parameters; + + /** + * Response and Handler constructor + */ + public EzspGetRadioParametersResponse(int[] inputBuffer) { + // Super creates deserializer and reads header fields + super(inputBuffer); + + // Deserialize the fields + status = deserializer.deserializeEmberStatus(); + parameters = deserializer.deserializeEmberMultiPhyRadioParameters(); + } + + /** + * The result of the CBKE operation. + *
+ * EZSP type is EmberStatus - Java type is {@link EmberStatus} + * + * @return the current status as {@link EmberStatus} + */ + public EmberStatus getStatus() { + return status; + } + + /** + * The result of the CBKE operation. + * + * @param status the status to set as {@link EmberStatus} + */ + public void setStatus(EmberStatus status) { + this.status = status; + } + + /** + * The current radio parameters. + *
+ * EZSP type is EmberMultiPhyRadioParameters - Java type is {@link EmberMultiPhyRadioParameters} + * + * @return the current parameters as {@link EmberMultiPhyRadioParameters} + */ + public EmberMultiPhyRadioParameters getParameters() { + return parameters; + } + + /** + * The current radio parameters. + * + * @param parameters the parameters to set as {@link EmberMultiPhyRadioParameters} + */ + public void setParameters(EmberMultiPhyRadioParameters parameters) { + this.parameters = parameters; + } + + @Override + public String toString() { + final StringBuilder builder = new StringBuilder(108); + builder.append("EzspGetRadioParametersResponse [networkId="); + builder.append(networkId); + builder.append(", status="); + builder.append(status); + builder.append(", parameters="); + builder.append(parameters); + builder.append(']'); + return builder.toString(); + } +} diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EmberConfigTxPowerMode.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EmberConfigTxPowerMode.java new file mode 100644 index 0000000000..d3f2f1250b --- /dev/null +++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/ezsp/structure/EmberConfigTxPowerMode.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2016-2023 by the respective copyright holders. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package com.zsmartsystems.zigbee.dongle.ember.ezsp.structure; + +import java.util.HashMap; +import java.util.Map; + +/** + * Class to implement the Ember Enumeration EmberConfigTxPowerMode. + *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public enum EmberConfigTxPowerMode {
+ /**
+ * Default unknown value
+ */
+ UNKNOWN(-1),
+
+ /**
+ * Normal power mode and bi-directional RF transmitter output.
+ */
+ EMBER_TX_POWER_MODE_DEFAULT(0x0000),
+
+ /**
+ * Enable boost power mode. This is a high-performance radio mode which offers increased
+ * receive sensitivity and transmit power at the cost of an increase in power consumption.
+ */
+ EMBER_TX_POWER_MODE_BOOST(0x0001),
+
+ /**
+ * Enable the alternate transmitter output. This allows for simplified connection to an
+ * external power amplifier via the RF_TX_ALT_P and RF_TX_ALT_N pins.
+ */
+ EMBER_TX_POWER_MODE_ALTERNATE(0x0002),
+
+ /**
+ * Enable both boost mode and the alternate transmitter output.
+ */
+ EMBER_TX_POWER_MODE_BOOST_AND_ALTERNATE(0x0003);
+
+ /**
+ * A mapping between the integer code and its corresponding type to
+ * facilitate lookup by code.
+ */
+ private static Map
+ * Radio parameters.
+ *
+ * Note that this code is autogenerated. Manual changes may be overwritten.
+ *
+ * @author Chris Jackson - Initial contribution of Java code generator
+ */
+public class EmberMultiPhyRadioParameters {
+
+ /**
+ * A power setting, in dBm.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ */
+ private int radioTxPower;
+
+ /**
+ * A radio page.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ */
+ private int radioPage;
+
+ /**
+ * A radio channel.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ */
+ private int radioChannel;
+
+ /**
+ * Default Constructor
+ */
+ public EmberMultiPhyRadioParameters() {
+ }
+
+ public EmberMultiPhyRadioParameters(EzspDeserializer deserializer) {
+ deserialize(deserializer);
+ }
+
+ /**
+ * A power setting, in dBm.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ *
+ * @return the current radioTxPower as {@link int}
+ */
+ public int getRadioTxPower() {
+ return radioTxPower;
+ }
+
+ /**
+ * A power setting, in dBm.
+ *
+ * @param radioTxPower the radioTxPower to set as {@link int}
+ */
+ public void setRadioTxPower(int radioTxPower) {
+ this.radioTxPower = radioTxPower;
+ }
+
+ /**
+ * A radio page.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ *
+ * @return the current radioPage as {@link int}
+ */
+ public int getRadioPage() {
+ return radioPage;
+ }
+
+ /**
+ * A radio page.
+ *
+ * @param radioPage the radioPage to set as {@link int}
+ */
+ public void setRadioPage(int radioPage) {
+ this.radioPage = radioPage;
+ }
+
+ /**
+ * A radio channel.
+ *
+ * EZSP type is uint8_t - Java type is {@link int}
+ *
+ * @return the current radioChannel as {@link int}
+ */
+ public int getRadioChannel() {
+ return radioChannel;
+ }
+
+ /**
+ * A radio channel.
+ *
+ * @param radioChannel the radioChannel to set as {@link int}
+ */
+ public void setRadioChannel(int radioChannel) {
+ this.radioChannel = radioChannel;
+ }
+
+ /**
+ * Serialise the contents of the EZSP structure.
+ *
+ * @param serializer the {@link EzspSerializer} used to serialize
+ */
+ public int[] serialize(EzspSerializer serializer) {
+ // Serialize the fields
+ serializer.serializeUInt8(radioTxPower);
+ serializer.serializeUInt8(radioPage);
+ serializer.serializeUInt8(radioChannel);
+ return serializer.getPayload();
+ }
+
+ /**
+ * Deserialise the contents of the EZSP structure.
+ *
+ * @param deserializer the {@link EzspDeserializer} used to deserialize
+ */
+ public void deserialize(EzspDeserializer deserializer) {
+ // Deserialize the fields
+ radioTxPower = deserializer.deserializeUInt8();
+ radioPage = deserializer.deserializeUInt8();
+ radioChannel = deserializer.deserializeUInt8();
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder(106);
+ builder.append("EmberMultiPhyRadioParameters [radioTxPower=");
+ builder.append(radioTxPower);
+ builder.append(", radioPage=");
+ builder.append(radioPage);
+ builder.append(", radioChannel=");
+ builder.append(radioChannel);
+ builder.append(']');
+ return builder.toString();
+ }
+}
diff --git a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java
index d17434b39d..0651f82b6b 100644
--- a/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java
+++ b/com.zsmartsystems.zigbee.dongle.ember/src/main/java/com/zsmartsystems/zigbee/dongle/ember/internal/serializer/EzspDeserializer.java
@@ -45,6 +45,7 @@
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberKeyType;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberLibraryStatus;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberMacPassthroughType;
+import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberMultiPhyRadioParameters;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberMulticastTableEntry;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberNeighborTableEntry;
import com.zsmartsystems.zigbee.dongle.ember.ezsp.structure.EmberNetworkParameters;
@@ -413,4 +414,8 @@ public EmberBeaconData deserializeEmberBeaconData() {
public EmberKeyStatus deserializeEmberKeyStatus() {
return EmberKeyStatus.getEmberKeyStatus(deserializeUInt8());
}
+
+ public EmberMultiPhyRadioParameters deserializeEmberMultiPhyRadioParameters() {
+ return new EmberMultiPhyRadioParameters(this);
+ }
}