serialport_test

Crates.ioserialport_test
lib.rsserialport_test
version0.1.1
created_at2025-01-18 09:01:16.756691+00
updated_at2025-01-18 09:08:08.292402+00
descriptionA comprehensive tool designed for continuous read/write testing of serial devices.
homepage
repositoryhttps://github.com/wesleyel/serialport_test
max_upload_size
id1521462
size43,297
Wesley Yang (wesleyel)

documentation

README

SerialPort Test

Crates.io Version

A comprehensive tool designed for continuous read/write testing of serial devices.

Features

  • Main Thread Operations: The main thread is responsible for writing test commands to the serial port.

  • Asynchronous Monitoring: Utilizes a tokio reader thread to continuously monitor the serial port output. Upon receiving the expected output, it promptly notifies the main thread.

  • Logging and Metrics: Integrated logging and metrics for enhanced monitoring and debugging.

  • Graceful Termination: Supports stopping the test gracefully using ctrl+c.

Usage

Change TestSuite in src/cli.rs to your desired test suite.

Usage: serial_test [OPTIONS] <PORT>

Arguments:
  <PORT>  Serial port to connect

Options:
  -b, --baud <BAUD>
          Baud rate [default: 921600]
  -t, --test-seconds <TEST_SECONDS>
          Test total times in seconds [default: 10]
  -i, --interval <INTERVAL>
          Test interval in milliseconds [default: 1000]
      --round-timeout <ROUND_TIMEOUT>
          Round max timeout in milliseconds [default: 600]
      --round-interval <ROUND_INTERVAL>
          Round interval in milliseconds [default: 100]
  -m, --max-fail-count <MAX_FAIL_COUNT>
          Max continuous fail count [default: 3]
  -v, --verbose...
          Increase verbosity
  -s, --test-suite <TEST_SUITE>
          Test suite [default: regular] [possible values: regular, single-bd]
  -h, --help
          Print help

License

This project is licensed under the MIT License.

Commit count: 24

cargo fmt