I am writing code to talk to another device over serial in linux
I want non-blocking with timeout even if 0 characters arrive. The termios struct allows you to set VTIME and VMIN, but if VMIN is larger than 0, and if 0 characters are returned, the read call will block forever...WTF, why. This does not seem to cover the case where the other device goes down for a short period of time and now my application is blocked on a read call. This seems like a critical behavior to neglect. I really do not want to implement my own timeouts.
Write command
Read block timeout of around .3s(if 0 characters, still wait max of .3s)