usbd_device_descriptor()

Get the device descriptor for a specific device

Synopsis:

#include <sys/usbdi.h>

usbd_device_descriptor_t 
  *usbd_device_descriptor(                                           
    struct usbd_device *device,                           
    struct usbd_desc_node **node );

Arguments:

device
A handle obtained by calling usbd_attach().
node
The address of a pointer to a usbd_device_descriptor_t structure where the function stores the device descriptor.

Library:

libusbdi

Description:

The usbd_device_descriptor() function lets you obtain the device descriptor for a specific device.

The node parameter tells you where a descriptor was found to root future requests from (e.g. configurations of the device).

The usbd_device_descriptor_t structure looks like this:

typedef struct usbd_device_descriptor {
    uint8_t                  bLength;
    uint8_t                  bDescriptorType;
    uint16_t                 bcdUSB;
    uint8_t                  bDeviceClass;
    uint8_t                  bDeviceSubClass;
    uint8_t                  bDeviceProtocol;
    uint8_t                  bMaxPacketSize0;
    uint16_t                 idVendor;
    uint16_t                 idProduct;
    uint16_t                 bcdDevice;
    uint8_t                  iManufacturer;
    uint8_t                  iProduct;
    uint8_t                  iSerialNumber;
    uint8_t                  bNumConfigurations;
} usbd_device_descriptor_t;

Returns:

A pointer to usbd_device_descriptor_t on success, or NULL on error.

Classification:

QNX Neutrino, QNX 4

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

See also:

usbd_args_lookup(), usbd_configuration_descriptor(), usbd_device_lookup(), usbd_device_extra(), usbd_endpoint_descriptor(), usbd_hcd_info(), usbd_hub_descriptor(), usbd_interface_descriptor(), usbd_languages_descriptor(), usbd_parse_descriptors(), usbd_string(), usbd_urb_status()