I need to perform a simple exchange via serial port in my program. I cannot find any working examples or documentation related to serial ports. I need to open a serial port, configure a port (set speed, parity, stopbits, etc), write/read binary data and then close is.
I tried to use https://github.com/japaric/serial.rs, but this library is outdated (it doesn't even compile on Rust 1.0). Even then, this library only provided functionally on how to configure the serial port but not to use it.
On UNIX serial port is represented by a character device, whcih can be accessed via ordinary system calls that are used for file I/O. The only addition that you would care about with respect to serial port is ioctl
, that's what you will use to set baud rate and other parameters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With