Serial read () is not the cause of obstruction

Serial read () does not block reasons:

open(dev[lcomPort], O_RDWR | O_NOCTTY | O_NDELAY);

Note: O_NONBLOCK (O_NDELAY Like O_NONBLOCK) is set to non-blocking mode , when read without blocking live, when read in a while loop to read

 

Reason: serial communication when: Open () function can be provided to the serial port blocking and nonblocking ,

Therefore, when the read () when the function is not read data is not blocked , because open (time) is set to the serial port non-blocking mode ;

Released eight original articles · won praise 0 · Views 173

Guess you like

Origin blog.csdn.net/Wang_XB_3434/article/details/104356082