Skip to content
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

Usage Page should not be per HIDCollectionInfo but per HIDReportItem #76

Open
toyoshim opened this issue Aug 9, 2021 · 2 comments
Open

Comments

@toyoshim
Copy link

toyoshim commented Aug 9, 2021

Current WebHID spec expects Usage Page appears once per HIDCollectionInfo, but there is no such restriction in the USB HID spec AFAIK. Usage Page is just a Global Item like other global ones such as Logical Minimum, etc. These field appear per HIDReportItem, and Usage Page should be so too.

HID1_11.pdf, Device Class Definition for Human Interface Devices (HID) Firmware Specification Version 1.11, P.25 shows an example report that contains the case.

@toyoshim
Copy link
Author

toyoshim commented Aug 9, 2021

Hum..., does the spec expect Usage Page is encoded as an upper 16-bits of Usage if it is different from collection wide global value?

@nondebug
Copy link
Collaborator

Yes, the Usage Page will be in the upper 16-bits of the usages, usageMinimum, and usageMaximum members of HIDReportItem. If no Usage Page has been set when the Input, Output, or Feature item is encountered then the value in the upper 16-bits should be zero.

It looks like the spec is missing an initialization step in the "parse the report descriptor" steps so it never actually gets initialized to zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants