Skip to content

Commit

Permalink
Warn legacy code users of invalid serial option combination (qzind#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brett Berenz authored Jun 23, 2021
1 parent aca87ff commit 9e13b94
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/qz/communication/SerialOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ public SerialOptions(JSONObject serialOpts, boolean isOpening) {
}

if (!serialOpts.isNull("width")) {
try { responseFormat.fixedWidth = serialOpts.getInt("width"); }
try {
responseFormat.fixedWidth = serialOpts.getInt("width");
if (responseFormat.boundEnd.length > 0) {
log.warn("Combining 'width' property with 'end' property has undefined behavior and should not be used");
}
}
catch(JSONException e) { LoggerUtilities.optionWarn(log, "integer", "width", serialOpts.opt("width")); }
}
}
Expand Down

0 comments on commit 9e13b94

Please sign in to comment.