Function dlt_core::parse::dlt_message

source ·
pub fn dlt_message<'a>(
    input: &'a [u8],
    filter_config_opt: Option<&ProcessedDltFilterConfig>,
    with_storage_header: bool
) -> Result<(&'a [u8], ParsedMessage), DltParseError>
Expand description

Parse a DLT-message from some binary input data.

A DLT message looks like this: <STANDARD-HEADER><EXTENDED-HEADER><PAYLOAD>

if stored, an additional header is placed BEFORE all of this <storage-header><...>

example: 444C5401 262CC94D D8A20C00 45435500 3500001F 45435500 3F88623A 16014150 5000434F 4E001100 00000472 656D6F

<STORAGE-HEADER>: 444C5401 262CC94D D8A20C00 45435500 444C5401 = DLT + 0x01 (DLT Pattern) timestamp_sec: 262CC94D = 0x4DC92C26 timestamp_us: D8A20C00 = 0x000CA2D8 ecu-id: 45435500 = b“ECU\0“

3500001F 45435500 3F88623A 16014150 5000434F 4E001100 00000472 656D6F (31 byte)

: 35 00 001F 45435500 3F88623A header type = 0x35 = 0b0011 0101 UEH: 1 - > using extended header MSBF: 0 - > little endian WEID: 1 - > with ecu id WSID: 0 - > no session id WTMS: 1 - > with timestamp message counter = 0x00 = 0 length = 001F = 31 ecu-id = 45435500 = "ECU " timestamp = 3F88623A = 106590265.0 ms since ECU startup (~30 h) -------------------------------------------- : 16014150 5000434F 4E00 message-info MSIN = 0x16 = 0b0001 0110 0 -> non-verbose 011 (MSTP Message Type) = 0x3 = Dlt Control Message 0001 (MTIN Message Type Info) = 0x1 = Request Control Message number of arguments NOAR = 0x01 application id = 41505000 = "APP " context id = 434F4E00 = "CON " -------------------------------------------- payload: 1100 00000472 656D6F 0x11 == SetDefaultLogLevel 00 == new log level (block all messages)