[Nut-upsdev] Creating a new NUT USB HID subdriver

Rob Groner rgroner at RTD.com
Fri Mar 14 20:29:53 UTC 2014


Thanks to the great help here, I now have a UPS spitting out something resembling a report descriptor.  So since I seem destined to have to create a new USB HID subdriver, I figured I'd get started on the path.

I followed all of the directions on the web....I used the script to generate the usbhid subdriver, feeding it the output of the usbhid-ups driver from reading my UPS.  All that worked pretty well.  I copied it in the right dir, and made the changes to usbhid-ups.c and Makefile.am.

Upon compile, my subdriver failed due to the is_usb_device_supported().  I guess it used to take the vendor and product ID separately, but now just takes a pointer to the USB device.  So, remove everything after the first "hd" (so it passes in just the HIDDevice_t hd instead).

It works pretty good after that.  However, if I'm going to tailor my hid2nut table, it would really help if there was some master list of all the paths (input.voltage, battery.temperature, etc) NUT supports, instead of having to dig through different driver files to see what's available.  Is there some list?

Rob






More information about the Nut-upsdev mailing list