Crates.io | multican |
lib.rs | multican |
version | 0.6.0-beta.1 |
source | src |
created_at | 2019-10-28 15:15:09.806318 |
updated_at | 2020-08-21 11:19:30.195799 |
description | Provides connections to multiple CAN busses at the same time. Allows use of different types of networks |
homepage | |
repository | https://github.com/Dawn-Equipment-Company/multican |
max_upload_size | |
id | 176399 |
size | 101,640 |
Library that supports different CANBUS scenarios, especially those that require multiple busses to operate at the same time.
Typical usage: 3 busses, using mixed network types
[[can_networks]]
id = 0
kind = "socketcan"
[[can_networks]]
id = 1
kind = "socketcan"
[[can_networks]]
id = 2
kind = "udp"
// read the config file however you'd like
let network_config = read_config("can.toml");
let network = multican::from_config(network_config);
// receive from all busses:
for rx in network.recv() {
println!("RX: {:?}", rx);
}
// send a message to bus 2
let m = CanMessage { bus: 2, header: 0x12345678, data: vec![1, 2, 3, 4] };
network.send(m);