
Autosar DLT Support
A library that support efficient parsing & writing log-messages encoded as Diagnositic
Log
and Trace
messages.
Features
- compliant with the official Autosar DLT specification
- efficiently parse binary DLT content
- serialize DLT messages
- support for non-verbose messages via FIBEX file information
Usage
Add this to your Cargo.toml
:
[dependencies]
dlt_core = "0.10"
This is an example of how to parse a message and serialize it back to a byte array.
use dlt_core::dlt_parse::{dlt_message, ParsedMessage};
fn main() {
let raw1: Vec<u8> = vec![
0x44, 0x4C, 0x54, 0x01,
0x2B, 0x2C, 0xC9, 0x4D, 0x7A, 0xE8, 0x01,
0x00, 0x45, 0x43, 0x55, 0x00,
0x21,
0x0A, 0x00, 0x13,
0x41, 0x01, 0x4C, 0x4F, 0x47, 0x00, 0x54, 0x45, 0x53, 0x32, 0x10,
0x00, 0x00, 0x00, 0x6F,
];
match dlt_message(&raw1[..], None, true) {
Ok((_rest, ParsedMessage::Item(msg))) => {
let msg_bytes = msg.as_bytes();
assert_eq!(raw1, msg_bytes);
}
_ => panic!("could not parse message"),
}
}