Serial Communication Canonical Mode Non-Blocking NL Detection

前端 未结 2 802
孤城傲影
孤城傲影 2021-01-26 20:40

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

2条回答
  •  礼貌的吻别
    2021-01-26 20:56

    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

提交回复
热议问题