Wait for USB attach and detach events. Attach events are delivered when devices are plugged into the bus. Detach events occur when devices are unplugged the bus. When this API is called, devices already plugged into the bus are not announced as attached. Use UsbEventsWithCallback() to be notified for all devices.
int32_t UsbWaitForEvent(
LPUSBEVENT evt,
uint32_t ms_timeout
);
#define USB_EVENT_ATTACH 1
#define USB_EVENT_DETACH 2
typedef struct {
uint32_t evt; // which event
void * data; // parameter from UsbOpenDevice()
} USBEVENT, * LPUSBEVENT;
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 |