1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

Retrieve XON/XOFF setting on Unix.

This commit is contained in:
Martin Ling 2013-11-19 20:46:52 +00:00
parent cf9d365ce0
commit e29b93a572

View File

@ -704,8 +704,17 @@ static enum sp_return get_config(struct sp_port *port, struct port_data *data,
config->dtr = (data->controlbits & TIOCM_DTR) ? SP_DTR_ON : SP_DTR_OFF; config->dtr = (data->controlbits & TIOCM_DTR) ? SP_DTR_ON : SP_DTR_OFF;
config->dsr = SP_DSR_IGNORE; config->dsr = SP_DSR_IGNORE;
/* FIXME: Set config->xon_xoff properly, depending on data->term. */ if (data->term.c_iflag & IXOFF) {
if (data->term.c_iflag & IXON)
config->xon_xoff = SP_XONXOFF_INOUT;
else
config->xon_xoff = SP_XONXOFF_IN;
} else {
if (data->term.c_iflag & IXON)
config->xon_xoff = SP_XONXOFF_OUT;
else
config->xon_xoff = SP_XONXOFF_DISABLED; config->xon_xoff = SP_XONXOFF_DISABLED;
}
#endif #endif
return SP_OK; return SP_OK;