crates.io badge documentation

tokio-socketcan

SocketCAN support for tokio based on the socketcan crate.

Example echo server

```rust use futures::stream::Stream; use futures::future::{self, Future};

let socketrx = tokiosocketcan::CANSocket::open("vcan0").unwrap(); let sockettx = tokiosocketcan::CANSocket::open("vcan0").unwrap();

tokio::run(socketrx.foreach(move |frame| { sockettx.writeframe(frame) }).maperr(|err| {})); ```

Testing

Integrating the test into a CI system is non-trivial as it relies on a vcan0 virtual can device existing. Adding one to most linux systems is pretty easy with root access but attaching a vcan device to a container for CI seems difficult to find support for.

To run the tests locally, though, setup should be simple:

sh sudo modprobe vcan sudo ip link add vcan0 type vcan sudo ip link set vcan0 up cargo test

Changelog

0.1.2