SocketCAN based experimental library that implements proposed (PR) embedded-hal CAN traits

SocketCAN based experimental library that implements proposed (MIT license (LICENSE-MIT or socketcan-rs

candev

SocketCAN based experimental library that implements proposed (PR) embedded-hal CAN traits.

Running the examples

Prerequisites

  1. Make sure the can-utils package in installed on your system
  2. Setup Virtual CAN device as follows:

Note that this can be automated at startup by:

  1. Adding a line with vcan in /etc/modules
  2. Adding the following to /etc/network/interfaces

Receive

A simple example on how to receive a CAN frame

  1. Run cargo run --example receive in a terminal
  2. Run cansend vcan0 123#DEADBEEF in another terminal

You should see 123#DEADBEEF (or whatever id and data you passed to cansend) appear on the first terminal.

Transmit

A simple example on how to transmit a CAN frame.

  1. Run candump vcan0 in a terminal
  2. Run cargo run --example transmit in another terminal

You should see candump output vcan0 001 [4] DE AD BE FF.

Driver

A sample driver embedded-hal CAN driver implementation that makes use of candev and simple echoes a message. In this example, two instances of the driver ping pong a message to each other.

To observe the behavior, do as follows:

  1. Run candump vcan0 in a terminal
  2. Run cargo run --example driver in another terminal

You'll be able to observe the interaction of the two driver instances on the first terminal.

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.40 and up. It might compile with older versions but that may change in any new patch release.

License

Licensed under either of

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or <#404>)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Credits

This project initial starting point was based off socketcan-rs.

Big thanks to Timo for his help and developing the CAN traits for the embedded-hal project.

Issues

Collection of the latest Issues

Information - Updated Jun 23, 2022

Stars: 3
Forks: 2
Issues: 2

pancurses is a curses library for Rust that supports both Linux and Windows

by abstracting away the backend that it uses

pancurses is a curses library for Rust that supports both Linux and Windows

Native Rust library for managing Linux Control Groups (cgroups)

This crate, curently, only supports the original, V1 hierarchy

Native Rust library for managing Linux Control Groups (cgroups)

The Rust spidev seeks to provide full access to the Linux spidev

The following is not an exhaustive demonstration of the Spidev

The Rust spidev seeks to provide full access to the Linux spidev

a minimal Linux kernel module written in rust

A recent build of Rust (latest nightly)

a minimal Linux kernel module written in rust

Rust Linux Worker

The Service executes arbitrary Linux commands on behalf of clients

Rust Linux Worker

Direct, unsafe Rust bindings for Linux's perf_event_open system call

This crate exports unsafe Rust wrappers for Linux system calls for accessing

Direct, unsafe Rust bindings for Linux's perf_event_open system call

A safe, sane Rust interface to libseccomp on Linux

Note: This is not a high-level interface; most functions/methods in this library directly correspond to a libseccomp function

A safe, sane Rust interface to libseccomp on Linux

A transparent TCP to SOCKSv5/HTTP proxy on Linux written in Rust

Transparent TCP proxy with iptables -j REDIRECT or nft redirect to

A transparent TCP to SOCKSv5/HTTP proxy on Linux written in Rust

Linux-Device-Driver-Rust

This is a twain Repo of Linux-Device-Driver is a long time work in which I rewrite all examples in

Linux-Device-Driver-Rust

Simple, performant hot-reloading for Rust

Requires Rust nightly and only works on Linux and Windows for now

Simple, performant hot-reloading for Rust
Facebook Instagram Twitter GitHub Dribbble
Privacy