Linux serial port does not receive 0x11, 0x0d, 0x13

🔵 Solution for reading serial port without receiving 0x11, 0x0d, 0x13 and other data in linux environment:

options.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);

It can solve the problem of special character loss. ↖️

Many popular linux serial port programming versions on the Internet do not effectively set the c_iflag (termios member variable) variable, so there is no problem when transmitting ASCII code, but 0x0d, 0x11 and 0x13 are lost when transferring binary data.

🔴 Needless to say, these are definitely special characters and are used as special controls. Turn off the ICRNL and IXON options to solve.

  • Detailed description of various options of c_iflag: ➰