From: Bert Vermeulen Date: Sun, 2 Sep 2012 13:01:23 +0000 (+0200) Subject: serial: fix flow control setting X-Git-Tag: dsupstream~715 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f38b9763fa5ba8f4b481718b245e1258a307d2a6;p=libsigrok.git serial: fix flow control setting --- diff --git a/hardware/common/serial.c b/hardware/common/serial.c index 3838030a..ca79b9bb 100644 --- a/hardware/common/serial.c +++ b/hardware/common/serial.c @@ -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; }