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