Add a custom Robolectric testrunner.
[chromium-blink-merge.git] / device / usb / usb_descriptors.h
blob0395f1d420973c91ea5e91af4c9d09aee0072776
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
3 // found in the LICENSE file.
5 #ifndef DEVICE_USB_USB_DESCRIPTORS_H_
6 #define DEVICE_USB_USB_DESCRIPTORS_H_
8 #include <stdint.h>
9 #include <vector>
11 namespace device {
13 enum UsbTransferType {
14 USB_TRANSFER_CONTROL = 0,
15 USB_TRANSFER_ISOCHRONOUS,
16 USB_TRANSFER_BULK,
17 USB_TRANSFER_INTERRUPT,
20 enum UsbEndpointDirection {
21 USB_DIRECTION_INBOUND = 0,
22 USB_DIRECTION_OUTBOUND,
25 enum UsbSynchronizationType {
26 USB_SYNCHRONIZATION_NONE = 0,
27 USB_SYNCHRONIZATION_ASYNCHRONOUS,
28 USB_SYNCHRONIZATION_ADAPTIVE,
29 USB_SYNCHRONIZATION_SYNCHRONOUS,
32 enum UsbUsageType {
33 USB_USAGE_DATA = 0,
34 USB_USAGE_FEEDBACK,
35 USB_USAGE_EXPLICIT_FEEDBACK
38 struct UsbEndpointDescriptor {
39 UsbEndpointDescriptor();
40 ~UsbEndpointDescriptor();
42 uint8_t address;
43 UsbEndpointDirection direction;
44 uint16_t maximum_packet_size;
45 UsbSynchronizationType synchronization_type;
46 UsbTransferType transfer_type;
47 UsbUsageType usage_type;
48 uint16_t polling_interval;
49 std::vector<uint8_t> extra_data;
52 struct UsbInterfaceDescriptor {
53 UsbInterfaceDescriptor();
54 ~UsbInterfaceDescriptor();
56 uint8_t interface_number;
57 uint8_t alternate_setting;
58 uint8_t interface_class;
59 uint8_t interface_subclass;
60 uint8_t interface_protocol;
61 std::vector<UsbEndpointDescriptor> endpoints;
62 std::vector<uint8_t> extra_data;
65 struct UsbConfigDescriptor {
66 UsbConfigDescriptor();
67 ~UsbConfigDescriptor();
69 uint8_t configuration_value;
70 bool self_powered;
71 bool remote_wakeup;
72 uint16_t maximum_power;
73 std::vector<UsbInterfaceDescriptor> interfaces;
74 std::vector<uint8_t> extra_data;
77 } // namespace device
79 #endif // DEVICE_USB_USB_DESCRIPTORS_H_