USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches

CDC-ACM (virtual serial) device class, app-facing API. More...

#include "usb_class.h"

Data Structures

struct  cdc_line_coding
 Serial line parameters (USB CDC "line coding"). More...
 
struct  cdc_port
 One CDC-ACM serial port: a single instance of the class on a device. More...
 
struct  cdc_acm_opts
 App callbacks and per-port settings. More...
 

Functions

cdc_portcdc_acm_add (usbip_device *dev, const cdc_acm_opts *opts)
 Add a CDC-ACM serial port to a device.
 
int cdc_acm_send (cdc_port *port, const void *data, int len)
 Transmit bytes to the host (device -> host).
 

Variables

const usbip_device_class usbip_device_cdc_acm
 The CDC-ACM class, for usbip_device_add_class()
 

Detailed Description

CDC-ACM (virtual serial) device class, app-facing API.

The class implements the CDC protocol; your app supplies callbacks for the events it cares about (port opened/closed, line coding changed, bytes received) and uses cdc_acm_send() to transmit. Built entirely on the public usbip_device.h API.

A device may carry several ports - call cdc_acm_add() once per port. Each call returns its own cdc_port, and every callback is handed the port it belongs to, so one set of callbacks can serve them all.