Serial Communication Canonical Mode Non-Blocking NL Detection
问题 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 commands terminated by newlines. Is it appropriate to use canonical mode here, or is canonical mode usually reserved for interactive terminals? The examples I find online all use raw mode. In particular, in canonical mode, how do I check without blocking if an entire line is available for reading. 回答1: according to Linux