22 releases (12 stable)

5.4.4 Nov 2, 2022
5.4.3 Mar 23, 2022
5.4.1 Aug 8, 2021
5.4.0-beta4 Jul 23, 2021
0.1.0 Feb 2, 2017

#17 in Asynchronous

Download history 21965/week @ 2024-08-06 20187/week @ 2024-08-13 21090/week @ 2024-08-20 16336/week @ 2024-08-27 18464/week @ 2024-09-03 17348/week @ 2024-09-10 17375/week @ 2024-09-17 18569/week @ 2024-09-24 15812/week @ 2024-10-01 17334/week @ 2024-10-08 20164/week @ 2024-10-15 22106/week @ 2024-10-22 18139/week @ 2024-10-29 18721/week @ 2024-11-05 20388/week @ 2024-11-12 17934/week @ 2024-11-19

78,751 downloads per month
Used in 84 crates (74 directly)

MIT license

29KB
478 lines

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

Dependencies

~5–13MB
~150K SLoC