Fix issue #439 Incorrect Output Voltage on CPS*EFPCLCD, including libusb-1.0 branch #1246
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the problem whereby the Output Voltage on Cyberpower CPS*EPFCLCD UPS's is masked.
The root cause is due to a legal but inappropriate Report Descriptor published as part of the HID.
Specifically it looks liike Report ID 17 was deleted (ie Report 16 is followed by Report 18) with the result that there was no attempt to reset the LogMin and LogMax values from those used by the HighVoltageTransfer Item for those used by the Output Voltage.
The fix conditionally corrects the Report Descriptor structure by applying the same LogMin and LogMax values used by the Input Voltage Item after first checking the issue exists.
The fix creates a generic framework for fixing Report Descriptors that can be used for different manufacturers by adding code to the appropriate subdriver rather than polluting the main code with UPS specific exceptions.
This version is identical to PR #1245 but is for the libusb-1.0 branch.