8 unstable releases (3 breaking)

0.4.0 Oct 28, 2021
0.3.0 Apr 15, 2021
0.2.2 Jul 21, 2020
0.2.1 Mar 15, 2020
0.1.2 Feb 6, 2020

#911 in Hardware support

28 downloads per month

BSD-3-Clause

38KB
1K SLoC

socketcan-alt

Rust binding for SocketCAN


lib.rs:

Rust binding for SocketCAN

Example

use socketcan_alt::{DataFrame, Frame, Id, Socket};
use std::ffi::CString;

let socket = Socket::bind(CString::new("vcan0")?)?;
socket.set_recv_own_msgs(true)?;

let frame = DataFrame::new(Id::Standard(42), &[0, 1, 2, 3, 4, 5, 6, 7]);
socket.send(&Frame::Data(frame))?;

let frame = socket.recv()?;
println!("{:?}", frame);

Dependencies

~0.2–10MB
~98K SLoC