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

Side by Side Diff: public/platform/modules/webusb/WebUSBDeviceInfo.h

Issue 1252913014: WebUSB bindings part 3 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: set-upstream Created 5 years, 4 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 #ifndef WebUSBDeviceInfo_h 5 #ifndef WebUSBDeviceInfo_h
6 #define WebUSBDeviceInfo_h 6 #define WebUSBDeviceInfo_h
7 7
8 #include "public/platform/WebString.h" 8 #include "public/platform/WebString.h"
9 #include "public/platform/WebVector.h"
10 #include "public/platform/modules/webusb/WebUSBDevice.h"
9 11
10 namespace blink { 12 namespace blink {
11 13
12 struct WebUSBDeviceInfo { 14 struct WebUSBDeviceInfo {
15 struct Endpoint {
16 enum class Type {
17 Bulk,
18 Interrupt,
19 Isochronous
20 };
21
22 Endpoint()
23 : endpointNumber(0)
24 , direction(WebUSBDevice::TransferDirection::In)
25 , type(Type::Bulk)
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;
Reilly Grant (use Gerrit) 2015/08/03 23:00:50 Leave out AlternateInterface and Endpoint until th
Ken Rockot(use gerrit already) 2015/08/04 00:51:25 Done.
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
13 WebString guid; 89 WebString guid;
14 uint8_t usbVersionMajor; 90 uint8_t usbVersionMajor;
15 uint8_t usbVersionMinor; 91 uint8_t usbVersionMinor;
16 uint8_t usbVersionSubminor; 92 uint8_t usbVersionSubminor;
17 uint8_t deviceClass; 93 uint8_t deviceClass;
18 uint8_t deviceSubclass; 94 uint8_t deviceSubclass;
19 uint8_t deviceProtocol; 95 uint8_t deviceProtocol;
20 uint16_t vendorID; 96 uint16_t vendorID;
21 uint16_t productID; 97 uint16_t productID;
22 uint8_t deviceVersionMajor; 98 uint8_t deviceVersionMajor;
23 uint8_t deviceVersionMinor; 99 uint8_t deviceVersionMinor;
24 uint8_t deviceVersionSubminor; 100 uint8_t deviceVersionSubminor;
25 WebString manufacturerName; 101 WebString manufacturerName;
26 WebString productName; 102 WebString productName;
27 WebString serialNumber; 103 WebString serialNumber;
104 WebVector<Configuration> configurations;
28 }; 105 };
29 106
30 } // namespace blink 107 } // namespace blink
31 108
32 #endif // WebUSBDeviceInfo_h 109 #endif // WebUSBDeviceInfo_h
OLDNEW
« Source/modules/webusb/USBInterface.cpp ('K') | « Source/modules/webusb/USBInterface.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698