]> sigrok.org Git - libsigrok.git/commitdiff
serial: fix flow control setting
authorBert Vermeulen <redacted>
Sun, 2 Sep 2012 13:01:23 +0000 (15:01 +0200)
committerBert Vermeulen <redacted>
Sun, 2 Sep 2012 13:42:56 +0000 (15:42 +0200)
hardware/common/serial.c

index 3838030a277d0271777476aafa303f9b57e40836..ca79b9bb7f6947551b6fd5fb91ffdf332e4ec9dc 100644 (file)
@@ -285,13 +285,17 @@ SR_PRIV int serial_set_params(int fd, int baudrate, int bits, int parity,
                return SR_ERR;
        }
 
-       term.c_cflag &= ~(IXON | IXOFF | CRTSCTS);
+       term.c_iflag &= ~(IXON | IXOFF);
+       term.c_cflag &= ~CRTSCTS;
        switch (flowcontrol) {
-       case 2:
-               term.c_cflag |= IXON | IXOFF;
+       case 0:
+               /* No flow control. */
                break;
        case 1:
                term.c_cflag |= CRTSCTS;
+       case 2:
+               term.c_iflag |= IXON | IXOFF;
+               break;
        default:
                return SR_ERR;
        }