New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong info for HID Usage and HID Usage page #1401
Comments
The recommendation is to use HIDAPI library and not libusb. |
Any objection if I close this issue? The Windows HID backen will not receive much attentions unless there are serious bugs. Its usage is highly discouraged. |
Reference: |
We would consider a patch or merge request though, if if is well explained and with demonstrations of before and after. Note there might not be much people around that are familiar with the HID code and can review it properly. To convince me, someone without much HID or HID backend insight, it would need a clear explanation of what goes wrong in this bug report, more than "this might cause confusion". You are receiving a DT report corresponding to the last interface instead of the interface that you specify? |
Okay, I will keep this issue open. |
I was trying to get HID report descriptor by using libUSB v1.0.26, and I found that there is a weird thing in windows_winusb.c.
When we call libusb_open, the function might use the function hid_open in windows_winusb.c, and it will initialize the hid_handle first.
The hid_handle will be stored in handle_priv->interface_handle[i].api_handle.
However, after storing the handle info in api_handle, it will use the final interface handle to get the usage and usagepage directly.
This might cause confusion if we try to get different interface HID report descriptor by using control transfer like the following code shows.
I wonder if there are any concerns that we only receive the usage and usage page of the last interface instead of storing the usage and usage page information for each interface.
Therefore, I add a workaround in hid_submit_control_transfer to update the usage and usagepage by interface.
I'm new to libUSB, not sure if this is the best place to add this. Or is there a function that we can use to update the usage/usagepage ourselves?
Let me know if I need to provide any.
Thanks.
The text was updated successfully, but these errors were encountered: