
© 2007, QNX Software Systems GmbH & Co. KG. usbd
_
connect()
ident A pointer to a usbd_device_ident_t structure that identifies
the devices you’re interested in receiving insertion/removal
callbacks for (a filter):
typedef struct usbd_device_ident {
_uint32 vendor;
_uint32 device;
_uint32 dclass;
_uint32 subclass;
_uint32 protocol;
} usbd_device_ident_t;
You can set the fields to USBD_CONNECT_ WILDCARD or to an
explicit value. You would typically make the
usbd_device_ident_t structure be a filter for devices you
support from this specific class driver.
funcs A pointer to a
usbd_funcs_t structure that specifies the
insertion/removal callbacks:
typedef struct usbd_funcs {
_uint32 nentries;
void (*insertion)(struct usbd_connection *, usbd_device_instance_t *instance);
void (*removal)(struct usbd_connection *, usbd_device_instance_t *instance);
void (*event)(struct usbd_connection *, usbd_device_instance_t *instance,
_uint16 type);
} usbd_funcs_t;
The usbd_funcs_t structure includes the following members:
nentries The number of entries in the structure. Set this to
_USBDI_NFUNCS.
insertion The function to call when a device that matches the
defined filter is detected.
removal The function to call when a device is removed.
event A future extension for various other event notifications
(e.g. bandwidth problems).
By passing NULL as the usbd
_
funcs, you’re saying that you’re not interested in
receiving dynamic insertion/removal notifications, which means that you won’t be a
fully operational class driver. No asynchronous I/O will be allowed, no event thread,
etc. This approach is taken, for example, by the
usb display utility.
connect
_
wait A value (in seconds) or USBD_CONNECT_WAIT.
Returns:
EOK Success.
EPROGMISMATCH
Versionitis.
ENOMEM No memory for internal connect structures.
September 10, 2007 Chapter 4 • USB Library Reference 29
Kommentare zu diesen Handbüchern