Skip to content

Clarify the Usage handling during parsing

Peter Hutterer requested to merge whot/hid-tools:wip/usage-handling into master

Detailed in the commit messages (and previously !112 (merged)), the Usage Page handling is a bit quirky, thanks to some ambiguity in Sections 6.2.2.8 and 6.2.2.7. In short, sometimes we need to take the Usage Page at time of parsing, sometimes we need to use the one at time of a Main Item.

This patchset replaces the current C-like code with two objects, Usage and UsageRange that handle their own behaviour (mostly). It's a lot more code than the previous approach, but it's more contained, asserts for unexpected cases and documents the requirements. Oh, and it has tests too.

Merge request reports

Loading