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

FTY remerge from master as of 2024-06-15 #2472

Merged
merged 121 commits into from
Jun 26, 2024

Conversation

jimklimov
Copy link
Member

Bump the copy of 42ity fork contents to minimize difference with the master. Follows up from previous resync in PR #2275 (made before NUT v2.8.2 was released, including some features backported from the FTY branch), and related to #1316 generally.

Regarding parts that originated in 42ITy and were upstreamed earlier, the nutconf effort got largely updated in the upstream during the past few months.

ntd and others added 30 commits May 21, 2024 22:44
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]>
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]>
Signed-off-by: Nicola Fontana <[email protected]>
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]>
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]>
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]>
Identification fields are now queried from the device. Also
"battery.charge" is now set properly.

Signed-off-by: Nicola Fontana <[email protected]>
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]>
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]>
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]>
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]>
Signed-off-by: Nicola Fontana <[email protected]>
`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]>
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]>
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]>
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]>
These devices seem to be picky on what you use to set parameters.

Signed-off-by: Nicola Fontana <[email protected]>
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]>
Add `net start/stop` docs and practical support to `nut.exe`
…umping envvars - so dev/tester knows how they can proceed

Signed-off-by: Jim Klimov <[email protected]>
… O_NDELAY means EOF (the other side closed socket) [networkupstools#2484]

Signed-off-by: Jim Klimov <[email protected]>
Make sure NUT driver daemons close their Unix sockets when their counterparts do
Combine several small PRs for issue networkupstools#1316 and their NEWS entries
…lenstest

Define an `auglenstestsdir` to install the augeas `test_nut.aug` file
…al-nutscan.la to simplify nut-scanner recipes

Initiated in DMF branch by commit 4fec99a

Signed-off-by: Jim Klimov <[email protected]>
…d of defining them at first assignment

Would help later when merging DMF/FTY branches; for now just
a bit of syntactic sugar and reduction of diffs against them.

Signed-off-by: Jim Klimov <[email protected]>
…ase after recent recipe changes

Signed-off-by: Jim Klimov <[email protected]>
…e (is flag now)

Lingered in FTY branch, long gone in master.

Signed-off-by: Jim Klimov <[email protected]>
…mmonstr.la

Initially that embedding was done to help libnutscan builds with libcommonstr.la
helper, but then a separate link with libnutwincompat.la was back-ported - so
this line removal helps both to constrain the helper size/scope, and against a
build-time conflict.

Signed-off-by: Jim Klimov <[email protected]>
…serial-nutscan

Port recipe for `libserial-nutscan.la` from DMF/FTY branch and clean up nut-scanner makefile
…wincompat-nutscan

Revise `libwincompat.la` vs. `libcommonstr.la` helpers in `libnutscan` build recipe
clients/upsclient.h: include sys/types.h
@jimklimov jimklimov merged commit 033ba47 into networkupstools:FTY Jun 26, 2024
9 checks passed
@jimklimov jimklimov deleted the FTY-remerge-20240615 branch June 26, 2024 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DMF NUT Data/Dynamic Mapping File/Format/Functionality feature impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) nutconf NUT configuration library and tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants