I am sending commands over a serial port from a Linux embedded device to some serial enabled firmware. For easy debugging and simplicity we are using ascii human-readable comman
according to Linux Serial Programming documentation :
This is the normal processing mode for terminals, but can also be useful for communicating with other dl input is processed in units of lines, which means that a read will only return a full line of input. A line is by default terminated by a NL (ASCII LF), an end of file, or an end of line character. A CR (the DOS/Windows default end-of-line) will not terminate a line with the default settings.
Canonical input processing can also handle the erase, delete word, and reprint characters, translate CR to NL, etc..
First
using canonical mode for serial communications is the best option, because we have Linux kernel support on data transmission and system handlers that will help to better reading serial text
Second
if you want to use canonical mode , make sure that you are using the right character for end of line in your device that sending data , other way you cannot use canonical feature