I do have open a native serial port on linux using termios.
The port is opened in blocking mode and with the settings VMIN = 10
and VTIME = 5
. I thought this should mean the blocking read function is returning after half a second if the timeout hits.
Although I found this one here:
A read() is satisfied when either VMIN characters have been transferred to the caller's buffer, or when VTIME tenths expire between characters. Since this timer is not started until the first character arrives, this call can block indefinitely if the serial line is idle. This is the most common mode of operation, and we consider VTIME to be an intercharacter timeout, not an overall one. his call should never return zero bytes read.
So my question is now, how to make the call return on this timeout if the line is idle?
Thanks!