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; return SR_ERR;
} }
term.c_cflag &= ~(IXON | IXOFF | CRTSCTS); term.c_iflag &= ~(IXON | IXOFF);
term.c_cflag &= ~CRTSCTS;
switch (flowcontrol) { switch (flowcontrol) {
case 2: case 0:
term.c_cflag |= IXON | IXOFF; /* No flow control. */
break; break;
case 1: case 1:
term.c_cflag |= CRTSCTS; term.c_cflag |= CRTSCTS;
case 2:
term.c_iflag |= IXON | IXOFF;
break;
default: default:
return SR_ERR; return SR_ERR;
} }