forked from zsmartsystems/com.zsmartsystems.zigbee
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GetRadioParameters methods (zsmartsystems#1407)
Signed-off-by: Chris Jackson <[email protected]>
- Loading branch information
1 parent
16cce4a
commit 6e0018d
Showing
11 changed files
with
513 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
...ava/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspGetRadioParametersRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/** | ||
* 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.EzspFrameRequest; | ||
import com.zsmartsystems.zigbee.dongle.ember.internal.serializer.EzspSerializer; | ||
|
||
/** | ||
* Class to implement the Ember EZSP command <b>getRadioParameters</b>. | ||
* <p> | ||
* Returns the current radio parameters based on phy index. | ||
* <p> | ||
* This class provides methods for processing EZSP commands. | ||
* <p> | ||
* 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. | ||
* <p> | ||
* EZSP type is <i>uint8_t</i> - 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. | ||
* <p> | ||
* EZSP type is <i>uint8_t</i> - 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(); | ||
} | ||
} |
106 changes: 106 additions & 0 deletions
106
...va/com/zsmartsystems/zigbee/dongle/ember/ezsp/command/EzspGetRadioParametersResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <b>getRadioParameters</b>. | ||
* <p> | ||
* Returns the current radio parameters based on phy index. | ||
* <p> | ||
* This class provides methods for processing EZSP commands. | ||
* <p> | ||
* 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. | ||
* <p> | ||
* EZSP type is <i>EmberStatus</i> - Java type is {@link EmberStatus} | ||
*/ | ||
private EmberStatus status; | ||
|
||
/** | ||
* The current radio parameters. | ||
* <p> | ||
* EZSP type is <i>EmberMultiPhyRadioParameters</i> - 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. | ||
* <p> | ||
* EZSP type is <i>EmberStatus</i> - 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. | ||
* <p> | ||
* EZSP type is <i>EmberMultiPhyRadioParameters</i> - 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(); | ||
} | ||
} |
Oops, something went wrong.