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

App callbacks and per-port settings. More...

#include <classes/cdc_acm.h>

Data Fields

void(* on_open )(cdc_port *port, void *user, const cdc_line_coding *coding)
 The host opened the port - asserted DTR (optional).
 
void(* on_close )(cdc_port *port, void *user)
 The host closed the port - cleared DTR (optional).
 
void(* on_line_coding )(cdc_port *port, void *user, const cdc_line_coding *coding)
 The host changed the line coding - baud/parity/etc.
 
void(* on_rx )(cdc_port *port, void *user, const void *data, int len)
 Bytes arrived from the host (optional).
 
const char * name
 Optional iInterface name for this port, e.g.
 
void * user
 Opaque pointer passed to every callback above.
 

Detailed Description

App callbacks and per-port settings.

Any callback may be NULL. port identifies which port fired (use it with cdc_acm_send() and read its fields); user is your context pointer, passed straight through.

Field Documentation

◆ on_open

void(* cdc_acm_opts::on_open) (cdc_port *port, void *user, const cdc_line_coding *coding)

The host opened the port - asserted DTR (optional).

Parameters
portthe port that was opened.
userthe user pointer.
codingthe line coding in effect at open time.

◆ on_close

void(* cdc_acm_opts::on_close) (cdc_port *port, void *user)

The host closed the port - cleared DTR (optional).

Parameters
portthe port that was closed.
userthe user pointer.

◆ on_line_coding

void(* cdc_acm_opts::on_line_coding) (cdc_port *port, void *user, const cdc_line_coding *coding)

The host changed the line coding - baud/parity/etc.

(optional).

Parameters
portthe port whose settings changed.
userthe user pointer.
codingthe new line coding.

◆ on_rx

void(* cdc_acm_opts::on_rx) (cdc_port *port, void *user, const void *data, int len)

Bytes arrived from the host (optional).

Transmit back with cdc_acm_send().

Parameters
portthe port the bytes arrived on.
userthe user pointer.
datathe received bytes.
lennumber of bytes in data.

◆ name

const char* cdc_acm_opts::name

Optional iInterface name for this port, e.g.

"Console" - shown by the host (Linux: /sys/bus/usb/devices/.../interface; Windows: the device name).

◆ user

void* cdc_acm_opts::user

Opaque pointer passed to every callback above.


The documentation for this struct was generated from the following file: