Fix shutdown crash when AudioRendererHosts outlive the ResourceScheduler
[chromium-blink-merge.git] / device / hid / test_report_descriptors.cc
blobcf2758bee3e5ecf4dae94fe476d70ed0cd09f2b2
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "device/hid/test_report_descriptors.h"
7 namespace device {
9 // Digitizer descriptor from HID descriptor tool
10 // http://www.usb.org/developers/hidpage/dt2_4.zip
11 const uint8 kDigitizer[] = {
12 0x05, 0x0d, // Usage Page (Digitizer)
13 0x09, 0x01, // Usage (0x1)
14 0xa1, 0x01, // Collection (Application)
15 0x85, 0x01, // Report ID (0x1)
16 0x09, 0x21, // Usage (0x21)
17 0xa1, 0x00, // Collection (Physical)
18 0x05, 0x01, // Usage Page (Generic Desktop)
19 0x09, 0x30, // Usage (0x30)
20 0x09, 0x31, // Usage (0x31)
21 0x75, 0x10, // Report Size (16)
22 0x95, 0x02, // Report Count (2)
23 0x15, 0x00, // Logical Minimum (0)
24 0x26, 0xe0, 0x2e, // Logical Maximum (12000)
25 0x35, 0x00, // Physical Minimum (0)
26 0x45, 0x0c, // Physical Maximum (12)
27 0x65, 0x13, // Unit (19)
28 0x55, 0x00, // Unit Exponent (0)
29 0xa4, // Push
30 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
31 0x05, 0x0d, // Usage Page (Digitizer)
32 0x09, 0x32, // Usage (0x32)
33 0x09, 0x44, // Usage (0x44)
34 0x09, 0x42, // Usage (0x42)
35 0x15, 0x00, // Logical Minimum (0)
36 0x25, 0x01, // Logical Maximum (1)
37 0x35, 0x00, // Physical Minimum (0)
38 0x45, 0x01, // Physical Maximum (1)
39 0x75, 0x01, // Report Size (1)
40 0x95, 0x03, // Report Count (3)
41 0x65, 0x00, // Unit (0)
42 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
43 0x95, 0x01, // Report Count (1)
44 0x75, 0x05, // Report Size (5)
45 0x81, 0x03, // Input (Con|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
46 0xc0, // End Collection
47 0x85, 0x02, // Report ID (0x2)
48 0x09, 0x20, // Usage (0x20)
49 0xa1, 0x00, // Collection (Physical)
50 0xb4, // Pop
51 0xa4, // Push
52 0x09, 0x30, // Usage (0x30)
53 0x09, 0x31, // Usage (0x31)
54 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
55 0x05, 0x0d, // Usage Page (Digitizer)
56 0x09, 0x32, // Usage (0x32)
57 0x15, 0x00, // Logical Minimum (0)
58 0x25, 0x01, // Logical Maximum (1)
59 0x35, 0x00, // Physical Minimum (0)
60 0x45, 0x01, // Physical Maximum (1)
61 0x65, 0x00, // Unit (0)
62 0x75, 0x01, // Report Size (1)
63 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
64 0x05, 0x09, // Usage Page (Button)
65 0x19, 0x00, // Usage Minimum (0)
66 0x29, 0x10, // Usage Maximum (16)
67 0x25, 0x10, // Logical Maximum (16)
68 0x75, 0x05, // Report Size (5)
69 0x81, 0x40, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|Null|BitF)
70 0x75, 0x02, // Report Size (2)
71 0x81, 0x01, // Input (Con|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
72 0xc0, // End Collection
73 0x85, 0x03, // Report ID (0x3)
74 0x05, 0x0d, // Usage Page (Digitizer)
75 0x09, 0x20, // Usage (0x20)
76 0xa1, 0x00, // Collection (Physical)
77 0xb4, // Pop
78 0x09, 0x30, // Usage (0x30)
79 0x09, 0x31, // Usage (0x31)
80 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
81 0x05, 0x0d, // Usage Page (Digitizer)
82 0x09, 0x32, // Usage (0x32)
83 0x09, 0x44, // Usage (0x44)
84 0x75, 0x01, // Report Size (1)
85 0x15, 0x00, // Logical Minimum (0)
86 0x25, 0x01, // Logical Maximum (1)
87 0x35, 0x00, // Physical Minimum (0)
88 0x45, 0x01, // Physical Maximum (1)
89 0x65, 0x00, // Unit (0)
90 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
91 0x95, 0x06, // Report Count (6)
92 0x81, 0x03, // Input (Con|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
93 0x09, 0x30, // Usage (0x30)
94 0x15, 0x00, // Logical Minimum (0)
95 0x25, 0x7f, // Logical Maximum (127)
96 0x35, 0x00, // Physical Minimum (0)
97 0x45, 0x2d, // Physical Maximum (45)
98 0x67, 0x11, 0xe1, // Unit (57617)
99 0x00, 0x00, // Default
100 0x55, 0x04, // Unit Exponent (4)
101 0x75, 0x08, // Report Size (8)
102 0x95, 0x01, // Report Count (1)
103 0x81, 0x12, // Input (Dat|Arr|Rel|NoWrp|NoLin|Prf|NoNull|BitF)
104 0xc0, // End Collection
105 0xc0 // End Collection
107 const size_t kDigitizerSize = sizeof(kDigitizer);
109 // Keyboard descriptor from HID descriptor tool
110 // http://www.usb.org/developers/hidpage/dt2_4.zip
111 const uint8 kKeyboard[] = {
112 0x05, 0x01, // Usage Page (Generic Desktop)
113 0x09, 0x06, // Usage (0x6)
114 0xa1, 0x01, // Collection (Application)
115 0x05, 0x07, // Usage Page (Keyboard)
116 0x19, 0xe0, // Usage Minimum (224)
117 0x29, 0xe7, // Usage Maximum (231)
118 0x15, 0x00, // Logical Minimum (0)
119 0x25, 0x01, // Logical Maximum (1)
120 0x75, 0x01, // Report Size (1)
121 0x95, 0x08, // Report Count (8)
122 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
123 0x95, 0x01, // Report Count (1)
124 0x75, 0x08, // Report Size (8)
125 0x81, 0x03, // Input (Con|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
126 0x95, 0x05, // Report Count (5)
127 0x75, 0x01, // Report Size (1)
128 0x05, 0x08, // Usage Page (Led)
129 0x19, 0x01, // Usage Minimum (1)
130 0x29, 0x05, // Usage Maximum (5)
131 0x91, 0x02, // Output (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
132 0x95, 0x01, // Report Count (1)
133 0x75, 0x03, // Report Size (3)
134 0x91, 0x03, // Output (Con|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
135 0x95, 0x06, // Report Count (6)
136 0x75, 0x08, // Report Size (8)
137 0x15, 0x00, // Logical Minimum (0)
138 0x25, 0x65, // Logical Maximum (101)
139 0x05, 0x07, // Usage Page (Keyboard)
140 0x19, 0x00, // Usage Minimum (0)
141 0x29, 0x65, // Usage Maximum (101)
142 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
143 0xc0 // End Collection
145 const size_t kKeyboardSize = sizeof(kKeyboard);
147 // Monitor descriptor from HID descriptor tool
148 // http://www.usb.org/developers/hidpage/dt2_4.zip
149 const uint8 kMonitor[] = {
150 0x05, 0x80, // Usage Page (Monitor 0)
151 0x09, 0x01, // Usage (0x1)
152 0xa1, 0x01, // Collection (Application)
153 0x85, 0x01, // Report ID (0x1)
154 0x15, 0x00, // Logical Minimum (0)
155 0x26, 0xff, 0x00, // Logical Maximum (255)
156 0x75, 0x08, // Report Size (8)
157 0x95, 0x80, // Report Count (128)
158 0x09, 0x02, // Usage (0x2)
159 0xb2, 0x02, 0x01, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|Buff)
160 0x85, 0x02, // Report ID (0x2)
161 0x95, 0xf3, // Report Count (243)
162 0x09, 0x03, // Usage (0x3)
163 0xb2, 0x02, 0x01, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|Buff)
164 0x85, 0x03, // Report ID (0x3)
165 0x05, 0x82, // Usage Page (Monitor 2)
166 0x95, 0x01, // Report Count (1)
167 0x75, 0x10, // Report Size (16)
168 0x26, 0xc8, 0x00, // Logical Maximum (200)
169 0x09, 0x10, // Usage (0x10)
170 0xb1, 0x02, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
171 0x85, 0x04, // Report ID (0x4)
172 0x25, 0x64, // Logical Maximum (100)
173 0x09, 0x12, // Usage (0x12)
174 0xb1, 0x02, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
175 0x95, 0x06, // Report Count (6)
176 0x26, 0xff, 0x00, // Logical Maximum (255)
177 0x09, 0x16, // Usage (0x16)
178 0x09, 0x18, // Usage (0x18)
179 0x09, 0x1a, // Usage (0x1A)
180 0x09, 0x6c, // Usage (0x6C)
181 0x09, 0x6e, // Usage (0x6E)
182 0x09, 0x70, // Usage (0x70)
183 0xb1, 0x02, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
184 0x85, 0x05, // Report ID (0x5)
185 0x25, 0x7f, // Logical Maximum (127)
186 0x09, 0x20, // Usage (0x20)
187 0x09, 0x22, // Usage (0x22)
188 0x09, 0x30, // Usage (0x30)
189 0x09, 0x32, // Usage (0x32)
190 0x09, 0x42, // Usage (0x42)
191 0x09, 0x44, // Usage (0x44)
192 0xb1, 0x02, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
193 0xc0 // End Collection
195 const size_t kMonitorSize = sizeof(kMonitor);
197 // Mouse descriptor from HID descriptor tool
198 // http://www.usb.org/developers/hidpage/dt2_4.zip
199 const uint8 kMouse[] = {
200 0x05, 0x01, // Usage Page (Generic Desktop)
201 0x09, 0x02, // Usage (0x2)
202 0xa1, 0x01, // Collection (Application)
203 0x09, 0x01, // Usage (0x1)
204 0xa1, 0x00, // Collection (Physical)
205 0x05, 0x09, // Usage Page (Button)
206 0x19, 0x01, // Usage Minimum (1)
207 0x29, 0x03, // Usage Maximum (3)
208 0x15, 0x00, // Logical Minimum (0)
209 0x25, 0x01, // Logical Maximum (1)
210 0x95, 0x03, // Report Count (3)
211 0x75, 0x01, // Report Size (1)
212 0x81, 0x02, // Input (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
213 0x95, 0x01, // Report Count (1)
214 0x75, 0x05, // Report Size (5)
215 0x81, 0x03, // Input (Con|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF)
216 0x05, 0x01, // Usage Page (Generic Desktop)
217 0x09, 0x30, // Usage (0x30)
218 0x09, 0x31, // Usage (0x31)
219 0x15, 0x81, // Logical Minimum (129)
220 0x25, 0x7f, // Logical Maximum (127)
221 0x75, 0x08, // Report Size (8)
222 0x95, 0x02, // Report Count (2)
223 0x81, 0x06, // Input (Dat|Arr|Abs|NoWrp|Lin|Prf|NoNull|BitF)
224 0xc0, // End Collection
225 0xc0 // End Collection
227 const size_t kMouseSize = sizeof(kMouse);
229 // Logitech Unifying receiver descriptor
230 const uint8 kLogitechUnifyingReceiver[] = {
231 0x06, 0x00, 0xFF, // Usage Page (Vendor)
232 0x09, 0x01, // Usage (0x1)
233 0xA1, 0x01, // Collection (Application)
234 0x85, 0x10, // Report ID (0x10)
235 0x75, 0x08, // Report Size (8)
236 0x95, 0x06, // Report Count (6)
237 0x15, 0x00, // Logical Minimum (0)
238 0x26, 0xFF, 0x00, // Logical Maximum (255)
239 0x09, 0x01, // Usage (0x1)
240 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
241 0x09, 0x01, // Usage (0x1)
242 0x91, 0x00, // Output (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
243 0xC0, // End Collection
244 0x06, 0x00, 0xFF, // Usage Page (Vendor)
245 0x09, 0x02, // Usage (0x2)
246 0xA1, 0x01, // Collection (Application)
247 0x85, 0x11, // Report ID (0x11)
248 0x75, 0x08, // Report Size (8)
249 0x95, 0x13, // Report Count (19)
250 0x15, 0x00, // Logical Minimum (0)
251 0x26, 0xFF, 0x00, // Logical Maximum (255)
252 0x09, 0x02, // Usage (0x2)
253 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
254 0x09, 0x02, // Usage (0x2)
255 0x91, 0x00, // Output (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
256 0xC0, // End Collection
257 0x06, 0x00, 0xFF, // Usage Page (Vendor)
258 0x09, 0x04, // Usage (0x4)
259 0xA1, 0x01, // Collection (Application)
260 0x85, 0x20, // Report ID (0x20)
261 0x75, 0x08, // Report Size (8)
262 0x95, 0x0E, // Report Count (14)
263 0x15, 0x00, // Logical Minimum (0)
264 0x26, 0xFF, 0x00, // Logical Maximum (255)
265 0x09, 0x41, // Usage (0x41)
266 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
267 0x09, 0x41, // Usage (0x41)
268 0x91, 0x00, // Output (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
269 0x85, 0x21, // Report ID (0x21)
270 0x95, 0x1F, // Report Count (31)
271 0x15, 0x00, // Logical Minimum (0)
272 0x26, 0xFF, 0x00, // Logical Maximum (255)
273 0x09, 0x42, // Usage (0x42)
274 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
275 0x09, 0x42, // Usage (0x42)
276 0x91, 0x00, // Output (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF)
277 0xC0 // End Collection
279 const size_t kLogitechUnifyingReceiverSize = sizeof(kLogitechUnifyingReceiver);
281 } // namespace device