RFC: add hid_get_report_descriptor API function #451
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!451
Loading…
Reference in a new issue
No description provided.
Delete branch "get-descriptor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves: #249
Hey @Youw! Nice PR!
Can you please give some information about limitations of this approach?
I wanted to test it with a bunch of game controllers that I have and prepare tests for them. How to generate those
*_expected.rpt_descfiles?The main discussion is under #249.
And @JoergAtGithub did most of the job. I believe he has a tool to generate
rptfiles in one of his branches.@DJm00n I just opened PR #467 for the
pp_data_dump.exetool, that others can find it.There are basically 3 restrictions with this approach:
for example
is logically the same as:
because the preparsed data contain only the logical relevant information, we can only assume, how it looked byte-wise
--
But there are also some specified syntax cases (https://github.com/libusb/hidapi/pull/343#issuecomment-1002301673), which I implemented, but couldn't test, due to lack on real-world devices.
BTW: https://github.com/abend0c1/hidrdd/tree/master/examples contains all report descriptor examples published by the HID group in encoded form. If someone could program these into an HID device and than run
pp_data_dump.exe, we would have several edge cases covered in the test case.@ -64,10 +64,48 @@ void print_device(struct hid_device_info *cur_dev) {printf("\n");@ -0,0 +539,4 @@}else {result = EXIT_FAILURE;fprintf(stderr, "Reconstructed Report Descriptor has different content than expected\n");@ -0,0 +544,4 @@}else {result = EXIT_FAILURE;fprintf(stderr, "Reconstructed Report Descriptor has different size: %zu when expected %zu\n", report_descriptor_size, expected_report_descriptor_size);Just FYI of others that #343 and #467 have been integrated in the following feature branch.
https://github.com/libusb/hidapi/tree/get-descriptor
More test results here:
It has been a long way to get at this point.
Thanks everyone.
I'll keep this PR for a couple of days. If no objections/issues found - I'll merge it to master after that.
@Youw
This is a major improvement for HIDAPI. Just wondering if you want to start the process to release version 0.14. Thanks.
Release - not right now.
Bump a version - right away.