use cfmakeraw to also remove ICRNL flag that would translate 0x0d to 0x0a on input

This commit is contained in:
matthias.ringwald@gmail.com 2014-07-29 22:07:11 +00:00
parent 9dc1b82bc9
commit a827874ef0

View File

@ -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;