Skip to content

Commit

Permalink
Update parameters in getRadioParameters (zsmartsystems#1409)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
  • Loading branch information
cdjackson authored and charbopassman committed Dec 2, 2024
1 parent 36b1761 commit c324494
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private void ncpState(ZigBeeNetworkManager networkManager, PrintStream out) {
int nwkAddress = ncp.getNwkAddress();
EzspGetNetworkParametersResponse nwkParameterResponse = ncp.getNetworkParameters();
EmberNetworkParameters nwkParameters = nwkParameterResponse.getParameters();
EzspGetRadioParametersResponse radioParametersResponse = ncp.getRadioParameters();
EzspGetRadioParametersResponse radioParametersResponse = ncp.getRadioParameters(0);
EmberMultiPhyRadioParameters radioParameters = radioParametersResponse.getParameters();

String mfgName = ncp.getMfgName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3706,15 +3706,15 @@
<command_parameters>
<parameter>
<data_type>uint8_t</data_type>
<name>childCount</name>
<description>The number of children the node currently has.</description>
<name>phyIndex</name>
<description>The physical radio to query.</description>
</parameter>
</command_parameters>
<response_parameters>
<parameter>
<data_type>EmberStatus</data_type>
<name>status</name>
<description>The result of the CBKE operation.</description>
<description>The result of the operation.</description>
</parameter>
<parameter>
<data_type>EmberMultiPhyRadioParameters</data_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ public EzspGetNetworkParametersResponse getNetworkParameters() {
/**
* Gets the current radio parameters, or an empty parameters class if there's an error
*
* @param phyIndex the physical radio index
* @return {@link EzspGetRadioParametersResponse} or null on error
*/
public EzspGetRadioParametersResponse getRadioParameters() {
public EzspGetRadioParametersResponse getRadioParameters(int phyIndex) {
EzspGetRadioParametersRequest request = new EzspGetRadioParametersRequest();
request.setChildCount(1);
request.setPhyIndex(phyIndex);
EzspTransaction transaction = zigBeeDongleEzsp.getProtocolHandler().sendEzspTransaction(
new EzspSingleResponseTransaction(request, EzspGetRadioParametersResponse.class));
return (EzspGetRadioParametersResponse) transaction.getResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public class EzspGetRadioParametersRequest extends EzspFrameRequest {
public static final int FRAME_ID = 0xFD;

/**
* The number of children the node currently has.
* The physical radio to query.
* <p>
* EZSP type is <i>uint8_t</i> - Java type is {@link int}
*/
private int childCount;
private int phyIndex;

/**
* Serialiser used to serialise to binary line data
Expand All @@ -45,23 +45,23 @@ public EzspGetRadioParametersRequest() {
}

/**
* The number of children the node currently has.
* The physical radio to query.
* <p>
* EZSP type is <i>uint8_t</i> - Java type is {@link int}
*
* @return the current childCount as {@link int}
* @return the current phyIndex as {@link int}
*/
public int getChildCount() {
return childCount;
public int getPhyIndex() {
return phyIndex;
}

/**
* The number of children the node currently has.
* The physical radio to query.
*
* @param childCount the childCount to set as {@link int}
* @param phyIndex the phyIndex to set as {@link int}
*/
public void setChildCount(int childCount) {
this.childCount = childCount;
public void setPhyIndex(int phyIndex) {
this.phyIndex = phyIndex;
}

@Override
Expand All @@ -70,7 +70,7 @@ public int[] serialize() {
serializeHeader(serializer);

// Serialize the fields
serializer.serializeUInt8(childCount);
serializer.serializeUInt8(phyIndex);
return serializer.getPayload();
}

Expand All @@ -79,8 +79,8 @@ public String toString() {
final StringBuilder builder = new StringBuilder(82);
builder.append("EzspGetRadioParametersRequest [networkId=");
builder.append(networkId);
builder.append(", childCount=");
builder.append(childCount);
builder.append(", phyIndex=");
builder.append(phyIndex);
builder.append(']');
return builder.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class EzspGetRadioParametersResponse extends EzspFrameResponse {
public static final int FRAME_ID = 0xFD;

/**
* The result of the CBKE operation.
* The result of the operation.
* <p>
* EZSP type is <i>EmberStatus</i> - Java type is {@link EmberStatus}
*/
Expand All @@ -52,7 +52,7 @@ public EzspGetRadioParametersResponse(int[] inputBuffer) {
}

/**
* The result of the CBKE operation.
* The result of the operation.
* <p>
* EZSP type is <i>EmberStatus</i> - Java type is {@link EmberStatus}
*
Expand All @@ -63,7 +63,7 @@ public EmberStatus getStatus() {
}

/**
* The result of the CBKE operation.
* The result of the operation.
*
* @param status the status to set as {@link EmberStatus}
*/
Expand Down

0 comments on commit c324494

Please sign in to comment.