karalabe / hid

Gopher Interface Devices (USB HID)
Other
263 stars 131 forks source link

Add the option to use hidraw as a backend on linux instead of libusb, by a build tag #4

Closed aaazalea closed 5 years ago

aaazalea commented 7 years ago

HIDAPI has 4 backends, including a native linux HID driver (hidraw) backend which can be used on linux instead of libusb. There are various advantages and disadvantages of using this backend instead, one of which is that it supports getting the Usage and UsagePage for HID devices, which some uses (u2f, for example) use to identify devices.

This PR adds a build tag, // +build hidraw that causes the package to build with hidraw as a backend instead of libusb on linux.

Miscellaneously, the test for gowchar was failing so I modified it to use the right name for a constant.

nathanjsweet commented 6 years ago

+1 on this pr

aaazalea commented 5 years ago

Closing this since I haven't been working at the company whose project needed it in a while, and I don't think said project even exists anymore, and it doesn't look like it's being merged anytime soon.