Belkin F8E211 Guía de usuario Pagina 42

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 114
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 41
usbd attach() 2006, QNX Software Systems GmbH & Co. KG.
typedef struct usbd device instance {
uint8 path;
uint8 devno;
uint16 generation;
usbd
device ident t ident;
uint32 config;
uint32 iface;
uint32 alternate;
} usbd
device instance t;
Looping
Another way to attach is to loop and attach to all devices (in which
case you build the instance yourself). For example:
for (devno = 0; devno < 64; ++devno) {
memset(&instance, USBD
CONNECT WILDCARD, sizeof(usbd device instance t));
instance.path = 0, instance.devno = devno;
if (usbd
attach(connection, &instance, 0, &device) == EOK) {
......
}
}
The degree of “attachedness” depends on how you connected. If you
specified insertion/removal callback functions, then you’ll get
exclusive access to the device and can make I/O to it.
If you didn’t use callbacks and you attached as in the loop above, you
get shared access, so you can only read device configuration.
Returns:
EOK Success.
ENODEV Specified device doesn’t exist. If in a loop, then there’s
nothing at that devno. If from a callback, then the
device has since been removed.
EBUSY A shared/exclusive conflict.
ENOMEM No memory for internal device structures.
30 Chapter 4 USB Library Reference November 2, 2006
Vista de pagina 41
1 2 ... 37 38 39 40 41 42 43 44 45 46 47 ... 113 114

Comentarios a estos manuales

Sin comentarios