-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Add Bicker serial driver #2448
Add Bicker serial driver #2448
Commits on May 21, 2024
-
bicker_ser: Bicker UPSes based on PSZ-1063
Add a new driver for Bicker DC UPS systems based on the PSZ-1063 extension module. This includes UPSIC-1205, UPSIC-2403 and DC2412-UPS(LD) models. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a56281b - Browse repository at this point
Copy the full SHA a56281bView commit details -
bicker_ser: add shutdown support
The protocol supports shutdown after a custom delay settable between 0 and 255 seconds. Unfortunately the real device (UPSIC-2403D) seems to always enforce a 2 seconds delay. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 021472d - Browse repository at this point
Copy the full SHA 021472dView commit details -
data/driver.list.in: add bicker_ser based UPSes
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3ae6b50 - Browse repository at this point
Copy the full SHA 3ae6b50View commit details -
bicker_ser: add big-endian platform support
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0b53475 - Browse repository at this point
Copy the full SHA 0b53475View commit details -
bicker_ser: use length macros to increase expressiveness
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6538f2f - Browse repository at this point
Copy the full SHA 6538f2fView commit details -
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 67ffe25 - Browse repository at this point
Copy the full SHA 67ffe25View commit details -
NEWS.adoc: announce bicker_ser driver [networkupstools#2318]
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ffd42d1 - Browse repository at this point
Copy the full SHA ffd42d1View commit details -
bicker_ser: update protocol documentation
Bicker told me to refer to the UPS Gen software's user manual for more details on their protocol, and in fact that manual contains much more info. Added a summary of available commands to the comments, as a quick reference for feature implementation. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d5e7ce5 - Browse repository at this point
Copy the full SHA d5e7ce5View commit details -
bicker_ser: explicitly pass the command index
In the previous implementation the command index was always '\x03', as stated by the UPSIC manual. After new evidence has been found (UPS-Gen2 software user manual), it came out there are much more commands grouped in different indexes. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 162e39e - Browse repository at this point
Copy the full SHA 162e39eView commit details -
bicker_ser: refactor to allow more complex packet handling
I'm planning to add functions for reading strings, i.e. without knowing beforehand the size of the response packets. This required some refactoring of the receiving functions. Also, while at it, added docblocks to many Bicker functions, hopefully easing the maintenance in the future. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8abde1a - Browse repository at this point
Copy the full SHA 8abde1aView commit details -
bicker_ser: add more state variables
Identification fields are now queried from the device. Also "battery.charge" is now set properly. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eaddb34 - Browse repository at this point
Copy the full SHA eaddb34View commit details -
bicker_ser: use variable for low battery limit
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c659e31 - Browse repository at this point
Copy the full SHA c659e31View commit details -
bicker_ser: add parameter support
Added the needed infrastructure for getting and setting parameters. Actually the only parameter that is surely working is "ups.delay.start". Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a4c3767 - Browse repository at this point
Copy the full SHA a4c3767View commit details
Commits on May 22, 2024
-
bicker_ser: differentiate between error and unsupported
When a command is unsupported, the "\x01\x03\xEE\x07\x04" response packet is returned. This is different from a response packet with a wrong command index. WARNING: the "unsupported" packet has been found sperimentally and it is an undocumented feature. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ee71353 - Browse repository at this point
Copy the full SHA ee71353View commit details -
bicker_ser: fix string dstate setting
User provided strings could contain printf special sequences and as such they should never be used in the format argument of dstate_setinfo(). Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c9fed62 - Browse repository at this point
Copy the full SHA c9fed62View commit details -
bicker_ser: fix alignment and endianness problems
Accessing an uint16_t on odd addresses is not portable. Avoid having to deal with that issue by always constructing words mathematically from single bytes. This also solves any endianness difference. Signed-off-by: Nicola Fontana <[email protected]>
1Configuration menu - View commit details
-
Copy full SHA for c9ba796 - Browse repository at this point
Copy the full SHA c9ba796View commit details -
Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for beb26a6 - Browse repository at this point
Copy the full SHA beb26a6View commit details -
bicker_ser: use uint8_t for bytes instead of char
`char` is by default signed and (as the name implies) designed to access string characters. For accessing bytes, the `uint8_t` type is more appropriate. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0c80ece - Browse repository at this point
Copy the full SHA 0c80eceView commit details -
bicker_ser: use proper format modifiers in logs
Ensure the format string in logging messages is the correct one without subcasting. Furthermore, due to the promotion rules of the C language (where any given type, even unsigned, is promoted to int when possible), explicitly cast to unsigned where required. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4a33b3a - Browse repository at this point
Copy the full SHA 4a33b3aView commit details -
bicker_ser: refactor to clarify packet manipulation
Change BICKER_PACKET from a constant value to a macro that depends on the data length. This should make clear that the packet size depends directly from the data size. Refactored some code here and there trying to minimize the presence of magic numbers and clarify the intentions. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c78524c - Browse repository at this point
Copy the full SHA c78524cView commit details
Commits on May 23, 2024
-
bicker_ser: make parameter handling less error prone
Using an in/out struct and making some specific field mandatory is cumbersome and error prone. Now the data needed for setting or getting parameters is explicitly required by the arguments. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 27bdc87 - Browse repository at this point
Copy the full SHA 27bdc87View commit details -
bicker_ser: add sanity checks to bicker_set
These devices seem to be picky on what you use to set parameters. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fca9957 - Browse repository at this point
Copy the full SHA fca9957View commit details -
bicker_ser: expose mappable parameters
Every Bicker parameter that has a correspondence in nut-names.txt has been mapped. If the parameter is disabled on the device, no NUT variable is created. If the NUT variable is set to an empty string, the parameter is reset and disabled on the device and that NUT variable is removed. Signed-off-by: Nicola Fontana <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4cbe12d - Browse repository at this point
Copy the full SHA 4cbe12dView commit details