Chromium Code Reviews| 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_DEVICE_HANDLE_H_ | 5 #ifndef DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| 6 #define DEVICE_USB_USB_DEVICE_HANDLE_H_ | 6 #define DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 // The platform device handle will be closed when UsbDeviceHandle destructs. | 49 // The platform device handle will be closed when UsbDeviceHandle destructs. |
| 50 virtual void Close() = 0; | 50 virtual void Close() = 0; |
| 51 | 51 |
| 52 // Device manipulation operations. These methods are blocking and must be | 52 // Device manipulation operations. These methods are blocking and must be |
| 53 // called on FILE thread. | 53 // called on FILE thread. |
| 54 virtual bool ClaimInterface(int interface_number) = 0; | 54 virtual bool ClaimInterface(int interface_number) = 0; |
| 55 virtual bool ReleaseInterface(int interface_number) = 0; | 55 virtual bool ReleaseInterface(int interface_number) = 0; |
| 56 virtual bool SetInterfaceAlternateSetting(int interface_number, | 56 virtual bool SetInterfaceAlternateSetting(int interface_number, |
| 57 int alternate_setting) = 0; | 57 int alternate_setting) = 0; |
| 58 virtual bool ResetDevice() = 0; | 58 virtual bool ResetDevice() = 0; |
| 59 virtual bool GetManufacturer(base::string16* manufacturer) = 0; | 59 virtual bool GetStringDescriptor(uint8 string_id, base::string16* string) = 0; |
|
scheib
2014/09/25 17:36:04
Why not an enum for string_id? Oh (after research)
Reilly Grant (use Gerrit)
2014/09/25 17:58:44
It'll be gone completely from this interface when
| |
| 60 virtual bool GetProduct(base::string16* product) = 0; | |
| 61 virtual bool GetSerial(base::string16* serial) = 0; | |
| 62 | 60 |
| 63 // Async IO. Can be called on any thread. | 61 // Async IO. Can be called on any thread. |
| 64 virtual void ControlTransfer(UsbEndpointDirection direction, | 62 virtual void ControlTransfer(UsbEndpointDirection direction, |
| 65 TransferRequestType request_type, | 63 TransferRequestType request_type, |
| 66 TransferRecipient recipient, | 64 TransferRecipient recipient, |
| 67 uint8 request, | 65 uint8 request, |
| 68 uint16 value, | 66 uint16 value, |
| 69 uint16 index, | 67 uint16 index, |
| 70 net::IOBuffer* buffer, | 68 net::IOBuffer* buffer, |
| 71 size_t length, | 69 size_t length, |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 101 UsbDeviceHandle() {}; | 99 UsbDeviceHandle() {}; |
| 102 | 100 |
| 103 virtual ~UsbDeviceHandle() {}; | 101 virtual ~UsbDeviceHandle() {}; |
| 104 | 102 |
| 105 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle); | 103 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle); |
| 106 }; | 104 }; |
| 107 | 105 |
| 108 } // namespace device | 106 } // namespace device |
| 109 | 107 |
| 110 #endif // DEVICE_USB_USB_DEVICE_HANDLE_H_ | 108 #endif // DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| OLD | NEW |