ISO Example for reading/writing uart/rs-232

Thilo Schulz thilo at
Tue Dec 15 23:06:10 CET 2015


> If I halt the read/write watchers at the callback function, where should I
> start them again?

Obviously, you do it from any other event source that makes you want to write 
and/or read to/from the serial device.
That can be any other watcher that has been started, like, one that listens 
for network events, or from normal program flow outside the event loop. 
ev_run() returns once all watchers have stopped, as illustrated by my example.

> The UART bus interface I'm designing will most likely
> have a continuous flow of data needing to be written and read (at most
> times).

I also have the impression that your notion of a watcher is that it's 
exclusively for reading or writing. That is not true. A watcher can be 
configured to watch for both, read _and_ write events at the same time and will 
then report which incoming events occurred in the third integer argument.

Best regards,
Thilo Schulz

More information about the libev mailing list