USB HID usage table

This usage table lets usbhidctl decode the HID data correctly for the APC RS/XS1000's.

This work was obtained from riccardo@torrini.org.

Note that the default /usr/share/misc/usb_hid_usages already contains entries for these a Power Device (132 or 0x84) and a Battery System (133 or 0x85).  It is interesting that usbhidctl shows the APC as using 0xff84 and 0xff84 for their values.  The HID Power Devices specification indicates 0x84 and 0x85.  There is at least one macro in /usr/include/dev/usb/usbhid.h which removes the high order bits.  Perhaps we need to do that when using the values.  Perhaps this macro:

#define HID_USAGE2(p,u) (((p) << 16) | u)
阅读全部