raw.c_iflag=raw.c_iflag&!(BRKINT|ICRNL|INPCK|ISTRIP|IXON);// disable BREAK interrupt, CR to NL conversion on input, input parity check, strip high bit (bit 8), output flow control
raw.c_oflag=raw.c_oflag&!(OPOST);// disable all output processing
// we don't want raw output, it turns newlines into straight linefeeds
//raw.c_oflag = raw.c_oflag & !(OPOST); // disable all output processing
raw.c_cflag=raw.c_cflag|(CS8);// character-size mark (8 bits)
raw.c_lflag=raw.c_lflag&!(ECHO|ICANON|IEXTEN|ISIG);// disable echoing, canonical mode, extended input processing and signals