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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user