IgH EtherCAT Master  1.5.3
EtherCAT Virtual TTY Interface

Data Structures

struct  ec_tty_operations_t
 Operations on the virtual TTY interface. More...
 

Typedefs

typedef struct ec_tty ec_tty_t
 

Functions

ec_tty_tectty_create (const ec_tty_operations_t *ops, void *cb_data)
 Create a virtual TTY interface. More...
 
void ectty_free (ec_tty_t *tty)
 Releases a virtual TTY interface. More...
 
unsigned int ectty_tx_data (ec_tty_t *tty, uint8_t *buffer, size_t size)
 Reads data to send from the TTY interface. More...
 
void ectty_rx_data (ec_tty_t *tty, const uint8_t *buffer, size_t size)
 Pushes received data to the TTY interface. More...
 

Detailed Description

Typedef Documentation

◆ ec_tty_t

typedef struct ec_tty ec_tty_t
See also
ec_tty

Definition at line 52 of file ectty.h.

Function Documentation

◆ ectty_create()

ec_tty_t* ectty_create ( const ec_tty_operations_t ops,
void *  cb_data 
)

Create a virtual TTY interface.

Parameters
opsSet of callbacks.
cb_dataArbitrary data, that is passed to any callback.
Returns
Pointer to the interface object, otherwise an ERR_PTR value.

◆ ectty_free()

void ectty_free ( ec_tty_t tty)

Releases a virtual TTY interface.

Parameters
ttyTTY interface.

◆ ectty_tx_data()

unsigned int ectty_tx_data ( ec_tty_t tty,
uint8_t *  buffer,
size_t  size 
)

Reads data to send from the TTY interface.

If there are data to send, they are copied into the buffer. At maximum, size bytes are copied. The actual number of bytes copied is returned.

Returns
Number of bytes copied.
Parameters
ttyTTY interface.
bufferBuffer for data to transmit.
sizeAvailable space in buffer.

◆ ectty_rx_data()

void ectty_rx_data ( ec_tty_t tty,
const uint8_t *  buffer,
size_t  size 
)

Pushes received data to the TTY interface.

Parameters
ttyTTY interface.
bufferBuffer with received data.
sizeNumber of bytes in buffer.