Open anton-dutov opened 1 month ago
Hey!
I think you have two options:
Migrate to tokio_util::codec
as recommended by tokio_codec
. Then you can use get_ref()
or get_mut()
.
If you can not migrate for some reason, you could use try_clone()
before wrapping the serial port. Be sure not to perform reads or writes with the cloned serial port though, since it will interfere with tokio-codec
.
:smiley:
Thank you, it looks like what I need.
In my project i need to monitor cts/dsr pins and should have exchange with device by complex protocol. So i use tokio-codec, but it's takes ownership of port itself and i can't read pin states. is it possible to separate control flow and data flow? To allow me use codec on data flow, and reading pin states on control flow.
Something like that