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 | 9 // HID usage pair. Each enumerated device interface exposes an array of |
10 // HID usage pair. | 10 // these objects. Values correspond to those defined by the |
11 // |usage_page|: HID usage page. | 11 // <a href="http://www.usb.org/developers/devclass_docs/HID1_11.pdf> |
12 // |usage|: HID usage. | 12 // HID device class specification</a>. |
| 13 // |usage_page|: HID usage page identifier. |
| 14 // |usage|: Page-defined usage identifier. |
13 dictionary HidUsageAndPage { | 15 dictionary HidUsageAndPage { |
14 long usage_page; | 16 long usage_page; |
15 long usage; | 17 long usage; |
16 }; | 18 }; |
17 | 19 |
18 // Returned by <code>getDevices</code> functions to describes a connected HID | 20 // Returned by <code>getDevices</code> functions to describes a connected HID |
19 // 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. |
20 // |deviceId|: Device opaque ID. | 22 // |deviceId|: Device opaque ID. |
21 // |vendorId|: Vendor ID. | 23 // |vendorId|: Vendor ID. |
22 // |productId|: Product ID. | 24 // |productId|: Product ID. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // |connectionId|: The connection to read Input report from. | 115 // |connectionId|: The connection to read Input report from. |
114 // |reportId|: The report ID to use, or <code>0</code> if none. | 116 // |reportId|: The report ID to use, or <code>0</code> if none. |
115 // |data|: The report data. | 117 // |data|: The report data. |
116 // |callback|: The callback to invoke once the write is finished. | 118 // |callback|: The callback to invoke once the write is finished. |
117 static void sendFeatureReport(long connectionId, | 119 static void sendFeatureReport(long connectionId, |
118 long reportId, | 120 long reportId, |
119 ArrayBuffer data, | 121 ArrayBuffer data, |
120 SendCallback callback); | 122 SendCallback callback); |
121 }; | 123 }; |
122 }; | 124 }; |
OLD | NEW |