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

How to turn 'tokio_serial::SerialStream' into global static to save it for reuse

Open xiaguangbo opened this issue 1 year ago • 0 comments

image

main

I want to pass the obtained 'SerialStream' to 'PORT' in 'match 0', and then pass 'PORT' to 'attach_slave()' in 'match 1'. This way you don’t have to reopen the serial port every time you read.

other

What should I write in 'tauri::async_runtime::Mutex::new()'?

xiaguangbo avatar Sep 28 '23 11:09 xiaguangbo