| 98 | |
| 99 | template<typename TFeatureSelector> |
| 100 | int set_feature(libusb_device_handle *handle, int timeout, TFeatureSelector feature_selector) |
| 101 | { |
| 102 | // for details see USB 3.1 r1 spec section 9.4.9 |
| 103 | |
| 104 | uint8_t bmRequestType = FeatureSelectorRecipient<TFeatureSelector>::get(); |
| 105 | uint8_t bRequest = LIBUSB_REQUEST_SET_FEATURE; |
| 106 | uint16_t wValue = static_cast<uint16_t>(feature_selector); |
| 107 | uint16_t wIndex = 0; |
| 108 | uint16_t wLength = 0; |
| 109 | uint8_t *data = 0; |
| 110 | |
| 111 | return libusb_control_transfer(handle, bmRequestType, bRequest, wValue, wIndex, data, wLength, timeout); |
| 112 | } |
| 113 | |
| 114 | int set_feature_function_suspend(libusb_device_handle *handle, int timeout, bool low_power_suspend, bool function_remote_wake) |
| 115 | { |