Click to See Complete Forum and Search --> : termios question (stdin vs serial in)


tecknophreak
09-02-2004, 03:00 PM
Why is it that when i use the following:
newtio.c_cc[VTIME] = 10; /* inter-character timer */
newtio.c_cc[VMIN] = 0; /* blocking read until 1 character arrives */

it'll timeout 10/second even with no chars when I use 0 as the fd for a read, but when I setup a serial port(NON_CANON, B38400), it starts at 100 ms timeout and then goes to 10 ms timeout?

Or

newtio.c_cc[VTIME] = 0; /* inter-character timer unused */
newtio.c_cc[VMIN] = 256; /* blocking read until 1 character arrives */

This waits until it has 256 chars, where as the serial returns immediately.

If you want the serial port setup, let me know, i'll post it up here.

tecknophreak
09-02-2004, 04:11 PM
Originally posted by tecknophreak


newtio.c_cc[VTIME] = 0; /* inter-character timer unused */
newtio.c_cc[VMIN] = 256; /* blocking read until 1 character arrives */

This waits until it has 256 chars, where as the serial returns immediately.

If you want the serial port setup, let me know, i'll post it up here.

Cause 256 is actually 0. newtio.c_cc[VMIN] is an unsigned char.