INtime SDK Help
UsbEventsWithCallback
INtime SDK v6 > About INtime > Networking and I/O > USB > USB calls > UsbEventsWithCallback

Wait for attach and detach events. When the event occurs, call a function and pass information about the device generating the event. When this API is called, all devices already attached and available (see UsbDeviceOpen) have an event generated and atfunc called. Dtfunc is called for each device that is unplugged.

int32_t UsbEventsWithCallback(
UsbAttachEventFunc atfunc,
UsbDetachEventFunc dtfunc,
uint32_t to_ms
);

 

typedef int32_t ( * UsbAttachEventFunc)(
struct usbDeviceInfo * udi // device info
);

 

typedef void ( * UsbDetachEventFunc)(
void * data // data passed via UsbDeviceOpen().
);

Parameters

evt
Pointer to a USBEVENT structure.
ms_timeout
Millisecond timeout value, USB_WAIT_FOREVER to wait forever.

Return Values

USB_ERR_NORMAL_COMPLETION Success. An event was returned.
USB_ERR_NO_STACK The USB stack is not ready.
USB_ERR_INVAL Am invalid event occured.
USB_ERR_TIMEOUT The call timed out.

Requirements

Versions Defined in Include Link to
INtime 5.0 intime/rt/include/usbif3.h usbif3.h usbif3.lib