Private
Public Access
2
0

uart: Convert rtscts and xonxoff in mraa_uart_settings into mraa_boolean_t

This aligns the getter with the setter (mraa_uart_set_flowcontrol).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2021-04-30 08:40:27 +02:00
committed by Tom Ingleby
parent aeb0b331b5
commit 11e65ee9bf
3 changed files with 8 additions and 8 deletions

View File

@@ -337,7 +337,7 @@ mraa_uart_stop(mraa_uart_context dev)
}
mraa_result_t
mraa_uart_settings(int index, const char **devpath, const char **name, int* baudrate, int* databits, int* stopbits, mraa_uart_parity_t* parity, unsigned int* ctsrts, unsigned int* xonxoff) {
mraa_uart_settings(int index, const char **devpath, const char **name, int* baudrate, int* databits, int* stopbits, mraa_uart_parity_t* parity, mraa_boolean_t* ctsrts, mraa_boolean_t* xonxoff) {
struct termios term;
int fd;
@@ -415,11 +415,11 @@ mraa_uart_settings(int index, const char **devpath, const char **name, int* baud
}
if (ctsrts != NULL) {
*ctsrts = term.c_cflag & CRTSCTS;
*ctsrts = (term.c_cflag & CRTSCTS) != 0;
}
if (xonxoff != NULL) {
*xonxoff = term.c_iflag & (IXON|IXOFF);
*xonxoff = (term.c_iflag & (IXON|IXOFF)) != 0;
}
close(fd);