| 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 |
| 60 virtual bool GetProduct(base::string16* product) = 0; | 60 // Gets the string descriptor with the given index from the device, or returns |
| 61 virtual bool GetSerial(base::string16* serial) = 0; | 61 // false. This method is blocking and must be called on the FILE thread. |
| 62 virtual bool GetStringDescriptor(uint8 string_id, base::string16* string) = 0; |
| 62 | 63 |
| 63 // Async IO. Can be called on any thread. | 64 // Async IO. Can be called on any thread. |
| 64 virtual void ControlTransfer(UsbEndpointDirection direction, | 65 virtual void ControlTransfer(UsbEndpointDirection direction, |
| 65 TransferRequestType request_type, | 66 TransferRequestType request_type, |
| 66 TransferRecipient recipient, | 67 TransferRecipient recipient, |
| 67 uint8 request, | 68 uint8 request, |
| 68 uint16 value, | 69 uint16 value, |
| 69 uint16 index, | 70 uint16 index, |
| 70 net::IOBuffer* buffer, | 71 net::IOBuffer* buffer, |
| 71 size_t length, | 72 size_t length, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 101 UsbDeviceHandle() {}; | 102 UsbDeviceHandle() {}; |
| 102 | 103 |
| 103 virtual ~UsbDeviceHandle() {}; | 104 virtual ~UsbDeviceHandle() {}; |
| 104 | 105 |
| 105 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle); | 106 DISALLOW_COPY_AND_ASSIGN(UsbDeviceHandle); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 } // namespace device | 109 } // namespace device |
| 109 | 110 |
| 110 #endif // DEVICE_USB_USB_DEVICE_HANDLE_H_ | 111 #endif // DEVICE_USB_USB_DEVICE_HANDLE_H_ |
| OLD | NEW |