tokio-serial icon indicating copy to clipboard operation
tokio-serial copied to clipboard

Watch for signals

Open anton-dutov opened this issue 3 years ago • 2 comments

Any way to watch input signals (DSR/DCD/CTS) within opened device?

anton-dutov avatar Jul 22 '21 19:07 anton-dutov

Thinking on and off about this. I haven't looked too closely to the internals of Tokio/Mio but my first impression is.... maybe.

You could try modeling some new traits after AsyncRead/AsyncWrite that have similar polling functions to check the status of the control lines. It's outside the scope of time I have to work on these crates at the moment though

berkowski avatar Jul 28 '21 11:07 berkowski

Just to discuss. If we're find some good concept, so we implement it in the future versions

I've thought about this, it is a bit contrary to the general concept of asynchronous streams. This is very rarely needed, but it may require significantly reworking iternals or may be soolved by some custom method like

let (tx, rx, sig_rx) = builder.open_async_and_signals()?;

anton-dutov avatar Aug 05 '21 12:08 anton-dutov