MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / set_feature_function_suspend

Function set_feature_function_suspend

src/usb_control.cpp:114–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 int set_feature_function_suspend(libusb_device_handle *handle, int timeout, bool low_power_suspend, bool function_remote_wake)
115 {
116 uint8_t suspend_options = 0;
117 suspend_options |= low_power_suspend ? 1 : 0;
118 suspend_options |= function_remote_wake ? 2 : 0;
119
120 // for details see USB 3.1 r1 spec section 9.4.9
121
122 InterfaceFeatureSelector feature_selector = FUNCTION_SUSPEND;
123 uint8_t bmRequestType = FeatureSelectorRecipient<InterfaceFeatureSelector>::get();
124 uint8_t bRequest = LIBUSB_REQUEST_SET_FEATURE;
125 uint16_t wValue = static_cast<uint16_t>(feature_selector);
126 uint16_t wIndex = suspend_options << 8 | 0;
127 uint16_t wLength = 0;
128 uint8_t *data = 0;
129
130 return libusb_control_transfer(handle, bmRequestType, bRequest, wValue, wIndex, data, wLength, timeout);
131 }
132
133 int get_max_iso_packet_size(libusb_device *device, int configuration, int alternate_setting, int endpoint)
134 {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected