Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move check for LogMax encoding error to parsing of report description #1226

Merged

Conversation

nbriggs
Copy link
Contributor

@nbriggs nbriggs commented Dec 15, 2021

At least one UPS [APC Back-UPS BX1600MI FW:294201G -302201G] is known
to have encoding errors in its USB HID report description such that a
conforming interpretation of the encoded LogicalMaximum value
indicates that it is -1 and the resulting LogicalMin..LogicalMax range
is 0..-1.

The actual report values read are correctly encoded. Rather than log
a range error each time a value is read we can detect the encoding
error when the report description is read (once, at startup) and
adjust for the encoding error at that time.

Closes #1208

nbriggs and others added 2 commits December 15, 2021 09:24
At least one UPS [APC Back-UPS BX1600MI FW:294201G -302201G] is known
to have encoding errors in its USB HID report description such that a
conforming interpretation of the encoded LogicalMaximum value
indicates that it is -1 and the resulting LogicalMin..LogicalMax range
is 0..-1.

The actual report values read are correctly encoded.  Rather than log
a range error each time a value is read we can detect the encoding
error when the report description is read (once, at startup) and
adjust for the encoding error at that time.
Fix whitespace in recent changes for LogMin/LogMax rectification
@jimklimov jimklimov added the USB label Dec 20, 2021
@jimklimov
Copy link
Member

Thanks for pursuing this!

@jimklimov jimklimov merged commit cefc807 into networkupstools:master Dec 20, 2021
@nbriggs
Copy link
Contributor Author

nbriggs commented Dec 20, 2021

Happy to be able to help. Thanks for merging this. Ping me if it shows up anything else in this area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants