libusb_fill_control_transfer() is only used within OpenOCD.
 
Symbols
loading...
Files
loading...
CodeScopeDevelopment ToolsOpenOCDlibusb_fill_control_transfer()

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.

Syntax

static inline void libusb_fill_control_transfer(     struct libusb_transfer *transfer,     libusb_device_handle *dev_handle,     unsigned char *buffer,     libusb_transfer_cb_fn callback,     void *user_data,     unsigned int timeout);

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

References

LocationText
libusb.h:1810
static inline void libusb_fill_control_transfer(

Call Tree

Functions called by libusb_fill_control_transfer()
libusb_fill_control_transfer()
all items filtered out
Type of libusb_fill_control_transfer()
libusb_fill_control_transfer()
all items filtered out