From a827874ef08438c7c4609d223c7ec80d274b8bf8 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Tue, 29 Jul 2014 22:07:11 +0000 Subject: [PATCH] use cfmakeraw to also remove ICRNL flag that would translate 0x0d to 0x0a on input --- src/hci_transport_h4.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index dbe4d9e3d..0b206eaf6 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -120,11 +120,10 @@ static int h4_open(void *transport_config){ } cfsetospeed(&toptions, brate); cfsetispeed(&toptions, brate); - + cfmakeraw(&toptions); // make raw + // 8N1 - toptions.c_cflag &= ~PARENB; toptions.c_cflag &= ~CSTOPB; - toptions.c_cflag &= ~CSIZE; toptions.c_cflag |= CS8; if (hci_uart_config->flowcontrol) { @@ -138,9 +137,6 @@ static int h4_open(void *transport_config){ toptions.c_cflag |= CREAD | CLOCAL; // turn on READ & ignore ctrl lines toptions.c_iflag &= ~(IXON | IXOFF | IXANY); // turn off s/w flow ctrl - toptions.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // make raw - toptions.c_oflag &= ~OPOST; // make raw - // see: http://unixwiz.net/techtips/termios-vmin-vtime.html toptions.c_cc[VMIN] = 1; toptions.c_cc[VTIME] = 0;