Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NotificationsYou must be signed in to change notification settings

marcelbuesing/tokio-socketcan-bcm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LICENSEVERSIONdocs

The Broadcast Manager protocol provides a command based configurationinterface 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 thetokio-socketcan crate.

This crate would not have been possible without thesocketcan crate.

Example

use std::time;use futures_util::stream::StreamExt;use tokio_socketcan_bcm::{BCMSocket,Id,StandardId};#[tokio::main]asyncfnmain(){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 0x123let id =Id::Standard(StandardId::new(0x123).unwrap());letmut can_frame_stream = socket.filter(id, ival, ival).unwrap();whileletSome(frame) = can_frame_stream.next().await{println!("Frame {:?}", frame);()}}

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp