OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 module device.usb; | 5 module device.usb; |
6 | 6 |
7 enum OpenDeviceError { | 7 enum OpenDeviceError { |
8 // Opening the device succeeded. | 8 // Opening the device succeeded. |
9 OK, | 9 OK, |
10 | 10 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // The transfer succeeded, but the device sent less data than was requested. | 134 // The transfer succeeded, but the device sent less data than was requested. |
135 // This applies only to inbound transfers. | 135 // This applies only to inbound transfers. |
136 SHORT_PACKET, | 136 SHORT_PACKET, |
137 }; | 137 }; |
138 | 138 |
139 interface Device { | 139 interface Device { |
140 // Retrieve a DeviceInfo struct containing metadata about the device, | 140 // Retrieve a DeviceInfo struct containing metadata about the device, |
141 // including the set of all available device configurations. | 141 // including the set of all available device configurations. |
142 GetDeviceInfo() => (DeviceInfo? info); | 142 GetDeviceInfo() => (DeviceInfo? info); |
143 | 143 |
144 // Retrieves the device's currently active configuration. May return null if | 144 // Retrieves the |configuration_value| of the device's currently active |
145 // the device is unconfigured. | 145 // configuration. Will return 0 if the device is unconfigured. |
146 GetConfiguration() => (ConfigurationInfo? info); | 146 GetConfiguration() => (uint8 value); |
147 | 147 |
148 // Opens the device. Methods below require the device be opened first. | 148 // Opens the device. Methods below require the device be opened first. |
149 Open() => (OpenDeviceError error); | 149 Open() => (OpenDeviceError error); |
150 | 150 |
151 // Closes the device. | 151 // Closes the device. |
152 Close() => (); | 152 Close() => (); |
153 | 153 |
154 // Initiates a device control transfer to set the device's configuration to | 154 // Initiates a device control transfer to set the device's configuration to |
155 // one with the configuration value |value|. | 155 // one with the configuration value |value|. |
156 SetConfiguration(uint8 value) => (bool success); | 156 SetConfiguration(uint8 value) => (bool success); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // this transfer. | 262 // this transfer. |
263 // | 263 // |
264 // |timeout| specifies the request timeout in milliseconds. A timeout of 0 | 264 // |timeout| specifies the request timeout in milliseconds. A timeout of 0 |
265 // indicates no timeout: the request will remain pending indefinitely until | 265 // indicates no timeout: the request will remain pending indefinitely until |
266 // completed or otherwise terminated. | 266 // completed or otherwise terminated. |
267 IsochronousTransferOut(uint8 endpoint_number, | 267 IsochronousTransferOut(uint8 endpoint_number, |
268 array<array<uint8>> packets, | 268 array<array<uint8>> packets, |
269 uint32 timeout) | 269 uint32 timeout) |
270 => (TransferStatus status); | 270 => (TransferStatus status); |
271 }; | 271 }; |
OLD | NEW |