I have also figured out why it used to receive some data and then stop. It seems that it’s the driver that takes care of the serial buffer, not the individual programs, so if DTR is enabled (for example by running rngcapture) and I open the serial port from c#, there is still some data in the buffer and the c# program receives that.
I have confirmed this by first running my program with DTR on and then stopping it. Then if I run the program with DTR set to off, I receive some data and then the stream stops (data still in the serial buffer). If I run the program again after that with DTR still off, the program receives absolutely nothing (as the serial buffer had been emptied by the previous run of the program). I then turn DTR back on and I start getting data again.
-
This reply was modified 9 years, 7 months ago by VrIgHtEr.