Canonical Mode Linux Serial Port

is it putting the 0xD0xA (CRLF) bytes at the beginning of the transmission line to tell the read() function that data is ready to be read? Your question has essentially already been answered by my last comment to you in your other post. Apparently you don’t believe the man page or me, and are also … Read more

How to read a binary data over serial terminal in C program?

system(“stty erase ^H); system(“stty -F /dev/ttyS0 -icrnl -ixon -ixoff -opost -isig -icanon -echo”); // enter into non-canonical (raw) mode This would be insufficient code (and poor coding practice per POSIX conventions) to put the serial port into raw or non-canonical mode. The easiest method in C and Linux is to use the function cfmakeraw() which … Read more

Linux Blocking vs. non Blocking Serial Read

The code you mention is IMO poorly coded and commented. That code does not conform to POSIX practices for portability as described in Setting Terminal Modes Properly and Serial Programming Guide for POSIX Operating Systems. That code does not mention that it uses non-canonical (aka raw) mode, and reuses the “blocking” and “nonblocking” terminology to … Read more