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

Side by Side Diff: device/usb/usb_descriptors.h

Issue 2702623002: Add support for reading USB descriptors to the new Windows backend. (Closed)
Patch Set: Addressed rockot@'s feedback and rebased. Created 3 years, 10 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
« no previous file with comments | « device/usb/BUILD.gn ('k') | device/usb/usb_descriptors.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 DEVICE_USB_USB_DESCRIPTORS_H_ 5 #ifndef DEVICE_USB_USB_DESCRIPTORS_H_
6 #define DEVICE_USB_USB_DESCRIPTORS_H_ 6 #define DEVICE_USB_USB_DESCRIPTORS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 // each). 126 // each).
127 bool Parse(const std::vector<uint8_t>& buffer); 127 bool Parse(const std::vector<uint8_t>& buffer);
128 128
129 uint16_t usb_version = 0; 129 uint16_t usb_version = 0;
130 uint8_t device_class = 0; 130 uint8_t device_class = 0;
131 uint8_t device_subclass = 0; 131 uint8_t device_subclass = 0;
132 uint8_t device_protocol = 0; 132 uint8_t device_protocol = 0;
133 uint16_t vendor_id = 0; 133 uint16_t vendor_id = 0;
134 uint16_t product_id = 0; 134 uint16_t product_id = 0;
135 uint16_t device_version = 0; 135 uint16_t device_version = 0;
136 uint8_t i_manufacturer = 0;
137 uint8_t i_product = 0;
138 uint8_t i_serial_number = 0;
136 uint8_t num_configurations = 0; 139 uint8_t num_configurations = 0;
137 std::vector<UsbConfigDescriptor> configurations; 140 std::vector<UsbConfigDescriptor> configurations;
138 }; 141 };
139 142
140 void ReadUsbDescriptors( 143 void ReadUsbDescriptors(
141 scoped_refptr<UsbDeviceHandle> device_handle, 144 scoped_refptr<UsbDeviceHandle> device_handle,
142 const base::Callback<void(std::unique_ptr<UsbDeviceDescriptor>)>& callback); 145 const base::Callback<void(std::unique_ptr<UsbDeviceDescriptor>)>& callback);
143 146
144 bool ParseUsbStringDescriptor(const std::vector<uint8_t>& descriptor, 147 bool ParseUsbStringDescriptor(const std::vector<uint8_t>& descriptor,
145 base::string16* output); 148 base::string16* output);
146 149
147 void ReadUsbStringDescriptors( 150 void ReadUsbStringDescriptors(
148 scoped_refptr<UsbDeviceHandle> device_handle, 151 scoped_refptr<UsbDeviceHandle> device_handle,
149 std::unique_ptr<std::map<uint8_t, base::string16>> index_map, 152 std::unique_ptr<std::map<uint8_t, base::string16>> index_map,
150 const base::Callback< 153 const base::Callback<
151 void(std::unique_ptr<std::map<uint8_t, base::string16>>)>& callback); 154 void(std::unique_ptr<std::map<uint8_t, base::string16>>)>& callback);
152 155
153 } // namespace device 156 } // namespace device
154 157
155 #endif // DEVICE_USB_USB_DESCRIPTORS_H_ 158 #endif // DEVICE_USB_USB_DESCRIPTORS_H_
OLDNEW
« no previous file with comments | « device/usb/BUILD.gn ('k') | device/usb/usb_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698