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_STREAM_EVENT Enumeration
MPLAB Harmony USB Stack
USB_HOST_AUDIO_V1_STREAM_EVENT Enumeration

Audio v1.0 Stream Events 

This enumeration identifies the possible events that the Audio v1.0 Stream can generate. The application should register an event handler using the USB_HOST_AUDIO_V1_StreamEventHandlerSet function to receive Audio v1.0 stream events. 

An event may have data associated with it. Events that are generated due to a transfer of data between the host and device are accompanied by data structures that provide the status of the transfer termination. For example, the USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE event is accompanied by a pointer to a USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE_DATA data structure. The transferStatus member of this data structure indicates the success or failure of the transfer. A transfer may fail due to the device not responding on the bus, or if the device stalls any stages of the transfer. The event description provides details on the nature of the event and the data that is associated with the event.

C
typedef enum {
  USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE,
  USB_HOST_AUDIO_V1_STREAM_EVENT_WRITE_COMPLETE,
  USB_HOST_AUDIO_V1_STREAM_EVENT_INTERFACE_SET_COMPLETE,
  USB_HOST_AUDIO_V1_STREAM_EVENT_SAMPLING_FREQUENCY_SET_COMPLETE,
  USB_HOST_AUDIO_V1_STREAM_EVENT_SAMPLING_FREQUENCY_GET_COMPLETE,
  USB_HOST_AUDIO_V1_STREAM_EVENT_DETACH
} USB_HOST_AUDIO_V1_STREAM_EVENT;
Members
Members 
Description 
USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE 
This event occurs when a Audio v1.0 stream read operation has completed (i.e., when the data has been received from the connected Audio v1.0 stream). This event is generated after the application calls the USB_HOST_AUDIO_V1_StreamRead function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_STREAM_EVENT_READ_COMPLETE_DATA structure. This contains details about the transfer handle associated with this read request, the amount of data read and the termination status of the read request. 
USB_HOST_AUDIO_V1_STREAM_EVENT_WRITE_COMPLETE 
This event occurs when an Audio v1.0 stream write operation has completed (i.e., when the data has been written to the connected Audio v1.0 stream). This event is generated after the application calls the USB_HOST_AUDIO_V1_StreamWrite function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_STREAM_EVENT_WRITE_COMPLETE_DATA structure. This contains details about the transfer handle associated with this write request, the amount of data written and the termination status of the write request. 
USB_HOST_AUDIO_V1_STREAM_EVENT_INTERFACE_SET_COMPLETE 
This event occurs when an audio streaming set interface request has been completed. This event is generated after the application calls the USB_HOST_AUDIO_V1_StreamingInterfaceSet function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_STREAM_EVENT_INTERFACE_SET_COMPLETE_DATA. This contains details about the request handle associated with the interface set request and the termination status of the request. 
USB_HOST_AUDIO_V1_STREAM_EVENT_SAMPLING_FREQUENCY_SET_COMPLETE 
This event occurs when an Audio v1.0 sampling frequency set request has been completed. This event is generated after the application calls the USB_HOST_AUDIO_V1_StreamSamplingFrequencySet function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_STREAM_EVENT_SAMPLING_FREQUENCY_SET_COMPLETE_DATA. This contains details about the request handle associated with this sampling frequency set request and the termination status of the request. 
USB_HOST_AUDIO_V1_STREAM_EVENT_SAMPLING_FREQUENCY_GET_COMPLETE 
This event occurs when an Audio v1.0 sampling frequency get request has been completed. This event is generated after the application calls the USB_HOST_AUDIO_V1_StreamSamplingFrequencyGet function. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_AUDIO_V1_STREAM_EVENT_SAMPLING_FREQUENCY_GET_COMPLETE_DATA. This contains details about the request handle associated with this sampling frequency get request and the termination status of the request. 
USB_HOST_AUDIO_V1_STREAM_EVENT_DETACH 
This event occurs when an audio stream is detached from the Host.This can happen if the Audio device itself was detached, or if the Audio device configuration was changed. There is no event data associated with this event.