[][src]Function multican::from_config

pub fn from_config(config: Vec<CanConfig>) -> MultiCan

Initializes a group of CAN adapters from the specified configuration

Typical entry point for this library. CanConfig can be read from a config file or created manually. Not required to create a multican instance, but useful.

Note that this function contains some sane defaults, but you may need to customize things like the can network prefix. If this is the case, construct your adaters manuall and use add_adapter

Example

// Set up adapters
let cfg = read_config("myfile.toml");
let mut network = multican::from_config(cfg);
for m in network.recv() {
    println!("RX: {:?}", m);
}