220623-好像去掉也不会了 可能是接收方法有问题
为了解决串口丢部分0x11 0x13 0x14数据问题
要将设置成数据原始模式
在unix.cc里面改 441行
cfmakeraw(&options);//将终端设置为原始模式 8n1没有流控
要将设置成数据原始模式
cfmakeraw(&options);//将终端设置为原始模式 8n1没有流控
代码段
// http://www.unixwiz.net/techtips/termios-vmin-vtime.html
// this basically sets the read call up to be a polling read,
// but we are using select to ensure there is data available
// to read before each call, so we should never needlessly poll
options.c_cc[VMIN] = 0;
options.c_cc[VTIME] = 0;
// activate settings
::tcsetattr (fd_, TCSANOW, &options);
cfmakeraw(&options);//将终端设置为原始模式 8n1没有流控
// Update byte_time_ based on the new settings.
uint32_t bit_time_ns = 1e9 / baudrate_;
byte_time_ns_ = bit_time_ns * (1 + bytesize_ + parity_ + stopbits_);