tokio-serial

Crates.iotokio-serial
lib.rstokio-serial
version5.4.4
sourcesrc
created_at2017-02-02 14:00:16.646221
updated_at2022-11-02 15:37:13.65645
descriptionA serial port implementation for tokio
homepagehttps://github.com/berkowski/tokio-serial
repositoryhttps://github.com/berkowski/tokio-serial
max_upload_size
id8353
size63,816
Eric Stokes (estokes)

documentation

http://docs.rs/tokio-serial

README

Crates.io MIT licensed Build Status

tokio-serial

An implementation of serialport I/O for Tokio, an async framework for rust.

MSRV

The Minimum Supported Rust Version is 1.46.0 as found using cargo-msrv

Usage

Add tokio-serial to you Cargo.toml:

[dependencies]
tokio-serial = "5.4.1"

Tests

Useful tests for serial ports require... serial ports, and serial ports are not often provided by online CI providers. As so, automated build testing are really only check whether the code compiles, not whether it works.

Integration tests are in the tests/ directory and typically require two serial ports to run. The names of the serial ports can be configured at run time by setting the TEST_PORT_NAMES environment variable to a semi-colon delimited string with the two serial port names. The default values are:

  • For Unix: TEST_PORT_NAMES=/dev/ttyUSB0;/dev/ttyUSB1
  • For Windows: TEST_PORT_NAMES=COM1;COM2

IMPORTANT To prevent multiple tests from talking to the same ports at the same time make sure to limit the number of test threads to 1 using:

cargo test -j1 -- --test-threads=1

Resources

tokio.rs serialport-rs

Commit count: 163

cargo fmt