M
Martin Woolley
Hi
I have some code which reads from a serial port. When I use it on one of my
Linux boxes I see 0x0D0A terminating lines read from the device. This is
what I expect to see. But if I run the same code on a different Linux box I
see 0x0A0A as the line terminator.
Here are the options I'm setting in my code:
options.c_cflag |= (CLOCAL | CREAD);
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // raw mode
options.c_lflag &= ~ECHO;
options.c_oflag &= ~ECHO;
options.c_oflag &= ~OPOST;
options.c_cc[VMIN] = 0;
options.c_cc[VTIME] = 10;
Most of the code that deals with serial port configuration, I got from the
Linux Serial programming HowTo. ie I am pretty new to this and don't
understand it all!
Can anyone tell me how to ensure that I see 0x0D0A terminating all lines
read from the port please? My testing is all wiht /dev/ttyS0 btw.
Thanks
I have some code which reads from a serial port. When I use it on one of my
Linux boxes I see 0x0D0A terminating lines read from the device. This is
what I expect to see. But if I run the same code on a different Linux box I
see 0x0A0A as the line terminator.
Here are the options I'm setting in my code:
options.c_cflag |= (CLOCAL | CREAD);
options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // raw mode
options.c_lflag &= ~ECHO;
options.c_oflag &= ~ECHO;
options.c_oflag &= ~OPOST;
options.c_cc[VMIN] = 0;
options.c_cc[VTIME] = 10;
Most of the code that deals with serial port configuration, I got from the
Linux Serial programming HowTo. ie I am pretty new to this and don't
understand it all!
Can anyone tell me how to ensure that I see 0x0D0A terminating all lines
read from the port please? My testing is all wiht /dev/ttyS0 btw.
Thanks