Port and use a variant of nut_usb_get_string()
for nut-scanner
#2626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially addresses #2615 (the part for
nut-scanner
scope), follows-up from PR #2604.Beside porting the method proposed by @tormodvolden in #2604 for
usb-common.c
, there were some other methods used by it that needed porting from libusb headers (inline, not dynamic symbols).Checked with libusb-0.1 and libusb-1.0 builds on a physical machine, that the resulting
nut-scanner -U
still finds an Eaton USB UPS (although with model not impacted by the issue from #1925 / #2604).Also found and fixed a problem with stashing of SOPATH and SONAME for libraries seen during build (so
libnutscan
would search for those exact filenames first), as this did not play well with the few "GNU ld script" files instead of binary dynamic libraries, as found on the tested system. Probably can be seen as a fallout of PR #2504 et al for issue #2431.