MPLAB Harmony USB Stack
|
This function will set an attach event handler. The attach event handler will be called when a CDC device has been attached. The context will be returned in the event handler. This function should be called before the bus has been enabled.
USB_HOST_CDC_RESULT USB_HOST_CDC_AttachEventHandlerSet( USB_HOST_CDC_ATTACH_EVENT_HANDLER eventHandler, uintptr_t context );
None.
Parameters |
Description |
eventHandler |
pointer to the attach event handler |
context |
an application defined context that will be returned in the event handler. |
USB_HOST_CDC_RESULT_SUCCESS - if the attach event handler was registered successfully.
USB_HOST_CDC_RESULT_FAILURE - if the number of registered event handlers has exceeded USB_HOST_CDC_ATTACH_LISTENERS_NUMBER.
Function should be called before USB_HOST_BusEnable() function is called.
MPLAB Harmony USB Stack
|