Closed lukasbeckercode closed 4 years ago
If nothing is printed, then you are not reading any data. If printing does not stop, then there is aways data coming in, so there is no sense of stopping.
You probably want an application-specific condition for stopping, there is no general solution.
For the example code, you have to exist the program manually.
Probably the example is misleading. the condition n==0 should never happen in this example (unless a timeout happens, but we do not support timeout as of now, or the port is disconnected, but this should not happen in normal conditions).
I will produce a better example...
I changed the example myself and opened a pull request. Please tell me if i did something wrong as I´m new to github and still inexperienced. But i hope i was able to help you. Thanks for the awesome code btw!
In the example Project, there is this block of code:
However, if n==0 never becomes true on my machine, so the reading doesn´t stop