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 import "device.mojom"; | 7 import "device.mojom"; |
8 | 8 |
9 enum OpenDeviceError { | 9 enum OpenDeviceError { |
10 // Opening the device succeeded. | 10 // Opening the device succeeded. |
(...skipping 17 matching lines...) Expand all Loading... |
28 uint8 class_code; | 28 uint8 class_code; |
29 | 29 |
30 bool has_subclass_code; | 30 bool has_subclass_code; |
31 uint8 subclass_code; | 31 uint8 subclass_code; |
32 | 32 |
33 bool has_protocol_code; | 33 bool has_protocol_code; |
34 uint8 protocol_code; | 34 uint8 protocol_code; |
35 }; | 35 }; |
36 | 36 |
37 struct EnumerationOptions { | 37 struct EnumerationOptions { |
38 array<DeviceFilter> filters; | 38 array<DeviceFilter>? filters; |
39 }; | 39 }; |
40 | 40 |
41 struct DeviceChangeNotification { | 41 struct DeviceChangeNotification { |
42 array<DeviceInfo> devices_added; | 42 array<DeviceInfo> devices_added; |
43 array<string> devices_removed; | 43 array<string> devices_removed; |
44 }; | 44 }; |
45 | 45 |
46 interface DeviceManager { | 46 interface DeviceManager { |
47 // Retrieves information about all devices available to the DeviceManager | 47 // Retrieves information about all devices available to the DeviceManager |
48 // implementation. | 48 // implementation. |
49 GetDevices(EnumerationOptions options) => (array<DeviceInfo> results); | 49 GetDevices(EnumerationOptions? options) => (array<DeviceInfo> results); |
50 | 50 |
51 // Retrieves information about changes to the set of devices available to the | 51 // Retrieves information about changes to the set of devices available to the |
52 // DeviceManager since the last call to this method. The first call will | 52 // DeviceManager since the last call to this method. A device that is added |
53 // return the set of all devices available. Device added and removed between | 53 // and removed between calls will not be included. |
54 // calls will not be included. | |
55 GetDeviceChanges() => (DeviceChangeNotification changes); | 54 GetDeviceChanges() => (DeviceChangeNotification changes); |
56 | 55 |
57 // Attempts to open a device given its GUID. | 56 // Attempts to open a device given its GUID. |
58 OpenDevice(string guid, Device& device_request) => (OpenDeviceError error); | 57 OpenDevice(string guid, Device& device_request) => (OpenDeviceError error); |
59 }; | 58 }; |
OLD | NEW |