Repository navigation
Update nutdrv_qx_megatec.c - #2980
Conversation
Added a parameter battery.runtime
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…`I` query [networkupstools#2980] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
@gksmsk : thanks for the contribution! I've updated the code a bit (regarding comments and a NEWS announcement), and found that the reply in your example seems shorter than documented in other protocol dialects (38 vs 39 bytes, including the finishing If it is really 38, we need to check the parsing code to see if all 5 of these table lines need to be updated to expect the shorter reply as valid (and the last line to pick one byte less into firmware version). |
|
❌ Build nut 2.8.3.3261-master failed (commit 6ce41abd17 by @jimklimov) |
|
what protocol dialect, Q1 I or others? |
|
we already tested it. That's no problem. |
The I can't rule out that this response may in fact differ per dialect/vendor/model though, and that maybe the copy-pasted table entries are wrong for some devices and don't in fact work for somebody, but I did not quickly find any complaints about these fields being missing/broken, so... |
…o "I" in nutdrv_qx::megatec subdriver [networkupstools#2980] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…er for "I" query, and any length after byte 28 till end of reply is ups.firmware [networkupstools#2980] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…er for "I" query, and any length after byte 28 till end of reply is ups.firmware [networkupstools#2980] Also finally bump the subdriver version for this PR Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
|
I've quickly reviewed the structure spec at @gksmsk : can you please re-test updated code with your device (which model is it BTW)? Also, can you please post a data dump from Thanks for the PR! |
|
✅ Build nut 2.8.3.3265-master completed (commit d3a9671742 by @jimklimov) |
|
@gksmsk : have you tested this recent update over the past days? Does the driver behave better (or not-worse) than before it? Did you have any chance to test with different devices talking a Qx dialect (especially regarding non-regression compared to older NUT builds)? |
Update nutdrv_qx_megatec.c SVN-Git-Bridge: nut-3e341d2d9c-3fc79f1e8124 e8c6124 Bridge-Author: Jim Klimov <jimklimov+nut@gmail.com> Bridge-Author-Date: 2025-06-12T09:37:27+02:00 Bridge-Committer: GitHub <noreply@github.com> Bridge-Committer-Date: 2025-06-12T09:37:27+02:00 From: Jim Klimov <jimklimov+nut@gmail.com> git-svn-id: file:///mnt/export/subversion/nut/trunk@4369 5f2f2009-99cd-4845-9af7-39d0aa6e3748
Added a parameter battery.runtime
General points
Described the changes in the PR submission or a separate issue, e.g.
known published or discovered protocols, applicable hardware (expected
compatible and actually tested/developed against), limitations, etc.
There may be multiple commits in the PR, aligned and commented with
a functional change. Notably, coding style changes better belong in a
separate PR, but certainly in a dedicated commit to simplify reviews
of "real" changes in the other commits. Similarly for typo fixes in
comments or text documents.
Please star NUT on GitHub, this helps with sponsorships! ;)
Frequent "underwater rocks" for driver addition/update PRs
Revised existing driver families and added a sub-driver if applicable
(
nutdrv_qx,usbhid-ups...) or added a brand new driver in the othercase.
Did not extend obsoleted drivers with new hardware support features
(notably
blazerand other single-device family drivers for Qx protocols,except the new
nutdrv_qxwhich should cover them all).For updated existing device drivers, bumped the
DRIVER_VERSIONmacroor its equivalent.
For USB devices (HID or not), revised that the driver uses unique
VID/PID combinations, or raised discussions when this is not the case
(several vendors do use same interface chips for unrelated protocols).
For new USB devices, built and committed the changes for the
scripts/upower/95-upower-hid.hwdbfileProposed NUT data mapping is aligned with existing
docs/nut-names.txtfile. If the device exposes useful data points not listed in the file, the
experimental.*namespace can be used as documented there, and discussionshould be raised on the NUT Developers mailing list to standardize the new
concept.
Updated
data/driver.list.inif applicable (new tested device info)Frequent "underwater rocks" for general C code PRs
structure layout and alignment in memory, endianness (layout of bytes and
bits in memory for multi-byte numeric types), or use of generic
intwherelanguage or libraries dictate the use of
size_t(orssize_tsometimes).Progress and errors are handled with
upsdebugx(),upslogx(),fatalx()and related methods, not with directprintf()orexit().Similarly, NUT helpers are used for error-checked memory allocation and
string operations (except where customized error handling is needed,
such as unlocking device ports, etc.)
Coding style (including whitespace for indentations) follows precedent
in the code of the file, and examples/guide in
docs/developers.txtfile.For newly added files, the
Makefile.amrecipes were updated and themake distchecktarget passes.General documentation updates
Updated
docs/acknowledgements.txt(for vendor-backed device support)Added or updated manual page information in
docs/man/*.txtfilesand corresponding recipe lists in
docs/man/Makefile.amfor new pagesPassed
make spellcheck, updated spell-checking dictionary in thedocs/nut.dictfile if needed (did not remove any words -- themakerule printout in case of changes suggests how to maintain it).
Additional work may be needed after posting this PR
Propose a PR for NUT DDL with detailed device data dumps from tests
against real hardware (the more models, the better).
Address NUT CI farm build failures for the PR: testing on numerous
platforms and toolkits can expose issues not seen on just one system.
the changed codebase.