OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |