Closed micolous closed 1 year ago
I have already considered moving to hidraw by default for many times, each time however, there was some problem with old linux kernel.
However since the thing with usage & usage_page is pretty annoying (and even if in docs I doubt everyone will read them), I think its finally time to move to the hidraw backend by default. That will also make it fine to configure out the usage and usage_page properties.
If some projects want to support old kernels, they can switch to the libusb backend, and remove usage & usage_page parts in code.
Should be fixed now, I published a 2.0.0 version of the crate because of the breaking change. Also took the time to remove all the deprecated items from the code.
Thanks for the prompt response!
PS: While hidraw
is now the default, the module documentation still says libusb
is the default on the master
branch at the time of writing:
Thanks for noticing, fixed it and published new crate version so it gets updated on docs.rs
linux-static-libusb
lacks functionality that other platforms have, such asDeviceInfo::usage()
andDeviceInfo::usage_page()
. It appearslibusb
doesn't support this at all, and hidapi works around it with a rather invasive detach/reattach process, and the documentation is difficult to find.There are no warnings in
hidapi-rs
' documentation that this isn't supported with the defaultlinux-static-libusb
, which led to a frustrating troubleshooting process trying to "fix" something that worked fine on macOS and Windows. 🙃Expected behaviour
DeviceInfo::usage
andDeviceInfo::usage_page
should be entirely removed when usinglibusb
backends on Linuxlinux-static-hidraw
should be seriously considered as the default backend on Linux (where this functionality actually works)