| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 uint8 alternate_setting; | 51 uint8 alternate_setting; |
| 52 uint8 class_code; | 52 uint8 class_code; |
| 53 uint8 subclass_code; | 53 uint8 subclass_code; |
| 54 uint8 protocol_code; | 54 uint8 protocol_code; |
| 55 string? interface_name; | 55 string? interface_name; |
| 56 array<EndpointInfo> endpoints; | 56 array<EndpointInfo> endpoints; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 struct InterfaceInfo { | 59 struct InterfaceInfo { |
| 60 uint8 interface_number; | 60 uint8 interface_number; |
| 61 // Interface number of the first interface in the function to which this | |
| 62 // interface belongs. | |
| 63 uint8 first_interface; | |
| 64 array<AlternateInterfaceInfo> alternates; | 61 array<AlternateInterfaceInfo> alternates; |
| 65 }; | 62 }; |
| 66 | 63 |
| 67 struct ConfigurationInfo { | 64 struct ConfigurationInfo { |
| 68 uint8 configuration_value; | 65 uint8 configuration_value; |
| 69 string? configuration_name; | 66 string? configuration_name; |
| 70 array<InterfaceInfo> interfaces; | 67 array<InterfaceInfo> interfaces; |
| 71 }; | 68 }; |
| 72 | 69 |
| 73 struct WebUsbFunctionSubset { | |
| 74 uint8 first_interface; | |
| 75 array<string> origins; | |
| 76 }; | |
| 77 | |
| 78 struct WebUsbConfigurationSubset { | |
| 79 uint8 configuration_value; | |
| 80 array<string> origins; | |
| 81 array<WebUsbFunctionSubset> functions; | |
| 82 }; | |
| 83 | |
| 84 struct WebUsbDescriptorSet { | |
| 85 array<string> origins; | |
| 86 array<WebUsbConfigurationSubset> configurations; | |
| 87 }; | |
| 88 | |
| 89 struct DeviceInfo { | 70 struct DeviceInfo { |
| 90 string guid; | 71 string guid; |
| 91 uint8 usb_version_major; | 72 uint8 usb_version_major; |
| 92 uint8 usb_version_minor; | 73 uint8 usb_version_minor; |
| 93 uint8 usb_version_subminor; | 74 uint8 usb_version_subminor; |
| 94 uint8 class_code; | 75 uint8 class_code; |
| 95 uint8 subclass_code; | 76 uint8 subclass_code; |
| 96 uint8 protocol_code; | 77 uint8 protocol_code; |
| 97 uint16 vendor_id; | 78 uint16 vendor_id; |
| 98 uint16 product_id; | 79 uint16 product_id; |
| 99 uint8 device_version_major; | 80 uint8 device_version_major; |
| 100 uint8 device_version_minor; | 81 uint8 device_version_minor; |
| 101 uint8 device_version_subminor; | 82 uint8 device_version_subminor; |
| 102 string? manufacturer_name; | 83 string? manufacturer_name; |
| 103 string? product_name; | 84 string? product_name; |
| 104 string? serial_number; | 85 string? serial_number; |
| 105 uint8 active_configuration; | 86 uint8 active_configuration; |
| 106 array<ConfigurationInfo> configurations; | 87 array<ConfigurationInfo> configurations; |
| 107 WebUsbDescriptorSet? webusb_allowed_origins; | |
| 108 }; | 88 }; |
| 109 | 89 |
| 110 struct ControlTransferParams { | 90 struct ControlTransferParams { |
| 111 ControlTransferType type; | 91 ControlTransferType type; |
| 112 ControlTransferRecipient recipient; | 92 ControlTransferRecipient recipient; |
| 113 uint8 request; | 93 uint8 request; |
| 114 uint16 value; | 94 uint16 value; |
| 115 uint16 index; | 95 uint16 index; |
| 116 }; | 96 }; |
| 117 | 97 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // indicates no timeout: the request will remain pending indefinitely until | 259 // indicates no timeout: the request will remain pending indefinitely until |
| 280 // completed or otherwise terminated. | 260 // completed or otherwise terminated. |
| 281 | 261 |
| 282 // |packets| contains the status of each packet sent to the device, in order. | 262 // |packets| contains the status of each packet sent to the device, in order. |
| 283 IsochronousTransferOut(uint8 endpoint_number, | 263 IsochronousTransferOut(uint8 endpoint_number, |
| 284 array<uint8> data, | 264 array<uint8> data, |
| 285 array<uint32> packet_lengths, | 265 array<uint32> packet_lengths, |
| 286 uint32 timeout) | 266 uint32 timeout) |
| 287 => (array<IsochronousPacket> packets); | 267 => (array<IsochronousPacket> packets); |
| 288 }; | 268 }; |
| OLD | NEW |