USB Libraries Help > USB Host Libraries > USB Audio v1.0 Host Client Driver Library > Library Interface > d) Data Types and Constants > USB_HOST_AUDIO_V1_0_AttachEventHandlerSet Macro
MPLAB Harmony USB Stack
USB_HOST_AUDIO_V1_0_AttachEventHandlerSet Macro

This function will set an attach event handler. The attach event handler will be called when a Audio v1.0 device has been attached or detached. The context will be returned in the event handler. This function should be called before the bus has been enabled.

C
#define USB_HOST_AUDIO_V1_0_AttachEventHandlerSet USB_HOST_AUDIO_V1_AttachEventHandlerSet
Preconditions

None.

Parameters
Parameters 
Description 
eventHandler 
Pointer to the attach event handler 
context 
An application defined context that will be returned in the event handler 
Returns
  • USB_HOST_AUDIO_V1_0_RESULT_SUCCESS - if the attach event handler was registered

successfully

  • USB_HOST_AUDIO_V1_0_RESULT_FAILURE - if the number of registered event

handlers has exceeded USB_HOST_AUDIO_V1_0_ATTACH_LISTENERS_NUMBER

Remarks

This function should be called before the USB_HOST_BusEnable function is called.