Skip to content

Issue 441+legrand updated 3 test issue 1023 fallout qemu#1139

Closed
blecher-at wants to merge 26 commits intonetworkupstools:issue_1023_fallout_qemufrom
blecher-at:issue-441+legrand_updated-3-test-issue_1023_fallout_qemu
Closed

Issue 441+legrand updated 3 test issue 1023 fallout qemu#1139
blecher-at wants to merge 26 commits intonetworkupstools:issue_1023_fallout_qemufrom
blecher-at:issue-441+legrand_updated-3-test-issue_1023_fallout_qemu

Conversation

@blecher-at
Copy link
Copy Markdown
Contributor

No description provided.

zykh and others added 26 commits July 28, 2018 22:13
Since some devices, when communicating via USB, don't close their replies to our commands/queries with the expected (and mandated by the specs) CR, rendering the driver almost useless as protocols get one less character than they expect, update the various USB subdrivers (leaving out the ones that rely on a CR to stop reading from the device) to add the missing terminating CR in such cases (as long as we get anything usable).
This is a bit of a cheat, but, at least for now, it will do -- not to mention the fact that it is way less invasive than touching all the places of the driver that expect a closing CR and all the qx2nut tables of the various protocols.

Close networkupstools#441
As per protocol documentation, data is sent by the device with unsigned integers of 8, 16 or 32 bits, with errors/special values being:
- for uint16: 0xFFFF and 0xFFFE,
- for uint32: 0xFFFFFFFF.
Alas, those values are (and, probably, have always been) actually reported in the documentation (mostly) as if their types were not unsigned (so, in decimal: -1, and -2) and the metasys driver used them like that, converting the values to non-fixed width signed types (int and long) and then expecting a value of -1 or -2 to signal a particular event, but this only happens on platforms where int is exactly 16 bits, and long 32 bits.
So, leave values as unsigned types (adjusting all the printf formats accordingly), and use the right hex values, instead.
Add to the metasys driver a few new models (Meta System DHEA, and others now branded Legrand) speaking the Meta System UPS protocol.
The added command is only supported by devices with an 'id code' >= 14, while for other, older, models the command is not enabled by default, and the user has to perform a specific procedure via serial to enable it (where supported).
As per the provided protocol: see nut-website's 570c1e5e9f1fb4f82abef9359897b5159e88fc50
Also, fix name of "HF Line /2".
Also, specify that Legrand Multiplug is USB-only.
As per the provided protocol: see nut-website's 66d30c90401ff7929b25e5a87f9299b728f861ea
Address build warnings from CI
@blecher-at blecher-at changed the base branch from master to issue_1023_fallout_qemu October 20, 2021 14:34
@blecher-at blecher-at changed the base branch from issue_1023_fallout_qemu to master October 20, 2021 14:41
@blecher-at blecher-at changed the base branch from master to issue_1023_fallout_qemu October 20, 2021 14:42
@blecher-at blecher-at closed this Oct 20, 2021
@blecher-at
Copy link
Copy Markdown
Contributor Author

For testing/demo. do not merge (!) see discussion here #1138 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants