Skip to content

nutdrv_qx: add support for SNR-UPS-LID-XXXX#1008

Merged
jimklimov merged 9 commits intonetworkupstools:masterfrom
askazancev:nutdrv_qx_snr
Apr 20, 2021
Merged

nutdrv_qx: add support for SNR-UPS-LID-XXXX#1008
jimklimov merged 9 commits intonetworkupstools:masterfrom
askazancev:nutdrv_qx_snr

Conversation

@askazancev
Copy link
Copy Markdown
Contributor

Hello everyone.
In this PR I suggest adding support for UPSes series SNR-UPS-LID-XXXX to nutdrv_qx as a USB device.
An end-user should reference explicitly the snr subdriver in ups.conf settings because of using the same values of VendorID/ProductID as fabula_subdriver, fuji_subdriver, and krauler_subdriver.

Copy link
Copy Markdown
Member

@jimklimov jimklimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks quite solid to me, thanks! Got one comment for the code to fix, but otherwise looks ok to merge if nobody vetoes this in the next few days :)

Hope @zykh can take a look at this regarding Qx driver/protocol evolution in general.

Just in case, these devices do not need a separate subdriver file for some more complex logic or lookup tables as in e.g. https://github.com/networkupstools/nut/pull/638/files#diff-a94c7d9bf3942c23f12a818a5f0d6f75c8cfb259488ea3c1b93991c0e09b7ca6 ?

Comment thread drivers/nutdrv_qx.c
@jimklimov jimklimov requested review from clepple and zykh April 9, 2021 10:04
Missed a couple of new dictionary words
@networkupstools networkupstools deleted a comment from lgtm-com Bot Apr 9, 2021
@networkupstools networkupstools deleted a comment from lgtm-com Bot Apr 9, 2021
@networkupstools networkupstools deleted a comment from lgtm-com Bot Apr 9, 2021
@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Apr 9, 2021

This pull request introduces 1 alert when merging 2fcb47c into 4ac8683 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

Copy link
Copy Markdown
Member

@jimklimov jimklimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the added check, looks safer now :)

So, waiting a few days if someone else from the community has any concerns....

@jimklimov jimklimov added HCL need testing Code looks reasonable, but the feature would better be tested against hardware or OSes ready / code review Author (and CI) consider the PR worthy of human rewievers' time ready / gonna merge The PR is in final cycles leading to merge unless someone logs an objection before we hit the button USB labels Apr 9, 2021
@jimklimov
Copy link
Copy Markdown
Member

jimklimov commented Apr 20, 2021

One more point came up: the limitation of 102 bytes seemed reminiscent of something - the "hunnox" subdriver introduced with #638 seems to have spell it too at https://github.com/networkupstools/nut/pull/638/files/3a5a758dbbfbb8bdf22a45cdde06fe10d4e0249b#diff-cb890ac7b82cb7a4f861284bcf39cc4f168312b61cb9455eb2755e345c0aa627R922 although the list of commands on top of the (originally fabula) method differs from one introduced for "snr" here.

Maybe it does not mean anything, per comments in that codebase seems it originates from a limitation of interaction with USB. In that case however, the buflen passed to the USB routine writing its data into the buffer was not to EXCEED 102 bytes otherwise something froze for that driver developer.

Between that data point and yours about buffer needing to be at least 102 bytes, I now wonder if somewhere in spec it just would not say that the buffer must be exactly 102 bytes? :)

@jimklimov
Copy link
Copy Markdown
Member

Note: nutdrv_qx.c DRIVER_VERSION not bumped here since it was updated a minute ago with merge of PR #638.

@jimklimov jimklimov merged commit 4c3b8ed into networkupstools:master Apr 20, 2021
@lgtm-com
Copy link
Copy Markdown

lgtm-com Bot commented Apr 20, 2021

This pull request introduces 1 alert when merging 2624bc9 into 169b637 - view on LGTM.com

new alerts:

  • 1 for FIXME comment

Comment thread docs/man/nutdrv_qx.txt
*subdriver =* 'string'::
Select a serial-over-USB subdriver to use.
You have a choice between *cypress*, *fabula*, *fuji*, *hunnox*, *ippon*, *krauler*, *phoenix* and *sgs*.
You have a choice between *cypress*, *fabula*, *fuji*, *hunnox*, *ippon*, *krauler*, *phoenix*, *sgs* and *sgs*.
Copy link
Copy Markdown
Contributor Author

@askazancev askazancev Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double sgs. Should be snr and sgs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in master branch after merge, thanks for bringing the attention to this and sorry for the typo.

@jimklimov
Copy link
Copy Markdown
Member

jimklimov commented Apr 20, 2021 via email

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

Labels

HCL need testing Code looks reasonable, but the feature would better be tested against hardware or OSes ready / code review Author (and CI) consider the PR worthy of human rewievers' time ready / gonna merge The PR is in final cycles leading to merge unless someone logs an objection before we hit the button USB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants