libusb_fill_control_transfer() function
Helper function to populate the required
libusb_transfer
fields for a control transfer. If you pass a transfer buffer to this function, the first 8 bytes will be interpreted as a control setup packet, and the wLength field will be used to automatically populate the
libusb_transfer
::length "length" field of the transfer. Therefore the recommended approach is: -# Allocate a suitably sized data buffer (including space for control setup) -# Call libusb_fill_control_setup() -# If this is a host-to-device transfer with a data stage, put the data in place after the setup packet -# Call this function -# Call libusb_submit_transfer() It is also legal to pass a NULL buffer to this function, in which case this function will not attempt to populate the length field. Remember that you must then populate the buffer and length fields later.
Arguments
transfer
the transfer to populate
dev_handle
handle of the device that will handle the transfer
buffer
data buffer. If provided, this function will interpret the first 8 bytes as a setup packet and infer the transfer length from that. This pointer must be aligned to at least 2 bytes boundary.
callback
callback function to be invoked on transfer completion
user_data
user data to pass to callback function
timeout
timeout for the transfer in milliseconds
Location | Text |
libusb.h:1810 | static inline void libusb_fill_control_transfer( |
Functions called by libusb_fill_control_transfer()
libusb_fill_control_transfer()
Data read by libusb_fill_control_transfer()
Data written by libusb_fill_control_transfer()
libusb_fill_control_transfer()::setup all items filtered out
libusb_fill_control_transfer()
Type of libusb_fill_control_transfer()
libusb_fill_control_transfer()