Skip to content

Commit

Permalink
Fix javadoc generated for attribute setters (#1428)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <chris@cd-jackson.com>
  • Loading branch information
cdjackson committed May 18, 2024
1 parent e3c225f commit cd4eef1
Show file tree
Hide file tree
Showing 35 changed files with 719 additions and 712 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,10 @@ protected void outputClassGenerated(PrintStream out) {

protected void outputAttributeJavaDoc(PrintStream out, String type, ZigBeeXmlAttribute attribute,
DataTypeMap zclDataType) {
String name = attribute.name.replaceAll("\\{\\{count\\}\\}", "");
out.println();
out.println(" /**");
out.println(" * " + type + " the <i>" + attribute.name + "</i> attribute [attribute ID <b>0x"
out.println(" * " + type + " the <i>" + name + "</i> attribute [attribute ID <b>0x"
+ String.format("%04X", attribute.code) + "</b>].");
if (attribute.description.size() != 0) {
out.println(" * <p>");
Expand Down Expand Up @@ -384,7 +385,7 @@ protected void outputAttributeJavaDoc(PrintStream out, String type, ZigBeeXmlAtt
out.println(" * @param reportableChange {@link Object} delta required to trigger report");
}
} else if ("Set".equals(type)) {
out.println(" * @param " + stringToLowerCamelCase(attribute.name) + " the {@link "
out.println(" * @param " + stringToLowerCamelCase(name) + " the {@link "
+ getDataTypeClass(attribute) + "} attribute value to be set");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,22 @@ private void generateZclClusterClasses(ZigBeeXmlCluster cluster, String packageR
outputAttributeJavaDoc(out, "Set", attribute, zclDataType);
out.println(" @Deprecated");
if (attribute.arrayStart != null && attribute.arrayCount != null && attribute.arrayCount > 0) {
String name = attribute.name.replaceAll("\\{\\{count\\}\\}", "");
out.println(" public Future<CommandResult> set" + stringToUpperCamelCase(name).replace("_", "")
+ "(final int arrayOffset, final " + getDataTypeClass(attribute) + " value) {");
name = attribute.name.replaceAll("\\{\\{count\\}\\}", Integer.toString(attribute.arrayStart));
String baseName = attribute.name.replaceAll("\\{\\{count\\}\\}", "");
out.println(
" return write(serverAttributes.get(" + getEnum(name) + " + arrayOffset), value);");
" public Future<CommandResult> set" + stringToUpperCamelCase(baseName).replace("_", "")
+ "(final int arrayOffset, final " + getDataTypeClass(attribute) + " "
+ stringToLowerCamelCase(baseName) + ") {");
String name = attribute.name.replaceAll("\\{\\{count\\}\\}",
Integer.toString(attribute.arrayStart));
out.println(
" return write(serverAttributes.get(" + getEnum(name) + " + arrayOffset), "
+ stringToLowerCamelCase(baseName) + ");");
} else {
out.println(" public Future<CommandResult> set"
+ stringToUpperCamelCase(attribute.name).replace("_", "") + "(final "
+ getDataTypeClass(attribute) + " value) {");
out.println(" return write(serverAttributes.get(" + getEnum(attribute.name) + "), value);");
+ getDataTypeClass(attribute) + " " + stringToLowerCamelCase(attribute.name) + ") {");
out.println(" return write(serverAttributes.get(" + getEnum(attribute.name) + "), "
+ stringToLowerCamelCase(attribute.name) + ");");
}
out.println(" }");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public XBeeResponse sendRequest(final XBeeCommand command) {
}

/**
* Waits for a reponse of the requested class
* Waits for a response of the requested class
*
* @param eventClass the class to wait for
* @return response {@link Future} {@link XBeeCommand}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,16 @@ private boolean getIeeeAddress(final int networkAddress) throws InterruptedExcep
* @throws InterruptedException
*/
private boolean getAssociatedNodes(final int networkAddress) throws InterruptedException, ExecutionException {
Integer startIndex = 0;
int startIndex = 0;
int totalAssociatedDevices = 0;
Set<Integer> associatedDevices = new HashSet<>();

do {
// Request extended response, start index for associated list is 0
final IeeeAddressRequest ieeeAddressRequest = new IeeeAddressRequest(networkAddress, 1, startIndex);
ieeeAddressRequest.setDestinationAddress(new ZigBeeEndpointAddress(networkAddress));
final Future<CommandResult> resultFuture = networkManager.sendTransaction(ieeeAddressRequest, ieeeAddressRequest);
final Future<CommandResult> resultFuture = networkManager.sendTransaction(ieeeAddressRequest,
ieeeAddressRequest);
if (resultFuture == null) {
return false;
}
Expand All @@ -402,7 +403,7 @@ private boolean getAssociatedNodes(final int networkAddress) throws InterruptedE
logger.debug("NWK Discovery for {} IeeeAddressRequest returned {}", String.format("%04X", networkAddress),
ieeeAddressResponse);
if (ieeeAddressResponse != null && ieeeAddressResponse.getStatus() == ZdoStatus.SUCCESS
&& startIndex.equals(ieeeAddressResponse.getStartIndex())) {
&& startIndex == ieeeAddressResponse.getStartIndex()) {
associatedDevices.addAll(ieeeAddressResponse.getNwkAddrAssocDevList());

startIndex += ieeeAddressResponse.getNwkAddrAssocDevList().size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void shutdown() {
*/
public boolean setCryptoSuite(ZigBeeCryptoSuites requestedCryptoSuite) {
if (cbkeProvider == null || !cbkeProvider.getAvailableCryptoSuites().contains(requestedCryptoSuite)) {
logger.debug("{}: CBKE Key Establishment Server: Failed to set crypto suite to unsupported value {}",
logger.debug("{}: CBKE Key Establishment Server: Failed to set crypto suite to unsupported value {} {}",
ieeeAddress, requestedCryptoSuite,
cbkeProvider == null ? "[]" : cbkeProvider.getAvailableCryptoSuites());
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* <p>
* Code is auto-generated. Modifications may be overwritten!
*/
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2022-05-28T21:15:34Z")
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-05-18T20:27:57Z")
public class ZclAnalogInputBasicCluster extends ZclCluster {
/**
* The ZigBee Cluster Library Cluster ID
Expand Down Expand Up @@ -206,8 +206,8 @@ public ZclAnalogInputBasicCluster(final ZigBeeEndpoint zigbeeEndpoint) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setDescription(final String value) {
return write(serverAttributes.get(ATTR_DESCRIPTION), value);
public Future<CommandResult> setDescription(final String description) {
return write(serverAttributes.get(ATTR_DESCRIPTION), description);
}

/**
Expand Down Expand Up @@ -279,8 +279,8 @@ public String getDescription(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setMaxPresentValue(final Double value) {
return write(serverAttributes.get(ATTR_MAXPRESENTVALUE), value);
public Future<CommandResult> setMaxPresentValue(final Double maxPresentValue) {
return write(serverAttributes.get(ATTR_MAXPRESENTVALUE), maxPresentValue);
}

/**
Expand Down Expand Up @@ -352,8 +352,8 @@ public Double getMaxPresentValue(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setMinPresentValue(final Double value) {
return write(serverAttributes.get(ATTR_MINPRESENTVALUE), value);
public Future<CommandResult> setMinPresentValue(final Double minPresentValue) {
return write(serverAttributes.get(ATTR_MINPRESENTVALUE), minPresentValue);
}

/**
Expand Down Expand Up @@ -420,8 +420,8 @@ public Double getMinPresentValue(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setOutOfService(final Boolean value) {
return write(serverAttributes.get(ATTR_OUTOFSERVICE), value);
public Future<CommandResult> setOutOfService(final Boolean outOfService) {
return write(serverAttributes.get(ATTR_OUTOFSERVICE), outOfService);
}

/**
Expand Down Expand Up @@ -486,8 +486,8 @@ public Boolean getOutOfService(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setPresentValue(final Double value) {
return write(serverAttributes.get(ATTR_PRESENTVALUE), value);
public Future<CommandResult> setPresentValue(final Double presentValue) {
return write(serverAttributes.get(ATTR_PRESENTVALUE), presentValue);
}

/**
Expand Down Expand Up @@ -569,8 +569,8 @@ public Double getPresentValue(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setReliability(final Integer value) {
return write(serverAttributes.get(ATTR_RELIABILITY), value);
public Future<CommandResult> setReliability(final Integer reliability) {
return write(serverAttributes.get(ATTR_RELIABILITY), reliability);
}

/**
Expand Down Expand Up @@ -648,8 +648,8 @@ public Integer getReliability(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setResolution(final Double value) {
return write(serverAttributes.get(ATTR_RESOLUTION), value);
public Future<CommandResult> setResolution(final Double resolution) {
return write(serverAttributes.get(ATTR_RESOLUTION), resolution);
}

/**
Expand Down Expand Up @@ -741,8 +741,8 @@ public Double getResolution(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setStatusFlags(final Integer value) {
return write(serverAttributes.get(ATTR_STATUSFLAGS), value);
public Future<CommandResult> setStatusFlags(final Integer statusFlags) {
return write(serverAttributes.get(ATTR_STATUSFLAGS), statusFlags);
}

/**
Expand Down Expand Up @@ -873,8 +873,8 @@ public Integer getStatusFlags(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setEngineeringUnits(final Integer value) {
return write(serverAttributes.get(ATTR_ENGINEERINGUNITS), value);
public Future<CommandResult> setEngineeringUnits(final Integer engineeringUnits) {
return write(serverAttributes.get(ATTR_ENGINEERINGUNITS), engineeringUnits);
}

/**
Expand Down Expand Up @@ -976,8 +976,8 @@ public Integer getEngineeringUnits(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setApplicationType(final Integer value) {
return write(serverAttributes.get(ATTR_APPLICATIONTYPE), value);
public Future<CommandResult> setApplicationType(final Integer applicationType) {
return write(serverAttributes.get(ATTR_APPLICATIONTYPE), applicationType);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* <p>
* Code is auto-generated. Modifications may be overwritten!
*/
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2022-05-28T21:15:34Z")
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2024-05-18T20:27:57Z")
public class ZclBallastConfigurationCluster extends ZclCluster {
/**
* The ZigBee Cluster Library Cluster ID
Expand Down Expand Up @@ -394,8 +394,8 @@ public Future<CommandResult> setBallastStatusReporting(final int minInterval, fi
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setMinLevel(final Integer value) {
return write(serverAttributes.get(ATTR_MINLEVEL), value);
public Future<CommandResult> setMinLevel(final Integer minLevel) {
return write(serverAttributes.get(ATTR_MINLEVEL), minLevel);
}

/**
Expand Down Expand Up @@ -480,8 +480,8 @@ public Integer getMinLevel(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setMaxLevel(final Integer value) {
return write(serverAttributes.get(ATTR_MAXLEVEL), value);
public Future<CommandResult> setMaxLevel(final Integer maxLevel) {
return write(serverAttributes.get(ATTR_MAXLEVEL), maxLevel);
}

/**
Expand Down Expand Up @@ -560,8 +560,8 @@ public Integer getMaxLevel(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setPowerOnLevel(final Integer value) {
return write(serverAttributes.get(ATTR_POWERONLEVEL), value);
public Future<CommandResult> setPowerOnLevel(final Integer powerOnLevel) {
return write(serverAttributes.get(ATTR_POWERONLEVEL), powerOnLevel);
}

/**
Expand Down Expand Up @@ -624,8 +624,8 @@ public Integer getPowerOnLevel(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setPowerOnFadeTime(final Integer value) {
return write(serverAttributes.get(ATTR_POWERONFADETIME), value);
public Future<CommandResult> setPowerOnFadeTime(final Integer powerOnFadeTime) {
return write(serverAttributes.get(ATTR_POWERONFADETIME), powerOnFadeTime);
}

/**
Expand Down Expand Up @@ -691,8 +691,8 @@ public Integer getPowerOnFadeTime(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setIntrinsicBallastFactor(final Integer value) {
return write(serverAttributes.get(ATTR_INTRINSICBALLASTFACTOR), value);
public Future<CommandResult> setIntrinsicBallastFactor(final Integer intrinsicBallastFactor) {
return write(serverAttributes.get(ATTR_INTRINSICBALLASTFACTOR), intrinsicBallastFactor);
}

/**
Expand Down Expand Up @@ -769,8 +769,8 @@ public Integer getIntrinsicBallastFactor(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setBallastFactorAdjustment(final Integer value) {
return write(serverAttributes.get(ATTR_BALLASTFACTORADJUSTMENT), value);
public Future<CommandResult> setBallastFactorAdjustment(final Integer ballastFactorAdjustment) {
return write(serverAttributes.get(ATTR_BALLASTFACTORADJUSTMENT), ballastFactorAdjustment);
}

/**
Expand Down Expand Up @@ -851,8 +851,8 @@ public Integer getBallastFactorAdjustment(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampQuantity(final Integer value) {
return write(serverAttributes.get(ATTR_LAMPQUANTITY), value);
public Future<CommandResult> setLampQuantity(final Integer lampQuantity) {
return write(serverAttributes.get(ATTR_LAMPQUANTITY), lampQuantity);
}

/**
Expand Down Expand Up @@ -920,8 +920,8 @@ public Integer getLampQuantity(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampType(final String value) {
return write(serverAttributes.get(ATTR_LAMPTYPE), value);
public Future<CommandResult> setLampType(final String lampType) {
return write(serverAttributes.get(ATTR_LAMPTYPE), lampType);
}

/**
Expand Down Expand Up @@ -987,8 +987,8 @@ public String getLampType(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampManufacturer(final String value) {
return write(serverAttributes.get(ATTR_LAMPMANUFACTURER), value);
public Future<CommandResult> setLampManufacturer(final String lampManufacturer) {
return write(serverAttributes.get(ATTR_LAMPMANUFACTURER), lampManufacturer);
}

/**
Expand Down Expand Up @@ -1056,8 +1056,8 @@ public String getLampManufacturer(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampRatedHours(final Integer value) {
return write(serverAttributes.get(ATTR_LAMPRATEDHOURS), value);
public Future<CommandResult> setLampRatedHours(final Integer lampRatedHours) {
return write(serverAttributes.get(ATTR_LAMPRATEDHOURS), lampRatedHours);
}

/**
Expand Down Expand Up @@ -1134,8 +1134,8 @@ public Integer getLampRatedHours(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampBurnHours(final Integer value) {
return write(serverAttributes.get(ATTR_LAMPBURNHOURS), value);
public Future<CommandResult> setLampBurnHours(final Integer lampBurnHours) {
return write(serverAttributes.get(ATTR_LAMPBURNHOURS), lampBurnHours);
}

/**
Expand Down Expand Up @@ -1217,8 +1217,8 @@ public Integer getLampBurnHours(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampAlarmMode(final Integer value) {
return write(serverAttributes.get(ATTR_LAMPALARMMODE), value);
public Future<CommandResult> setLampAlarmMode(final Integer lampAlarmMode) {
return write(serverAttributes.get(ATTR_LAMPALARMMODE), lampAlarmMode);
}

/**
Expand Down Expand Up @@ -1295,8 +1295,8 @@ public Integer getLampAlarmMode(final long refreshPeriod) {
* @deprecated As of release 1.2.0, replaced by {@link #writeAttribute(int attributeId, Object value)}
*/
@Deprecated
public Future<CommandResult> setLampBurnHoursTripPoint(final Integer value) {
return write(serverAttributes.get(ATTR_LAMPBURNHOURSTRIPPOINT), value);
public Future<CommandResult> setLampBurnHoursTripPoint(final Integer lampBurnHoursTripPoint) {
return write(serverAttributes.get(ATTR_LAMPBURNHOURSTRIPPOINT), lampBurnHoursTripPoint);
}

/**
Expand Down
Loading

0 comments on commit cd4eef1

Please sign in to comment.