serial: fix flow control setting

This commit is contained in:
Bert Vermeulen 2012-09-02 15:01:23 +02:00
parent 6a6e23abf5
commit f38b9763fa
1 changed files with 7 additions and 3 deletions

View 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;
}