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

CDC Class Driver Events 

This enumeration identifies the possible events that the CDC Class Driver can generate. The application should register an event handler using the USB_HOST_CDC_EventHandlerSet function to receive CDC Class Driver 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_CDC_EVENT_ACM_SET_LINE_CODING_COMPLETE event is accompanied by a pointer to a USB_HOST_CDC_EVENT_ACM_SET_LINE_CODING_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 device not responding on the bus, if the device stalls any stages of the transfer or due to NAK timeouts. 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_CDC_EVENT_READ_COMPLETE,
  USB_HOST_CDC_EVENT_WRITE_COMPLETE,
  USB_HOST_CDC_EVENT_ACM_SEND_BREAK_COMPLETE,
  USB_HOST_CDC_EVENT_ACM_SET_CONTROL_LINE_STATE_COMPLETE,
  USB_HOST_CDC_EVENT_ACM_SET_LINE_CODING_COMPLETE,
  USB_HOST_CDC_EVENT_ACM_GET_LINE_CODING_COMPLETE,
  USB_HOST_CDC_EVENT_SERIAL_STATE_NOTIFICATION_RECEIVED,
  USB_HOST_CDC_EVENT_DEVICE_DETACHED
} USB_HOST_CDC_EVENT;
Members
Members 
Description 
USB_HOST_CDC_EVENT_READ_COMPLETE 
This event occurs when a CDC Client Driver Read operation has completed i.e when the data has been received from the connected CDC device. This event is generated after the application calls the USB_HOST_CDC_Read function. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_CDC_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_CDC_EVENT_WRITE_COMPLETE 
This event occurs when a CDC Client Driver Write operation has completed i.e when the data has been written to the connected CDC device. This event is generated after the application calls the USB_HOST_CDC_Write function. The eventData parameter in the event call back function will be a pointer to a USB_HOST_CDC_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_CDC_EVENT_ACM_SEND_BREAK_COMPLETE 
This event occurs when a CDC Client Driver Send Break request has completed. This event is generated after the application calls the USB_HOST_CDC_ACM_BreakSend function and the device has either acknowledged or stalled the request. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_CDC_EVENT_ACM_SET_CONTROL_LINE_STATE_COMPLETE_DATA structure. This contains details about the transfer handle associated with this request, the amount of data sent and the termination status of the set request. 
USB_HOST_CDC_EVENT_ACM_SET_CONTROL_LINE_STATE_COMPLETE 
This event occurs when a CDC Client Driver Set Control Line State request has completed. This event is generated after the application calls the USB_HOST_CDC_ACM_ControlLineStateSet function and the device has either acknowledged or stalled the request. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_CDC_EVENT_ACM_SET_CONTROL_LINE_STATE_COMPLETE_DATA structure. This contains details about the transfer handle associated with this request, the amount of data sent and the termination status of the set request. 
USB_HOST_CDC_EVENT_ACM_SET_LINE_CODING_COMPLETE 
This event occurs when a CDC Client Driver Set Line Coding request has completed. This event is generated after the application calls the USB_HOST_CDC_ACM_LineCodingSet function and the device either acknowledged or stalled the request. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_CDC_EVENT_ACM_SET_LINE_CODING_COMPLETE_DATA structure. This contains details about the transfer handle associated with this request, the amount of data sent and the termination status of the set request. 
USB_HOST_CDC_EVENT_ACM_GET_LINE_CODING_COMPLETE 
This event occurs when a CDC Client Driver Get Line Coding request has completed. This event is generated after the application calls the USB_HOST_CDC_ACM_LineCodingGet function and the device sends the line coding to the host. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_CDC_EVENT_ACM_GET_LINE_CODING_COMPLETE_DATA structure. This contains details about the transfer handle associated with this request, the amount of data received and the termination status of the get request. 
USB_HOST_CDC_EVENT_SERIAL_STATE_NOTIFICATION_RECEIVED 
This event occurs when a CDC Client Driver Serial State Notification Get operation has completed. This event is generated after the application calls the USB_HOST_CDC_SerialStateNotificationGet and the device sends a serial state notification to the host. The eventData parameter in the event call back function will be of a pointer to a USB_HOST_CDC_EVENT_SERIAL_STATE_NOTIFICATION_RECEIVED_DATA structure. This contains details about the transfer handle associated with this request, the amount of data received and the termination status of the get request. 
USB_HOST_CDC_EVENT_DEVICE_DETACHED 
This event occurs when the device that this client was connected to has

  • been detached. The client should close the CDC instance. There is no
  • event data associated with this event

 

Remarks

None.