USB Libraries Help > USB Host Libraries > USB CDC Host Library > Library Interface > a) Client Access Functions > USB_HOST_CDC_EventHandlerSet Function
MPLAB Harmony USB Stack
USB_HOST_CDC_EventHandlerSet Function

This function registers a client specific CDC Host Client Driver event handler. The CDC Host Client Driver will call this function with relevant event and associated event data, in response to command requests and data transfers that have been scheduled by the client.

C
USB_HOST_CDC_RESULT USB_HOST_CDC_EventHandlerSet(
    USB_HOST_CDC_HANDLE handle, 
    USB_HOST_CDC_EVENT_HANDLER eventHandler, 
    uintptr_t context
);
Preconditions

None.

Parameters
Parameters 
Description 
handle 
handle to the CDC Host Client Driver.
 
eventHandler 
A pointer to event handler function. If NULL, then events will not be generated.
 
context 
Application specific context that is returned in the event handler. 
Returns

USB_HOST_CDC_RESULT_SUCCESS - The operation was successful USB_HOST_CDC_RESULT_HANDLE_INVALID - The specified instance does not exist. USB_HOST_CDC_RESULT_FAILURE - An unknown failure occurred.

Remarks

None.

Example