hid_get_input_report: Correct number of bytes_returned#232
hid_get_input_report: Correct number of bytes_returned#232Youw merged 1 commit intolibusb:masterfrom
Conversation
|
And definitely breaks something else |
What does it break? Do you have an example of an HID device where the old code returned the correct number of bytes? Can you share the HID Report Descriptor of this device and the number of read bytes returned? |
|
So I guess |
|
@todbot any chance you could take a look at this? I don't have any device that uses all of: feature, input and interrupt reports. |
|
ping @todbot |
|
While unable to verify it myself, I tried to check MS documentation for details on What bothers me here, is that same applies for But: @JoergAtGithub, any chance you can verify the behavior of |
|
Why do you expect reading 3 bytes, if report size for both of the reports is 8 as per descriptor? |
|
1 byte ReportID + ReportSize (8Bit) * ReportCount(2) |
|
In such case we're at square 1 again, as without this patch you'd get 2 and 3 byts. What about the content of the buffer? Is it updated as expected? |
|
I patched hid_get_input_report, and tested as requested hid_get_feature_report. The later is not related to my patch. |
|
I understad that. I'm just trying to get the full picture, as I'd expect an idential usage from two almost identical functions with pretty much identical API. |
|
One more thing. |
|
Win7 |
|
http://janaxelson.com/hidpage.htm |
|
I will try to dig out my device with my test FW last time I used to test libusb Windows HID backend. It is a simple mod of Jan's Generic HID FW. |
|
So I just got my example up and running with libusb HID backend. I need to update my test code (INTERFACE to MYINTERFACE to avoid conflict) a bit. First pair (char) is report ID (Out report ID and Input report ID), the results seems to be okay I will see if I can translate the code to hidapi and then test again. |
|
I think I can use hidapitester. |
|
From my test, it seems to me the input report is correct with hidapi. |
|
From my test, it seems to me there is an issue with feature report readback with hidapi. It says reading 4 bytes. |
|
Report Descriptor of the device. |
|
Unfortunately hidapitester does not test the correctness of hid_get_input_report(). |
The change is also confirmed by Tim Roberts' answer to my query in libusb-devel mailing list. Similar changes need to be implemented for feature report as well. |
|
@JoergAtGithub or @Youw Is it possible for you to create another pull request for feature report? I am poor at git myself and I do not want to touch the code for hidapi (or libusb as well). |
|
Yes, I will. |
This originally tested/confirmed by @mcuee. Confirmed the expected behavior by Tim Roberts https://sourceforge.net/p/libusb/mailman/message/37303650/. Relates to: #232.

This fixes #229