Asynchronous Linux SocketCAN - Broadcast Manager support (BCM) with tokio

Overview

tokio-socketcan-bcm

LICENSE VERSION docs

The Broadcast Manager protocol provides a command based configuration interface to filter and send (e.g. cyclic) CAN messages in kernel space. Filtering messages in kernel space may significantly reduce the load in an application.

A BCM socket is not intended for sending individual CAN frames. To send invidiual frames use the tokio-socketcan crate.

This crate would not have been possible without the socketcan crate.

Example

use std::time;
use futures_util::stream::StreamExt;
use tokio_socketcan_bcm::{BCMSocket, Id, StandardId};

#[tokio::main]
async fn main() {
    let socket = BCMSocket::open_nb("vcan0").unwrap();
    let ival = time::Duration::from_millis(0);

    // create a stream of messages that filters by the can frame id 0x123
    let id = Id::Standard(StandardId::new(0x123).unwrap());
    let mut can_frame_stream = socket
        .filter(id, ival, ival)
        .unwrap();

    while let Some(frame) = can_frame_stream.next().await {
        println!("Frame {:?}", frame);
        ()
    }
}
You might also like...
Altruistic Angelshark is a project devoted to making Communication Manager (ACM) automation easier.

This project makes automating over one or more Communication Managers easier via OSSI over SSH.

Simple  SSH, TELNET connection manager written in rust
Simple SSH, TELNET connection manager written in rust

gcoma gcoma or Geri's Connection Manager is a small project, that I started to learn rust. The goal of this project is to create a MTPuTTY like cli ap

Authentication workaround for N-Central Report Manager.

Authentication workaround for N-Central Report Manager. Takes the link that N-Central creates for Report Manager and outputs a working link.

Ark Server Manager: Ascended

Ark Server Manager: Ascended Latest Development Build: Dev Build Development builds are not recommended for use by non-developers. They may be quite b

A high performence Socks5 proxy server with bind/reverse support implementation by Rust.

rsocx A high performence Socks5 proxy server with bind/reverse support implementation by Rust Features Async-std No unsafe code Single executable Linu

A Rust compiler plugin and support library to annotate overflow behavior

overflower This project contains a compiler plugin and supporting library to allow the programmer to annotate their code to declare how integer overfl

Lightweight p2p library. Support build robust stable connection on p2p/distributed network.

Chamomile Build a robust stable connection on p2p network features Support build a robust stable connection between two peers on the p2p network. Supp

Many modbus devices support only one or very few clients

Modbus TCP proxy Many modbus devices support only one or very few clients. This proxy acts as a bridge between the client and the modbus device. It ca

UDP proxy with Proxy Protocol and mmproxy support
UDP proxy with Proxy Protocol and mmproxy support

udppp UDP proxy with Proxy Protocol and mmproxy support. Features Async Support Proxy Protocol V2 SOCKET preserve client IP addresses in L7 proxies(mm

Comments
  • Support for broadcasting a message repeatedly?

    Support for broadcasting a message repeatedly?

    Hi there, This looks like a handy tool. The docs say this can send (e.g. cyclic) CAN messages, but looking at the examples and docs I am seeing a focus only on listening to messages broadcast from elsewhere. What is the status of sending cyclic messages? Is it supported? If so, can you point me towards those methods/structs that can do it? I am not seeing them.

    Thanks!

    opened by theryangeary 1
Releases(1.0.0)
Owner
Marcel
don't forget to play.
Marcel
Interactive bind/reverse PTY shell with Windows&Linux support implementation by Rust.

Cliws Lightweight interactive bind/reverse PTY shell with Windows&Linux support implementation by Rust. Features WebSocket Full pty support: VIM, SSH,

b23r0 215 Dec 3, 2021
A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...

Tokio A runtime for writing reliable, asynchronous, and slim applications with the Rust programming language. It is: Fast: Tokio's zero-cost abstracti

Tokio 18.7k Dec 30, 2022
An asynchronous Prometheus exporter for iptables

iptables_exporter An asynchronous Prometheus exporter for iptables iptables_exporter runs iptables-save --counter and scrapes the output to build Prom

Kevin K. 21 Dec 29, 2022
General-purpose asynchronous socket stream.

async-socket This crate implements a general-purpose asynchronous socket. The Socket implements AsyncRead, AsyncWrite, Stream and Clone traits and thu

Kristijan Sedlak 3 Oct 20, 2021
An asynchronous dumb exporter proxy for prometheus. This aggregates all the metrics and exposes as a single scrape endpoint.

A dumb light weight asynchronous exporter proxy This is a dumb lightweight asynchronous exporter proxy that will help to expose multiple application m

Dark streams 3 Dec 4, 2022
Rust Tokio 异步多客户端网络框架 高并发 插件化

Rust实现的异步多客户端网络框架,基于tokio和mlua,可自定义通讯协议 插件化采用lua。应用场景im,game server,bot等.

OPQBOT 22 Jul 19, 2022
A super minimal wrapper around unix sockets for IPC on top of tokio.

tokio-unix-ipc This crate implements a minimal abstraction over UNIX domain sockets for the purpose of IPC on top of tokio.

Armin Ronacher 26 Nov 18, 2022
A proxy implement with http / socks5 in-bound and vmess out-bound, written in Rust and tokio.rs

tokio-vmess an Asynchronous proxy implement with http / socks5 in-bound and vmess out-bound, written in Rust and tokio Run example first, Fill out the

irumeria 7 Oct 3, 2022
Super simple tokio chat server for educational purposes.

achat A collection of simple modules which showcase simple use of tasks, channels, and other tokio primitives to implement simple networking applicati

Rafael Bachmann 2 Dec 29, 2022
Stream API for tokio-udp.

UDPflow Stream API for tokio-udp. TCP-like UDP stream use tokio::net::UdpSocket; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use udpflow::{UdpListen

zephyr 5 Dec 2, 2022