Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: device/devices_app/usb/public/interfaces/device.mojom

Issue 1352683006: Move device opening from DeviceManager to Device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 {
8 // Opening the device succeeded.
9 OK,
10
11 // The operating system denied access to the device.
12 ACCESS_DENIED,
13 };
14
7 enum TransferDirection { 15 enum TransferDirection {
8 IN, 16 IN,
9 OUT, 17 OUT,
10 }; 18 };
11 19
12 enum ControlTransferType { 20 enum ControlTransferType {
13 STANDARD, 21 STANDARD,
14 CLASS, 22 CLASS,
15 VENDOR, 23 VENDOR,
16 RESERVED 24 RESERVED
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // The transfer succeeded, but the device sent more data than was requested. 130 // The transfer succeeded, but the device sent more data than was requested.
123 // This applies only to inbound transfers. 131 // This applies only to inbound transfers.
124 BABBLE, 132 BABBLE,
125 133
126 // 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.
127 // This applies only to inbound transfers. 135 // This applies only to inbound transfers.
128 SHORT_PACKET, 136 SHORT_PACKET,
129 }; 137 };
130 138
131 interface Device { 139 interface Device {
132 // Closes the device. Calling this effectively invalidates the Device object. 140 // Retrieve a DeviceInfo struct containing metadata about the device,
141 // including the set of all available device configurations.
142 GetDeviceInfo() => (DeviceInfo? info);
143
144 // Retrieves the device's currently active configuration. May return null if
145 // the device is unconfigured.
146 GetConfiguration() => (ConfigurationInfo? info);
147
148 // Opens the device. Methods below require the device be opened first.
149 Open() => (OpenDeviceError error);
150
151 // Closes the device.
133 Close() => (); 152 Close() => ();
134 153
135 // Retrieve a DeviceInfo struct containing metadata about the device,
136 // including the set of all available device configurations. May return null
137 // if the device has been closed.
138 GetDeviceInfo() => (DeviceInfo? info);
139
140 // 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
141 // one with the configuration value |value|. 155 // one with the configuration value |value|.
142 SetConfiguration(uint8 value) => (bool success); 156 SetConfiguration(uint8 value) => (bool success);
143 157
144 // Claims a single interface in the current device configuration. 158 // Claims a single interface in the current device configuration.
145 ClaimInterface(uint8 interface_number) => (bool success); 159 ClaimInterface(uint8 interface_number) => (bool success);
146 160
147 // Releases a claimed interface in the current device configuration. 161 // Releases a claimed interface in the current device configuration.
148 ReleaseInterface(uint8 interface_number) => (bool success); 162 ReleaseInterface(uint8 interface_number) => (bool success);
149 163
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // this transfer. 262 // this transfer.
249 // 263 //
250 // |timeout| specifies the request timeout in milliseconds. A timeout of 0 264 // |timeout| specifies the request timeout in milliseconds. A timeout of 0
251 // indicates no timeout: the request will remain pending indefinitely until 265 // indicates no timeout: the request will remain pending indefinitely until
252 // completed or otherwise terminated. 266 // completed or otherwise terminated.
253 IsochronousTransferOut(uint8 endpoint_number, 267 IsochronousTransferOut(uint8 endpoint_number,
254 array<array<uint8>> packets, 268 array<array<uint8>> packets,
255 uint32 timeout) 269 uint32 timeout)
256 => (TransferStatus status); 270 => (TransferStatus status);
257 }; 271 };
OLDNEW
« no previous file with comments | « device/devices_app/usb/device_manager_impl_unittest.cc ('k') | device/devices_app/usb/public/interfaces/device_manager.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698