From: Martin Ling Date: Mon, 18 Nov 2013 19:55:43 +0000 (+0000) Subject: Get Xon/Xoff status on Windows. X-Git-Tag: libserialport-0.1.0~110 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c6754b4517d7c9764a887ee3078a3693bfa5c571;p=libserialport.git Get Xon/Xoff status on Windows. --- diff --git a/serialport.c b/serialport.c index e86bd3e..f95afd0 100644 --- a/serialport.c +++ b/serialport.c @@ -646,6 +646,18 @@ static int get_config(struct sp_port *port, struct sp_port_data *data, struct sp config->dsr = data->dcb.fOutxDsrFlow ? SP_DSR_FLOW_CONTROL : SP_DSR_IGNORE; + if (data->dcb.fInX) { + if (data->dcb.fOutX) + config->xon_xoff = SP_XONXOFF_INOUT; + else + config->xon_xoff = SP_XONXOFF_IN; + } else { + if (data->dcb.fOutX) + config->xon_xoff = SP_XONXOFF_OUT; + else + config->xon_xoff = SP_XONXOFF_DISABLED; + } + #else // !_WIN32 if (tcgetattr(port->fd, &data->term) < 0)