Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcelbuesing/tokio-socketcan-bcm
Asynchronous Linux SocketCAN - Broadcast Manager support (BCM) with tokio
https://github.com/marcelbuesing/tokio-socketcan-bcm
Last synced: about 2 months ago
JSON representation
Asynchronous Linux SocketCAN - Broadcast Manager support (BCM) with tokio
- Host: GitHub
- URL: https://github.com/marcelbuesing/tokio-socketcan-bcm
- Owner: marcelbuesing
- Created: 2019-03-12T20:27:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-05T13:23:44.000Z (almost 4 years ago)
- Last Synced: 2024-09-13T20:34:35.060Z (3 months ago)
- Language: Rust
- Size: 43 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-rust - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] — Linux SocketCAN BCM support for tokio [<img src="https://api.travis-ci.org/marcelbuesing/tokio-socketcan-bcm.svg?branch=master">](https://travis-ci.org/marcelbuesing/tokio-socketcan-bcm) (Libraries / Automotive)
- awesome-rust - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] — Linux SocketCAN BCM support for tokio (Libraries / Automotive)
- awesome-rust-cn - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] (库 Libraries / 汽车 Automotive)
- awesome-rust - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] - Linux SocketCAN BCM support for tokio (Libraries / Automotive)
- awesome-rust - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] — Linux SocketCAN BCM support for tokio [<img src="https://api.travis-ci.org/marcelbuesing/tokio-socketcan-bcm.svg?branch=master">](https://travis-ci.org/marcelbuesing/tokio-socketcan-bcm) (库 Libraries / 汽车 Automotive)
- awesome-rust-cn - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] — Linux SocketCAN BCM support for tokio [<img src="https://api.travis-ci.org/marcelbuesing/tokio-socketcan-bcm.svg?branch=master">](https://travis-ci.org/marcelbuesing/tokio-socketcan-bcm) (Libraries / Automotive)
- awesome-rust-zh - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](https://crates.io/crates/tokio-socketcan-bcm)] - Linux SocketCAN BCM,支持 tokio[<img src="https://api.travis-ci.org/marcelbuesing/tokio-socketcan-bcm.svg?branch=master">](https://travis-ci.org/marcelbuesing/tokio-socketcan-bcm) (库 / 汽车)
- fucking-awesome-rust - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](crates.io/crates/tokio-socketcan-bcm)] - Linux SocketCAN BCM support for tokio (Libraries / Automotive)
- fucking-awesome-rust - marcelbuesing/tokio-socketcan-bcm - socketcan-bcm](crates.io/crates/tokio-socketcan-bcm)] - Linux SocketCAN BCM support for tokio (Libraries / Automotive)
README
# tokio-socketcan-bcm
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![VERSION](https://img.shields.io/crates/v/tokio-socketcan-bcm.svg)](https://crates.io/crates/tokio-socketcan-bcm)
[![docs](https://docs.rs/tokio-socketcan-bcm/badge.svg)](https://docs.rs/tokio-socketcan-bcm)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](https://crates.io/crates/tokio-socketcan) crate.This crate would not have been possible without the [socketcan crate](https://github.com/mbr/socketcan-rs).
# Example
```Rust
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);
()
}
}
```