Commit 6c92c11
committed
Track HID report offsets per report ID per USB spec
Per USB HID spec section 6.2.2.7, each report ID defines an independent
report structure with its own bit offset tracking. Previously, offsets
were reset when encountering a new report ID or at collection boundaries,
causing incorrect parsing of descriptors with multiple reports.
Changes:
- Add report_offset_map_t to map report IDs to their offsets
- Track offsets separately for each report ID in parser state
- Remove incorrect offset resets on report ID change and collection end
- Add helper functions for offset lookup and creation
Local items still reset after Main items and Global items persist,
matching spec requirements.1 parent e317f16 commit 6c92c11
2 files changed
+39
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
36 | 57 | | |
37 | 58 | | |
38 | 59 | | |
39 | 60 | | |
40 | 61 | | |
41 | 62 | | |
42 | 63 | | |
| 64 | + | |
| 65 | + | |
43 | 66 | | |
44 | | - | |
45 | | - | |
| 67 | + | |
| 68 | + | |
46 | 69 | | |
47 | 70 | | |
48 | 71 | | |
| |||
62 | 85 | | |
63 | 86 | | |
64 | 87 | | |
65 | | - | |
66 | | - | |
67 | 88 | | |
68 | 89 | | |
69 | 90 | | |
| |||
98 | 119 | | |
99 | 120 | | |
100 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
101 | 126 | | |
102 | 127 | | |
103 | 128 | | |
| |||
106 | 131 | | |
107 | 132 | | |
108 | 133 | | |
109 | | - | |
| 134 | + | |
110 | 135 | | |
111 | 136 | | |
112 | 137 | | |
| |||
117 | 142 | | |
118 | 143 | | |
119 | 144 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 145 | | |
124 | 146 | | |
125 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | | - | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
159 | 167 | | |
160 | 168 | | |
161 | 169 | | |
| |||
0 commit comments