Coder Social home page Coder Social logo

mio-serial's Introduction

Crates.io MIT licensed Build Status

mio-serial: A serial port IO library MIO.

mio-serial provides a serial port implementation using mio.

Usage

Add mio-serial to you Cargo.toml:

[dependencies]
mio-serial = "5.0.1"

Then add this to your crate root:

extern crate mio_serial;

Features

The "libudev" dependency of serialport-rs is enabled by default. For x86 linux systems this enables the available_ports function for port enumeration. Not all targets support udev, especially when cross-compiling. To disable this feature, compile with the --no-default-features option. For example:

cargo build --no-default-features

MSRV

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

Examples

A few examples can be found here.

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

License

This software is licensed under MIT.

This software builds upon the MPL-2.0 licensed serialport-rs and constitutes a "Larger Work" by that license. The source for serialport-rs can be found at https://gitlab.com/susurrus/serialport-rs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.