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_STREAM_EVENT Enumeration
MPLAB Harmony USB Stack
USB_HOST_AUDIO_V1_0_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_0_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_0_STREAM_EVENT_READ_COMPLETE event is accompanied by a pointer to a USB_HOST_AUDIO_V1_0_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 if the Device stalls any stages of the transfer or due to NAK time-outs. 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_0_STREAM_EVENT_READ_COMPLETE,
  USB_HOST_AUDIO_V1_0_STREAM_EVENT_WRITE_COMPLETE,
  USB_HOST_AUDIO_V1_0_STREAM_EVENT_ENABLE_COMPLETE,
  USB_HOST_AUDIO_V1_0_STREAM_EVENT_DISABLE_COMPLETE,
  USB_HOST_AUDIO_V1_0_STREAM_EVENT_SAMPLING_RATE_SET_COMPLETE
} USB_HOST_AUDIO_V1_0_STREAM_EVENT;
Members
Members 
Description 
USB_HOST_AUDIO_V1_0_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_0_StreamRead function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_0_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_0_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_0_StreamWrte function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_0_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_0_STREAM_EVENT_ENABLE_COMPLETE 
This event occurs when an Audio v1.0 stream enable request has been completed. This event is generated after the application calls the USB_HOST_AUDIO_V1_0_StreamEnable function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_0_STREAM_EVENT_ENABLE_COMPLETE_DATA. This contains details about the request handle associated with this stream enable request and the termination status of the Stream Enable request. 
USB_HOST_AUDIO_V1_0_STREAM_EVENT_DISABLE_COMPLETE 
This event occurs when an Audio v1.0 stream disable request has been completed. This event is generated after the application calls the USB_HOST_AUDIO_V1_0_StreamDisable function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_0_STREAM_EVENT_DISABLE_COMPLETE_DATA. This contains details about the request handle associated with this stream disable request and the termination status of the Stream Disable request. 
USB_HOST_AUDIO_V1_0_STREAM_EVENT_SAMPLING_RATE_SET_COMPLETE 
This event occurs when an Audio v1.0 sampling rate set request has been completed. This event is generated after the application calls the USB_HOST_AUDIO_V1_0_StreamSamplingRateSet function. The eventData parameter in the event callback function will be of a pointer to a USB_HOST_AUDIO_V1_0_STREAM_EVENT_SAMPLING_RATE_SET_COMPLETE_DATA. This contains details about the request handle associated with this Sampling Rate Set request and the termination status of the stream disable request.