usbd_descriptor()

Get or set USB descriptors

Synopsis:

#include <sys/usbdi.h>

int usbd_descriptor( struct usbd_device *device, 
                     int set,
                     uint8_t type,
                     uint16_t rtype, 
                     uint8_t index,
                     uint16_t langid, 
                     uint8_t *desc,
                     size_t len );

Arguments:

device
An opaque handle used to identify the USB device.
set
A flag that says to either get or set a descriptor.
type
Type of descriptor (e.g. USB_DESC_DEVICE, USB_DESC_CONFIGURATION, USB_DESC_STRING, USB_DESC_HUB).
rtype
Type of request (e.g. USB_RECIPIENT_DEVICE, USB_RECIPIENT_INTERFACE, USB_RECIPIENT_ENDPOINT, USB_RECIPIENT_OTHER, USB_TYPE_STANDARD, USB_TYPE_CLASS, USB_TYPE_VENDOR).
index
This varies, depending on the request. It's used for passing a parameter to the device.
langid
Identifies the language supported in strings (according to the LANGID table).
desc
Pointer at buffer to put descriptors.
len
The length of the data transfer in bytes.

Library:

libusbdi

Description:

The usbd_descriptor() function lets you obtain the USB descriptors.

Returns:

EMSGSIZE
Buffer too small for descriptor.
ENOMEM
No memory for URB.
ENODEV
Device was removed.
EIO
I/O error on USB device.

Classification:

QNX Neutrino, QNX 4

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

usbd_feature() usbd_io(), usbd_parse_descriptors(), usbd_setup_bulk(), usbd_setup_control(), usbd_setup_interrupt(), usbd_setup_isochronous(), usbd_setup_vendor(), usbd_status()