[Nut-upsdev] Changes to usbhid-ups driver

Arjen de Korte nut+devel at de-korte.org
Tue Sep 4 07:41:40 UTC 2007


>> It would probably only be a problem for devices that don't have their
>> serial number in (usb_device *)descriptor.iSerialNumber, but rather in
>> "UPS.PowerSummary.iSerialNumber" (like in the belkin-hid subdriver).
> The Belkin device gives its serial number in both places. The one in
> UPS.PowerSummary.iSerialNumber is strictly for the convenience of
> being able to display the serial number with upsc. It's not necessary
> for matching.

In that case, the better option would be in the HID-to-NUT translation
table for Belkin, like

{ "ups.serial", 0, 0, "UPS.PowerSummary.iSerialNumber", NULL, "%s",
HU_FLAG_OK, stringid_conversion },

Come to think of it, this is probably valid for many other devices as
well. Only in case there is no way to reach a variable through the report
descriptor (or it requires lots of additional processing), it might be
useful to do this via the vendor specific formatting routines. Or if we
want to use them in the 'matching = delayed' that entered usbhid-ups
recently.

Best regards, Arjen




More information about the Nut-upsdev mailing list