OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Use the <code>chrome.hid</code> API to interact with connected HID devices. | 5 // Use the <code>chrome.hid</code> API to interact with connected HID devices. |
6 // This API provides access to HID operations from within the context of an app. | 6 // This API provides access to HID operations from within the context of an app. |
7 // Using this API, apps can function as drivers for hardware devices. | 7 // Using this API, apps can function as drivers for hardware devices. |
8 namespace hid { | 8 namespace hid { |
9 // HID usage pair. Each enumerated device interface exposes an array of | 9 // HID top-level collection attributes. |
10 // these objects. Values correspond to those defined by the | 10 // Each enumerated device interface exposes an array of these objects. |
11 // <a href="http://www.usb.org/developers/devclass_docs/HID1_11.pdf> | |
12 // HID device class specification</a>. | |
13 // |usage_page|: HID usage page identifier. | 11 // |usage_page|: HID usage page identifier. |
not at google - send to devlin
2014/07/02 20:50:35
s/usage_page/usagePage/
jracle (use Gerrit)
2014/07/02 21:04:13
Oops, good catch! Thanks
On 2014/07/02 20:50:35,
| |
14 // |usage|: Page-defined usage identifier. | 12 // |usage|: Page-defined usage identifier. |
15 dictionary HidUsageAndPage { | 13 // |reportIds|: Report IDs which belong to the collection and to its children. |
16 long usage_page; | 14 dictionary HidCollectionInfo { |
15 long usagePage; | |
17 long usage; | 16 long usage; |
17 long[] reportIds; | |
18 }; | 18 }; |
19 | 19 |
20 // Returned by <code>getDevices</code> functions to describes a connected HID | 20 // Returned by <code>getDevices</code> functions to describes a connected HID |
21 // device. Use <code>connect</code> to connect to any of the returned devices. | 21 // device. Use <code>connect</code> to connect to any of the returned devices. |
22 // |deviceId|: Device opaque ID. | 22 // |deviceId|: Device opaque ID. |
23 // |vendorId|: Vendor ID. | 23 // |vendorId|: Vendor ID. |
24 // |productId|: Product ID. | 24 // |productId|: Product ID. |
25 // |usages|: HID usage pairs exposed by underlying Top-level collections. | 25 // |collections|: Top-level collections from this device's report descriptor. |
26 // |maxInputReportSize|: Top-level collection's max input report size. | |
27 // |maxOutputReportSize|: Top-level collection's max output report size. | |
28 // |maxFeatureReportSize|: Top-level collection's max feature report size. | |
26 dictionary HidDeviceInfo { | 29 dictionary HidDeviceInfo { |
27 long deviceId; | 30 long deviceId; |
28 long vendorId; | 31 long vendorId; |
29 long productId; | 32 long productId; |
30 HidUsageAndPage[] usages; | 33 HidCollectionInfo[] collections; |
34 long maxInputReportSize; | |
35 long maxOutputReportSize; | |
36 long maxFeatureReportSize; | |
31 }; | 37 }; |
32 | 38 |
33 // Returned by <code>connect</code> to represent a communication session with | 39 // Returned by <code>connect</code> to represent a communication session with |
34 // an HID device. Must be closed with a call to <code>disconnect</code>. | 40 // an HID device. Must be closed with a call to <code>disconnect</code>. |
35 dictionary HidConnectInfo { | 41 dictionary HidConnectInfo { |
36 long connectionId; | 42 long connectionId; |
37 }; | 43 }; |
38 | 44 |
39 // Searching criteria to enumerate devices with. | 45 // Searching criteria to enumerate devices with. |
40 dictionary GetDevicesOptions { | 46 dictionary GetDevicesOptions { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // |connectionId|: The connection to read Input report from. | 121 // |connectionId|: The connection to read Input report from. |
116 // |reportId|: The report ID to use, or <code>0</code> if none. | 122 // |reportId|: The report ID to use, or <code>0</code> if none. |
117 // |data|: The report data. | 123 // |data|: The report data. |
118 // |callback|: The callback to invoke once the write is finished. | 124 // |callback|: The callback to invoke once the write is finished. |
119 static void sendFeatureReport(long connectionId, | 125 static void sendFeatureReport(long connectionId, |
120 long reportId, | 126 long reportId, |
121 ArrayBuffer data, | 127 ArrayBuffer data, |
122 SendCallback callback); | 128 SendCallback callback); |
123 }; | 129 }; |
124 }; | 130 }; |
OLD | NEW |