[uart]设置linux 串口的block方式

 

1. 如果设置为非block模式: open(device, O_RDWR | O_NDELAY | O_NONBLOCK);

2. 如果设置为block模式,且读固定字节数返回则termios.c_cc[VTIME]=0, termios.c_cc[VMIN]=nbytes. 且open设备设置为非O_NDELAY和非O_NONBLOCK模式

posted @ 2017-10-29 22:21  aaronGao  阅读(791)  评论(0编辑  收藏  举报