rename poll to handle_events
make libusb_get_pollfds return const?
doxygen warnings
-bmRequestType
make descriptor things const?
1.0 API style/naming points to reconsider
(struct libusb_control_setup *) transfer->buffer;
usbi_dbg("RQT=%02x RQ=%02x VAL=%04x IDX=%04x length=%d",
- setup->bRequestType, setup->bRequest, setup->wValue, setup->wIndex,
+ setup->bmRequestType, setup->bRequest, setup->wValue, setup->wIndex,
setup->wLength);
setup->wValue = cpu_to_le16(setup->wValue);
/** \ingroup misc
* Request type bits of the
- * \ref libusb_control_setup::bRequestType "bRequestType" field in control
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
* transfers. */
enum libusb_request_type {
/** Standard */
/** \ingroup misc
* Recipient bits of the
- * \ref libusb_control_setup::bRequestType "bRequestType" field in control
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
* transfers. Values 4 through 31 are reserved. */
enum libusb_request_recipient {
/** Device */
* \ref libusb_request_type. Bit 7 determines data transfer direction, see
* \ref libusb_endpoint_direction.
*/
- uint8_t bRequestType;
+ uint8_t bmRequestType;
- /** Request. If the type bits of bRequestType are equal to
+ /** Request. If the type bits of bmRequestType are equal to
* \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
* "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to
* \ref libusb_standard_request. For other cases, use of this field is
* buffer) for a control transfer.
*
* \param buffer buffer to output the setup packet into
- * \param bRequestType see the
- * \ref libusb_control_setup::bRequestType "bRequestType" field of
+ * \param bmRequestType see the
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field of
* \ref libusb_control_setup
* \param bRequest see the
* \ref libusb_control_setup::bRequest "bRequest" field of
* \ref libusb_control_setup
*/
static inline void libusb_fill_control_setup(unsigned char *buffer,
- uint8_t bRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
+ uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
uint16_t wLength)
{
struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;
- setup->bRequestType = bRequestType;
+ setup->bmRequestType = bmRequestType;
setup->bRequest = bRequest;
setup->wValue = wValue;
setup->wIndex = wIndex;
struct usbfs_ctrltransfer {
/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */
- uint8_t bRequestType;
+ uint8_t bmRequestType;
uint8_t bRequest;
uint16_t wValue;
uint16_t wIndex;
/* FIXME: does this support partial transfers? */
/** \ingroup syncio
* Perform a USB control transfer. The direction of the transfer is inferred
- * from the bRequestType field of the setup packet.
+ * from the bmRequestType field of the setup packet.
*
* \param dev_handle a handle for the device to communicate with
- * \param bRequestType the request type field for the setup packet
+ * \param bmRequestType the request type field for the setup packet
* \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
- * (depending on direction bits within bRequestType)
+ * (depending on direction bits within bmRequestType)
* \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,
- 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();
return -ENOMEM;
}
- libusb_fill_control_setup(buffer, bRequestType, bRequest, wValue, wIndex,
+ libusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex,
wLength);
- if ((bRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
+ if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);
libusb_fill_control_transfer(transfer, dev_handle, buffer,
}
}
- if ((bRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
+ if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
memcpy(data, libusb_control_transfer_get_data(transfer),
transfer->actual_length);