Linux serial port cannot receive 0x11. solve the problem that c_iflag (termios member variable) is not effectively set in many popular linux serial port programming versions on the Internet, so there is no problem when transmitting ASCII codes, however, 0x0d, 0x11, and 0x13 are lost when binary data is transmitted. No... linux serial port cannot receive 0x11. solve the problem that c_iflag (termios member variable) is not effectively set in many popular linux serial port programming versions on the Internet, so there is no problem when transmitting ASCII codes, however, 0x0d, 0x11, and 0x13 are lost when binary data is transmitted. Needless to say, these must be special characters and are used for special control. Disable the ICRNL and IXON options. Www.2cto.com c_iflag & = ~ (ICRNL | IXON ); 0x0d carriage return character CR0x11 ^ q vstart character 0x13 ^ s vstop character ICRNL converts the input CR to nl ixon to enable start/stop output control flow function in UNIX environment advanced programming version 2 18th chapter 11th sets the terminal I/O to the original mode (serial communication is the original mode of terminal I/O) the input attribute is set to term. c_iflag & = ~ (BRKINT | ICRNL | INPCK | ISTRIP | IXON). many attributes are blocked. no wonder you can set c_iflag and c_oflag to 0 for serial communication! Below www.2cto.com are some important serial port attributes of my settings: term. c_cflag | = CLOCAL | CREAD; term. c_lflag & = ~ (ICANON | ECHO | ECHOE | ISIG); term. c_oflag & = ~ OPOST; term. c_iflag & = ~ (BRKINT | ICRNL | INPCK | ISTRIP | IXON );
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.