mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-17 16:51:44 +08:00
Callback set via own structure.
This commit is contained in:
+11
-6
@@ -49,22 +49,27 @@
|
||||
struct ec_tty;
|
||||
typedef struct ec_tty ec_tty_t; /**< \see ec_tty */
|
||||
|
||||
/**
|
||||
* \param cflag_changed This callback function is called when the serial
|
||||
* settings shall be changed. The \a cflag argument contains the new settings.
|
||||
*/
|
||||
typedef struct {
|
||||
int (*cflag_changed)(void *, tcflag_t);
|
||||
} ec_tty_operations_t;
|
||||
|
||||
/******************************************************************************
|
||||
* Global functions
|
||||
*****************************************************************************/
|
||||
|
||||
/** Create a virtual TTY interface.
|
||||
*
|
||||
* \param cflag_cb This callback function is called when the serial settings
|
||||
* shall be changed. The \a cb_data argument is the same as the \a cb_data
|
||||
* given on device creation, while the \a cflag argument contains the new
|
||||
* settings.
|
||||
* \param cb_data Arbitrary data to pass to callbacks.
|
||||
* \param ops Set of callbacks.
|
||||
* \param cb_data Arbitrary data, that is passed to any callback.
|
||||
*
|
||||
* \return Pointer to the interface object, otherwise an ERR_PTR value.
|
||||
*/
|
||||
ec_tty_t *ectty_create(
|
||||
int (*cflag_cb)(void *cb_data, tcflag_t cflag),
|
||||
const ec_tty_operations_t *ops,
|
||||
void *cb_data
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user