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().
);
evt
ms_timeout
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. |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 5.0 | intime/rt/include/usbif3.h | usbif3.h | usbif3.lib |