
2006, QNX Software Systems GmbH & Co. KG. usbd parse descriptors()
Parse device descriptors looking for a specific entry
Synopsis:
#include <sys/usbdi.h>
usbd
descriptors t *usbd parse descriptors(
struct usbd
device *device,
struct usbd
desc node *root,
uint8 type, int index,
struct usbd
desc node **node );
Description:
When called the first time, the usbd parse descriptors() function
loads all the descriptors from the USB device:
device
configuration
interface
endpoint
hub
string
The function uses usdb
descriptor() to get each raw USB descriptor.
The data is then endian-ized, made alignment-safe, and built into an
in-memory tree structure to facilitate future parsing requests.
Each node in this tree is a
struct usbd desc node. The root parameter
lets you say where in the tree to begin parsing (NULL is base). The
node parameter tells you where a descriptor was found to root future
requests from.
The tree looks like this:
(ROOT)
|
(DEVICE) - (HUB) - (LANGUAGE TABLE)
|
(CONFIG) - ..... (CONFIG)
November 2, 2006 Chapter 4 USB Library Reference 71
Comentários a estes Manuais