OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebUSBDeviceInfo_h |
| 6 #define WebUSBDeviceInfo_h |
| 7 |
| 8 #include "public/platform/WebString.h" |
| 9 #include "public/platform/WebVector.h" |
| 10 #include "public/platform/modules/webusb/WebUSBDevice.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 struct WebUSBDeviceInfo { |
| 15 struct Endpoint { |
| 16 enum Type { |
| 17 TypeBulk, |
| 18 TypeInterrupt, |
| 19 TypeIsochronous |
| 20 }; |
| 21 |
| 22 Endpoint() |
| 23 : endpointNumber(0) |
| 24 , direction(WebUSBDevice::TransferDirectionIn) |
| 25 , type(TypeBulk) |
| 26 , packetSize(0) |
| 27 { |
| 28 } |
| 29 |
| 30 uint8_t endpointNumber; |
| 31 WebUSBDevice::TransferDirection direction; |
| 32 Type type; |
| 33 uint32_t packetSize; |
| 34 }; |
| 35 |
| 36 struct AlternateInterface { |
| 37 AlternateInterface() |
| 38 : alternateSetting(0) |
| 39 , classCode(0) |
| 40 , subclassCode(0) |
| 41 , protocolCode(0) |
| 42 { |
| 43 } |
| 44 |
| 45 uint8_t alternateSetting; |
| 46 uint8_t classCode; |
| 47 uint8_t subclassCode; |
| 48 uint8_t protocolCode; |
| 49 WebString interfaceName; |
| 50 WebVector<Endpoint> endpoints; |
| 51 }; |
| 52 |
| 53 struct Interface { |
| 54 Interface() |
| 55 : interfaceNumber(0) |
| 56 { |
| 57 } |
| 58 |
| 59 uint8_t interfaceNumber; |
| 60 WebVector<AlternateInterface> alternates; |
| 61 }; |
| 62 |
| 63 struct Configuration { |
| 64 Configuration() |
| 65 : configurationValue(0) |
| 66 { |
| 67 } |
| 68 |
| 69 uint8_t configurationValue; |
| 70 WebString configurationName; |
| 71 WebVector<Interface> interfaces; |
| 72 }; |
| 73 |
| 74 WebUSBDeviceInfo() |
| 75 : usbVersionMajor(0) |
| 76 , usbVersionMinor(0) |
| 77 , usbVersionSubminor(0) |
| 78 , deviceClass(0) |
| 79 , deviceSubclass(0) |
| 80 , deviceProtocol(0) |
| 81 , vendorID(0) |
| 82 , productID(0) |
| 83 , deviceVersionMajor(0) |
| 84 , deviceVersionMinor(0) |
| 85 , deviceVersionSubminor(0) |
| 86 { |
| 87 } |
| 88 |
| 89 WebString guid; |
| 90 uint8_t usbVersionMajor; |
| 91 uint8_t usbVersionMinor; |
| 92 uint8_t usbVersionSubminor; |
| 93 uint8_t deviceClass; |
| 94 uint8_t deviceSubclass; |
| 95 uint8_t deviceProtocol; |
| 96 uint16_t vendorID; |
| 97 uint16_t productID; |
| 98 uint8_t deviceVersionMajor; |
| 99 uint8_t deviceVersionMinor; |
| 100 uint8_t deviceVersionSubminor; |
| 101 WebString manufacturerName; |
| 102 WebString productName; |
| 103 WebString serialNumber; |
| 104 WebVector<Configuration> configurations; |
| 105 }; |
| 106 |
| 107 } // namespace blink |
| 108 |
| 109 #endif // WebUSBDeviceInfo_h |
OLD | NEW |