Get USB descriptors.
#include <sys/usbdi.h>
int usbd_descriptor( struct usbd_device *device,
int set, _uint8 type, _uint16 rtype,
_uint8 index, _uint16 langid,
_uint8 *desc, size_t len );
The usbd_descriptor() function lets you obtain
the USB descriptors.
- 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.
- EMSGSIZE
- Buffer too small for descriptor.
- ENOMEM
- No memory for URB.
- ENODEV
- Device was removed.
- EIO
- I/O error on USB device.
QNX Neutrino, QNX 4
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
usbd_feature()
usbd_io(),
usbd_setup_bulk(),
usbd_setup_control(),
usbd_setup_interrupt(),
usbd_setup_isochronous(),
usbd_setup_vendor(),
usbd_status()