libusb Developers Guide
Prev |  | Next

# usb_get_descriptor

## Name

usb_get_descriptor -- Retrieves a descriptor from a device's default control pipe

## Description

``int usb_get_descriptor`(usb_dev_handle *dev, unsigned char type, unsigned char index, void *buf, int size);`

`usb_get_descriptor` retrieves a descriptor from the device identified by the `type` and `index` of the descriptor from the default control pipe. Returns number of bytes read for the descriptor or < 0 on error.

See usb_get_descriptor_by_endpoint for a function that allows the control endpoint to be specified.

Prev | Home | Next
usb_get_string_simple | Up | usb_get_descriptor_by_endpoint