rs-dbc

rs-dbc
is a library written in Rust for parsing and handling CAN DBC files.
1. Example
use std::fs::File;
use std::io::{self, Read};
use rs_dbc::Dbc;
fn main() -> io::Result<()> {
let mut f = File::open("./examples/simple.dbc")?;
let mut buffer = Vec::new();
f.read_to_end(&mut buffer)?;
let dbc = Dbc::from_slice(&buffer).expect("Failed to parse DBC file");
for msg in dbc.messages {
println!("Message Name: {}", msg.message_name);
println!("Message ID: 0x{:X}", msg.message_id.raw());
println!("ID-Format: {}", msg.message_id.kind());
for sig in msg.signals {
println!("Signal Name: {}", sig.name);
println!("Byte Order: {}", sig.byte_order);
println!("Value Type: {}", sig.value_type);
println!("");
}
println!("");
}
Ok(())
}
📞 Support
- 🐛 Issues: Git Issues
- 📧 Contact: Open an issue for questions
Made with ❤️ and Rust
⭐ Star this repo • 📝 Report bug