-
Notifications
You must be signed in to change notification settings - Fork 443
hidraw: report only Top-Level Usage_page/Usage pairs as 'unique' devices #601
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
Conversation
|
@haata I'd appreciate if you could check/review it as the original author of this routine. |
To be consistent with Windows/macOS (OS-level implementations). Fixes: #298
This seems to help comparied to git main. If we ignore the two Windows pseudo HID devices ( Please take note that I did not connect the bluetooth mouse to Linux so that one is correct. Output from Ubuntu 20.04 Linux (not using sudo to print the report descriptors)
Windows 11 output from git main (dual boot laptop, so the devices should be the same).
More detailed Linux output using Ubuntu 23.04, using sudo to dump the report descriptors. click for the details
|
Yeap, all looks good. |
In general this is an improvements, but the HID standard does not define something like a usage pair. While there must be always a
The same meaning for the collection with extended 32Bit Usage:
And you could also do this - than the
To implement this correct, the Usage Page should only be use in Lines 361 to 364 in 78c6ade
here the 32 Bit extended usage value has to be defined. Depending on the size of the Usage 0, 1, 2, or 4 Bytes of the Usage Page value have to be used to fill the missing bytes of the 32Bit usage value, which defines the nature of the following collection.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good.
@mcuee do you know if that device is HID compliant? You can only run this on windows, but https://www.usb.org/compliancetools has USB3CV (that's usually what you want). The hid test can be quite useful in this case.
The device |
Thanks @JoergAtGithub.
To support this case I'd need to have access to at least one device that implements 32-bit usage in the descriptor. I'll keep a support of that to #454 for now.
I suspected something like that might be the case but wasn't sure. I'll try to implement that case as part of this PR. |
Do you have such a device with 32bit usage? Would you please post the HID Report Descriptor of that device? I will see if I can find one or change my test device to have that. |
Oh, we could craft/change any descriptor for that. |
- support for 32bit Usage items;
It was easier than I thought. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay. Looks good!
If any issues - will fix those later in master |
To be consistent with Windows/macOS (OS-level implementations).
Fixes: #298
Fixes: #454