/* FIXME: does this support partial transfers? */
/** \ingroup syncio
* Perform a USB control transfer. The direction of the transfer is inferred
/* FIXME: does this support partial transfers? */
/** \ingroup syncio
* Perform a USB control transfer. The direction of the transfer is inferred
* \param bRequest the request field for the setup packet
* \param wValue the value field for the setup packet
* \param wIndex the index field for the setup packet
* \param data a suitably-sized data buffer for either input or output
* \param bRequest the request field for the setup packet
* \param wValue the value field for the setup packet
* \param wIndex the index field for the setup packet
* \param data a suitably-sized data buffer for either input or output
* \param wLength the length field for the setup packet. The data buffer should
* be at least this size.
* \param timeout timeout (in millseconds) that this function should wait
* \param wLength the length field for the setup packet. The data buffer should
* be at least this size.
* \param timeout timeout (in millseconds) that this function should wait
* \returns other negative code on error
*/
API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle,
* \returns other negative code on error
*/
API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle,
- uint8_t bRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
+ uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
unsigned char *data, uint16_t wLength, unsigned int timeout)
{
struct libusb_transfer *transfer = libusb_alloc_transfer();
unsigned char *data, uint16_t wLength, unsigned int timeout)
{
struct libusb_transfer *transfer = libusb_alloc_transfer();
- libusb_fill_control_setup(buffer, bRequestType, bRequest, wValue, wIndex,
+ libusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex,
memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);
libusb_fill_control_transfer(transfer, dev_handle, buffer,
memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);
libusb_fill_control_transfer(transfer, dev_handle, buffer,
memcpy(data, libusb_control_transfer_get_data(transfer),
transfer->actual_length);
memcpy(data, libusb_control_transfer_get_data(transfer),
transfer->actual_length);