OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/hid/test_report_descriptors.h" | 5 #include "device/hid/test_report_descriptors.h" |
6 | 6 |
7 namespace device { | 7 namespace device { |
8 | 8 |
9 // Digitizer descriptor from HID descriptor tool | 9 // Digitizer descriptor from HID descriptor tool |
10 // http://www.usb.org/developers/hidpage/dt2_4.zip | 10 // http://www.usb.org/developers/hidpage/dt2_4.zip |
11 const uint8 kDigitizer[] = { | 11 const uint8_t kDigitizer[] = { |
12 0x05, 0x0d, // Usage Page (Digitizer) | 12 0x05, 0x0d, // Usage Page (Digitizer) |
13 0x09, 0x01, // Usage (0x1) | 13 0x09, 0x01, // Usage (0x1) |
14 0xa1, 0x01, // Collection (Application) | 14 0xa1, 0x01, // Collection (Application) |
15 0x85, 0x01, // Report ID (0x1) | 15 0x85, 0x01, // Report ID (0x1) |
16 0x09, 0x21, // Usage (0x21) | 16 0x09, 0x21, // Usage (0x21) |
17 0xa1, 0x00, // Collection (Physical) | 17 0xa1, 0x00, // Collection (Physical) |
18 0x05, 0x01, // Usage Page (Generic Desktop) | 18 0x05, 0x01, // Usage Page (Generic Desktop) |
19 0x09, 0x30, // Usage (0x30) | 19 0x09, 0x30, // Usage (0x30) |
20 0x09, 0x31, // Usage (0x31) | 20 0x09, 0x31, // Usage (0x31) |
21 0x75, 0x10, // Report Size (16) | 21 0x75, 0x10, // Report Size (16) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 0x75, 0x08, // Report Size (8) | 101 0x75, 0x08, // Report Size (8) |
102 0x95, 0x01, // Report Count (1) | 102 0x95, 0x01, // Report Count (1) |
103 0x81, 0x12, // Input (Dat|Arr|Rel|NoWrp|NoLin|Prf|NoNull|BitF) | 103 0x81, 0x12, // Input (Dat|Arr|Rel|NoWrp|NoLin|Prf|NoNull|BitF) |
104 0xc0, // End Collection | 104 0xc0, // End Collection |
105 0xc0 // End Collection | 105 0xc0 // End Collection |
106 }; | 106 }; |
107 const size_t kDigitizerSize = sizeof(kDigitizer); | 107 const size_t kDigitizerSize = sizeof(kDigitizer); |
108 | 108 |
109 // Keyboard descriptor from HID descriptor tool | 109 // Keyboard descriptor from HID descriptor tool |
110 // http://www.usb.org/developers/hidpage/dt2_4.zip | 110 // http://www.usb.org/developers/hidpage/dt2_4.zip |
111 const uint8 kKeyboard[] = { | 111 const uint8_t kKeyboard[] = { |
112 0x05, 0x01, // Usage Page (Generic Desktop) | 112 0x05, 0x01, // Usage Page (Generic Desktop) |
113 0x09, 0x06, // Usage (0x6) | 113 0x09, 0x06, // Usage (0x6) |
114 0xa1, 0x01, // Collection (Application) | 114 0xa1, 0x01, // Collection (Application) |
115 0x05, 0x07, // Usage Page (Keyboard) | 115 0x05, 0x07, // Usage Page (Keyboard) |
116 0x19, 0xe0, // Usage Minimum (224) | 116 0x19, 0xe0, // Usage Minimum (224) |
117 0x29, 0xe7, // Usage Maximum (231) | 117 0x29, 0xe7, // Usage Maximum (231) |
118 0x15, 0x00, // Logical Minimum (0) | 118 0x15, 0x00, // Logical Minimum (0) |
119 0x25, 0x01, // Logical Maximum (1) | 119 0x25, 0x01, // Logical Maximum (1) |
120 0x75, 0x01, // Report Size (1) | 120 0x75, 0x01, // Report Size (1) |
121 0x95, 0x08, // Report Count (8) | 121 0x95, 0x08, // Report Count (8) |
(...skipping 17 matching lines...) Expand all Loading... |
139 0x05, 0x07, // Usage Page (Keyboard) | 139 0x05, 0x07, // Usage Page (Keyboard) |
140 0x19, 0x00, // Usage Minimum (0) | 140 0x19, 0x00, // Usage Minimum (0) |
141 0x29, 0x65, // Usage Maximum (101) | 141 0x29, 0x65, // Usage Maximum (101) |
142 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) | 142 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) |
143 0xc0 // End Collection | 143 0xc0 // End Collection |
144 }; | 144 }; |
145 const size_t kKeyboardSize = sizeof(kKeyboard); | 145 const size_t kKeyboardSize = sizeof(kKeyboard); |
146 | 146 |
147 // Monitor descriptor from HID descriptor tool | 147 // Monitor descriptor from HID descriptor tool |
148 // http://www.usb.org/developers/hidpage/dt2_4.zip | 148 // http://www.usb.org/developers/hidpage/dt2_4.zip |
149 const uint8 kMonitor[] = { | 149 const uint8_t kMonitor[] = { |
150 0x05, 0x80, // Usage Page (Monitor 0) | 150 0x05, 0x80, // Usage Page (Monitor 0) |
151 0x09, 0x01, // Usage (0x1) | 151 0x09, 0x01, // Usage (0x1) |
152 0xa1, 0x01, // Collection (Application) | 152 0xa1, 0x01, // Collection (Application) |
153 0x85, 0x01, // Report ID (0x1) | 153 0x85, 0x01, // Report ID (0x1) |
154 0x15, 0x00, // Logical Minimum (0) | 154 0x15, 0x00, // Logical Minimum (0) |
155 0x26, 0xff, 0x00, // Logical Maximum (255) | 155 0x26, 0xff, 0x00, // Logical Maximum (255) |
156 0x75, 0x08, // Report Size (8) | 156 0x75, 0x08, // Report Size (8) |
157 0x95, 0x80, // Report Count (128) | 157 0x95, 0x80, // Report Count (128) |
158 0x09, 0x02, // Usage (0x2) | 158 0x09, 0x02, // Usage (0x2) |
159 0xb2, 0x02, 0x01, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|Buff) | 159 0xb2, 0x02, 0x01, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|Buff) |
(...skipping 29 matching lines...) Expand all Loading... |
189 0x09, 0x32, // Usage (0x32) | 189 0x09, 0x32, // Usage (0x32) |
190 0x09, 0x42, // Usage (0x42) | 190 0x09, 0x42, // Usage (0x42) |
191 0x09, 0x44, // Usage (0x44) | 191 0x09, 0x44, // Usage (0x44) |
192 0xb1, 0x02, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF) | 192 0xb1, 0x02, // Feature (Dat|Arr|Rel|NoWrp|Lin|Prf|NoNull|BitF) |
193 0xc0 // End Collection | 193 0xc0 // End Collection |
194 }; | 194 }; |
195 const size_t kMonitorSize = sizeof(kMonitor); | 195 const size_t kMonitorSize = sizeof(kMonitor); |
196 | 196 |
197 // Mouse descriptor from HID descriptor tool | 197 // Mouse descriptor from HID descriptor tool |
198 // http://www.usb.org/developers/hidpage/dt2_4.zip | 198 // http://www.usb.org/developers/hidpage/dt2_4.zip |
199 const uint8 kMouse[] = { | 199 const uint8_t kMouse[] = { |
200 0x05, 0x01, // Usage Page (Generic Desktop) | 200 0x05, 0x01, // Usage Page (Generic Desktop) |
201 0x09, 0x02, // Usage (0x2) | 201 0x09, 0x02, // Usage (0x2) |
202 0xa1, 0x01, // Collection (Application) | 202 0xa1, 0x01, // Collection (Application) |
203 0x09, 0x01, // Usage (0x1) | 203 0x09, 0x01, // Usage (0x1) |
204 0xa1, 0x00, // Collection (Physical) | 204 0xa1, 0x00, // Collection (Physical) |
205 0x05, 0x09, // Usage Page (Button) | 205 0x05, 0x09, // Usage Page (Button) |
206 0x19, 0x01, // Usage Minimum (1) | 206 0x19, 0x01, // Usage Minimum (1) |
207 0x29, 0x03, // Usage Maximum (3) | 207 0x29, 0x03, // Usage Maximum (3) |
208 0x15, 0x00, // Logical Minimum (0) | 208 0x15, 0x00, // Logical Minimum (0) |
209 0x25, 0x01, // Logical Maximum (1) | 209 0x25, 0x01, // Logical Maximum (1) |
(...skipping 10 matching lines...) Expand all Loading... |
220 0x25, 0x7f, // Logical Maximum (127) | 220 0x25, 0x7f, // Logical Maximum (127) |
221 0x75, 0x08, // Report Size (8) | 221 0x75, 0x08, // Report Size (8) |
222 0x95, 0x02, // Report Count (2) | 222 0x95, 0x02, // Report Count (2) |
223 0x81, 0x06, // Input (Dat|Arr|Abs|NoWrp|Lin|Prf|NoNull|BitF) | 223 0x81, 0x06, // Input (Dat|Arr|Abs|NoWrp|Lin|Prf|NoNull|BitF) |
224 0xc0, // End Collection | 224 0xc0, // End Collection |
225 0xc0 // End Collection | 225 0xc0 // End Collection |
226 }; | 226 }; |
227 const size_t kMouseSize = sizeof(kMouse); | 227 const size_t kMouseSize = sizeof(kMouse); |
228 | 228 |
229 // Logitech Unifying receiver descriptor | 229 // Logitech Unifying receiver descriptor |
230 const uint8 kLogitechUnifyingReceiver[] = { | 230 const uint8_t kLogitechUnifyingReceiver[] = { |
231 0x06, 0x00, 0xFF, // Usage Page (Vendor) | 231 0x06, 0x00, 0xFF, // Usage Page (Vendor) |
232 0x09, 0x01, // Usage (0x1) | 232 0x09, 0x01, // Usage (0x1) |
233 0xA1, 0x01, // Collection (Application) | 233 0xA1, 0x01, // Collection (Application) |
234 0x85, 0x10, // Report ID (0x10) | 234 0x85, 0x10, // Report ID (0x10) |
235 0x75, 0x08, // Report Size (8) | 235 0x75, 0x08, // Report Size (8) |
236 0x95, 0x06, // Report Count (6) | 236 0x95, 0x06, // Report Count (6) |
237 0x15, 0x00, // Logical Minimum (0) | 237 0x15, 0x00, // Logical Minimum (0) |
238 0x26, 0xFF, 0x00, // Logical Maximum (255) | 238 0x26, 0xFF, 0x00, // Logical Maximum (255) |
239 0x09, 0x01, // Usage (0x1) | 239 0x09, 0x01, // Usage (0x1) |
240 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) | 240 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 0x26, 0xFF, 0x00, // Logical Maximum (255) | 272 0x26, 0xFF, 0x00, // Logical Maximum (255) |
273 0x09, 0x42, // Usage (0x42) | 273 0x09, 0x42, // Usage (0x42) |
274 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) | 274 0x81, 0x00, // Input (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) |
275 0x09, 0x42, // Usage (0x42) | 275 0x09, 0x42, // Usage (0x42) |
276 0x91, 0x00, // Output (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) | 276 0x91, 0x00, // Output (Dat|Var|Rel|NoWrp|Lin|Prf|NoNull|BitF) |
277 0xC0 // End Collection | 277 0xC0 // End Collection |
278 }; | 278 }; |
279 const size_t kLogitechUnifyingReceiverSize = sizeof(kLogitechUnifyingReceiver); | 279 const size_t kLogitechUnifyingReceiverSize = sizeof(kLogitechUnifyingReceiver); |
280 | 280 |
281 } // namespace device | 281 } // namespace device |
OLD | NEW |