linux串口长期工作时,出现提示:ttyS0: 1 input overrun(s)
说明串口已经输入溢出,这时候我们应该将串口的缓冲区进行清除。
在发送命令前,清除缓冲区
在接受数据后,清除缓冲区
当然fd是你串口open时返回的int,这个fd必须有意义(>0);
TCIOFLUSH的意思是清除输入输出缓存。
This is an overrun of the hardware FIFO buffer and you can'tincrease its size. See
linux串口长期工作时,出现提示:ttyS0: 1 input overrun(s)
说明串口已经输入溢出,这时候我们应该将串口的缓冲区进行清除。
在发送命令前,清除缓冲区
在接受数据后,清除缓冲区
当然fd是你串口open时返回的int,这个fd必须有意义(>0);
TCIOFLUSH的意思是清除输入输出缓存。
This is an overrun of the hardware FIFO buffer and you can'tincrease its size. See