
2006, QNX Software Systems GmbH & Co. KG. usbd attach()
Attach to a USB device
Synopsis:
#include <sys/usbdi.h>
int usbd
attach( struct usbd connection *connection,
usbd
device instance t*instance,
size
t extra,
struct usbd
device **device );
Description:
You use the usbd attach() function to attach to a USB device.
Typically, you do this out of the insertion callback (made when the
device matched your filter), which will give you the connection and
instance parameters involved. The insertion callback is prototyped as
follows:
void (*insertion)(struct usbd connection *, usbd device instance t *instance)
Here are the parameters:
connection An opaque handle that identifies the USB stack (from
usbd
connect()).
instance Describes which device you wish to attach to.
extra The size of additional memory you’d like allocated
with the device. You can use usbd
device extra() later
to get a pointer to this additional memory. Typically,
the class driver would store various
status/config/device-specific details in here (if
needed).
device An opaque handle used to identify the device in later
calls.
The
usbd device instance t structure looks like this:
November 2, 2006 Chapter 4 USB Library Reference 29
Comentarios a estos manuales