Identification of packets in a byte stream

… can’t really grasp how the checksum can be used as an identifier for the start of the package (wouldn’t the checksum change all the time?). Yes, the checksum would change since it is derived from the data. But even a fixed-value start-of-packet nibble would (by itself) not be sufficient to (initially) identify (or verify) … 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