serial: fix flow control setting
This commit is contained in:
parent
6a6e23abf5
commit
f38b9763fa
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue