jpnevulator icon indicating copy to clipboard operation
jpnevulator copied to clipboard

Flush output stream after printing state of control lines.

Open msemeniuk opened this issue 3 years ago • 0 comments

Lack of stdout flushing after printing state of control lines causes unpredictable delays when we are going to redirect stdout to file or use pipe to next process. Testing: env: Linux Debian bookworm/sid 5.14.0-2-amd64 #1 SMP Debian 5.14.9-2 (2021-10-03) x86_64 GNU/Linux prereq: USB serial converter or phy serial port

Run ./jpnevulator -t /dev/ttyUSB0 -r -C -g - S -a 1>1.txt, next after 3-5 seconds kill it with ctrl+c File 1.txt should include something like:

2021-11-14 11:28:53.761480:
le=0, dtr=1, rts=1, st=0, sr=0, cts=0, cd=0, ri=0, dsr=0

1.txt file will be empty without flushing stdout.

msemeniuk avatar Nov 14 '21 10:11 msemeniuk