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 |
| 10 // HID usage pair. |
| 11 // |usage_page|: HID usage page. |
| 12 // |usage|: HID usage. |
| 13 dictionary HidUsageAndPage { |
| 14 long usage_page; |
| 15 long usage; |
| 16 }; |
| 17 |
10 // Returned by <code>getDevices</code> functions to describes a connected HID | 18 // Returned by <code>getDevices</code> functions to describes a connected HID |
11 // device. Use <code>connect</code> to connect to any of the returned devices. | 19 // device. Use <code>connect</code> to connect to any of the returned devices. |
| 20 // |deviceId|: Device opaque ID. |
| 21 // |vendorId|: Vendor ID. |
| 22 // |productId|: Product ID. |
| 23 // |usages|: HID usage pairs exposed by underlying Top-level collections. |
12 dictionary HidDeviceInfo { | 24 dictionary HidDeviceInfo { |
13 long deviceId; | 25 long deviceId; |
14 long vendorId; | 26 long vendorId; |
15 long productId; | 27 long productId; |
| 28 HidUsageAndPage[] usages; |
16 }; | 29 }; |
17 | 30 |
18 // Returned by <code>connect</code> to represent a communication session with | 31 // Returned by <code>connect</code> to represent a communication session with |
19 // an HID device. Must be closed with a call to <code>disconnect</code>. | 32 // an HID device. Must be closed with a call to <code>disconnect</code>. |
20 dictionary HidConnectInfo { | 33 dictionary HidConnectInfo { |
21 long connectionId; | 34 long connectionId; |
22 }; | 35 }; |
23 | 36 |
24 // Searching criteria to enumerate devices with. | 37 // Searching criteria to enumerate devices with. |
25 dictionary GetDevicesOptions { | 38 dictionary GetDevicesOptions { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // |connectionId|: The connection to read Input report from. | 113 // |connectionId|: The connection to read Input report from. |
101 // |reportId|: The report ID to use, or <code>0</code> if none. | 114 // |reportId|: The report ID to use, or <code>0</code> if none. |
102 // |data|: The report data. | 115 // |data|: The report data. |
103 // |callback|: The callback to invoke once the write is finished. | 116 // |callback|: The callback to invoke once the write is finished. |
104 static void sendFeatureReport(long connectionId, | 117 static void sendFeatureReport(long connectionId, |
105 long reportId, | 118 long reportId, |
106 ArrayBuffer data, | 119 ArrayBuffer data, |
107 SendCallback callback); | 120 SendCallback callback); |
108 }; | 121 }; |
109 }; | 122 }; |
OLD | NEW |