linux C语言 串口 上层发送0x0A,底层却发送了0x0D 0x0A两个字节的解决方法

struct termios options;

 

options.c_iflag &= ~(INLCR | ICRNL | IGNCR);
options.c_oflag &= ~(ONLCR | OCRNL | ONOCR | ONLRET); 

 

tcsetattr(fd,TCSANOW,&options);

你可能感兴趣的:(C语言编程,LINUX)