|
USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
|
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. | |
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.
| void(* cdc_acm_opts::on_open) (cdc_port *port, void *user, const cdc_line_coding *coding) |
The host opened the port - asserted DTR (optional).
| port | the port that was opened. |
| user | the user pointer. |
| coding | the line coding in effect at open time. |
The host closed the port - cleared DTR (optional).
| port | the port that was closed. |
| user | the user pointer. |
| 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).
| port | the port whose settings changed. |
| user | the user pointer. |
| coding | the new line coding. |
Bytes arrived from the host (optional).
Transmit back with cdc_acm_send().
| port | the port the bytes arrived on. |
| user | the user pointer. |
| data | the received bytes. |
| len | number of bytes in data. |
| 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).
| void* cdc_acm_opts::user |
Opaque pointer passed to every callback above.