diff --git a/src/uart/uart.c b/src/uart/uart.c index f1a76d2..8522e01 100644 --- a/src/uart/uart.c +++ b/src/uart/uart.c @@ -616,16 +616,6 @@ mraa_uart_set_flowcontrol(mraa_uart_context dev, mraa_boolean_t xonxoff, mraa_bo } } - // hardware flow control - int action = TCIOFF; - if (xonxoff) { - action = TCION; - } - if (tcflow(dev->fd, action)) { - return MRAA_ERROR_FEATURE_NOT_SUPPORTED; - } - - // rtscts struct termios termio; // get current modes @@ -634,6 +624,12 @@ mraa_uart_set_flowcontrol(mraa_uart_context dev, mraa_boolean_t xonxoff, mraa_bo return MRAA_ERROR_INVALID_RESOURCE; } + if (xonxoff) { + termio.c_iflag |= IXON|IXOFF; + } else { + termio.c_iflag &= ~(IXON|IXOFF); + } + if (rtscts) { termio.c_cflag |= CRTSCTS; } else {