btstack_uart_posix: set parity

This commit is contained in:
Matthias Ringwald 2021-03-08 18:43:55 +01:00
parent 79e58675d2
commit 1738838cad

View File

@ -315,8 +315,9 @@ static int btstack_uart_posix_set_flowcontrol(int flowcontrol){
static int btstack_uart_posix_open(void){ static int btstack_uart_posix_open(void){
const char * device_name = uart_config->device_name; const char * device_name = uart_config->device_name;
const int flowcontrol = uart_config->flowcontrol;
const uint32_t baudrate = uart_config->baudrate; const uint32_t baudrate = uart_config->baudrate;
const int flowcontrol = uart_config->flowcontrol;
const int parity = uart_config->parity;
struct termios toptions; struct termios toptions;
int flags = O_RDWR | O_NOCTTY | O_NONBLOCK; int flags = O_RDWR | O_NOCTTY | O_NONBLOCK;
@ -345,7 +346,7 @@ static int btstack_uart_posix_open(void){
toptions.c_cc[VTIME] = 0; toptions.c_cc[VTIME] = 0;
// no parity // no parity
btstack_uart_posix_set_parity_option(&toptions, 0); btstack_uart_posix_set_parity_option(&toptions, parity);
// flowcontrol // flowcontrol
btstack_uart_posix_set_flowcontrol_option(&toptions, flowcontrol); btstack_uart_posix_set_flowcontrol_option(&toptions, flowcontrol);