[Nut-upsdev] Powercom support and sponsorship

Arjen de Korte nut+devel at de-korte.org
Wed Nov 11 11:42:15 UTC 2009


Citeren Arnaud Quette <arnaud.quette op free.fr>:

> @Alex: let us know when you receive a unit so that we can start the
> work. I (or Arjen or someone else) can bootstrap the work by created a
> subdriver to complete.

I committed the powercom-hid.[ch] subdriver to the trunk yesterday. I  
already added the known VID:PID combinations, so it should be able to  
automatically connect if a supported PowerCOM device is found.

What remains to be done, is the mapping of the HID paths to the  
corresponding NUT variables. You can probably re-use quite a bit of  
mappings from the existing *-hid subdrivers by matching the HID paths.

For instance, the line

   { "unmapped.ups.powersummary.idevicechemistry", 0, 0,  
"UPS.PowerSummary.iDeviceChemistry", NULL, "%.0f", 0, NULL },

should be replaced by

   { "battery.type", 0, 0, "UPS.PowerSummary.iDeviceChemistry", NULL,  
"%s", 0, stringid_conversion },

In general, it's probably easiest to just use

     egrep "UPS.PowerSummary.PresentStatus.ACPresent" *-hid.c

to find examples of other HID subdrivers with the same paths, than to  
try to figure out the mapping for yourself. The vast majority of  
mappings are already available in others already. After filling in  
these, working out the remainders is probably not such a big deal  
anymore.

Best regards, Arjen
-- 
Please keep list traffic on the list




More information about the Nut-upsdev mailing list