]> sigrok.org Git - libserialport.git/commitdiff
Get Xon/Xoff status on Windows.
authorMartin Ling <redacted>
Mon, 18 Nov 2013 19:55:43 +0000 (19:55 +0000)
committerMartin Ling <redacted>
Mon, 18 Nov 2013 19:55:43 +0000 (19:55 +0000)
serialport.c

index e86bd3e5684bb1e7ff1afa72082c0839653541b3..f95afd0cd0af8d537e6576433654ad0107ac3b87 100644 (file)
@@ -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)