In article <> ,
Doublehp <> wrote:
>after 2h of chat on IRC, someone said me that i forgot to enter
>nonOPOST mode, so I added line 70 with the proper line as described on
>http://www.easysw.mike/serial/serial.html
>
>/* canonical raw input */
> vars->serial->c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
Actually, this is setting *non*canonical input (turning off ICANON).
"Canonical" input means translating the terminal's idea of CR into
Unix's idea (0x0A). By default, the serial port is configured to
talk to a terminal, so flags like that are turned on.
See "man termios" for all the gory details. Yo ucan probably get what
you want with "raw" mode: call tcgetattr(), cfmakeraw(), and then
tcsetattr() to apply the modified attributes back onto the serial device.
cfmakeraw() does almost the same thing you're doing in the code snippet
you posted, except it modifies a few more flags.
--
Wim Lewis <>, Seattle, WA, USA. PGP keyID 27F772C1