usb_get_descriptor — issues a generic GET_DESCRIPTOR request
int usb_get_descriptor ( | struct usb_device * dev, |
| unsigned char type, | |
| unsigned char index, | |
| void * buf, | |
int size); |
devthe device whose descriptor is being retrieved
typethe descriptor type (USB_DT_*)
indexthe number of the descriptor
bufwhere to put the descriptor
sizehow big is “buf”?
Gets a USB descriptor. Convenience functions exist to simplify
getting some types of descriptors. Use
usb_get_string or usb_string for USB_DT_STRING.
Device (USB_DT_DEVICE) and configuration descriptors (USB_DT_CONFIG)
are part of the device structure.
In addition to a number of USB-standard descriptors, some
devices also use class-specific or vendor-specific descriptors.
This call is synchronous, and may not be used in an interrupt context.