diff --git a/README.md b/README.md index 11e27fe..1762293 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ for dlt_message in SliceIterator::new(&buffer) { match dlt_message { Ok(dlt_slice) => { //check if the message is verbose or non verbose (non verbose messages have message ids) - if let Some(message_id) = dlt_slice.message_id() { + if let Some((message_id, non_verbose_payload)) = dlt_slice.message_id_and_payload() { println!("non verbose message {:x}", message_id); - println!(" with payload {:?}", dlt_slice.non_verbose_payload()); + println!(" with payload {:?}", non_verbose_payload); } else { println!("verbose message (parsing not yet supported)"); } diff --git a/examples/print_dlt_file.rs b/examples/print_dlt_file.rs index 1f64f1f..4d1cdd2 100644 --- a/examples/print_dlt_file.rs +++ b/examples/print_dlt_file.rs @@ -23,7 +23,7 @@ fn main() -> Result<(), ReadError> { println!("{:?}", msg.storage_header); - if let Some(message_id) = msg.packet.message_id() { + if let Some((message_id, non_verbose_payload)) = msg.packet.message_id_and_payload() { if let Some(extended_header) = msg.packet.extended_header() { use core::str::from_utf8; @@ -46,7 +46,7 @@ fn main() -> Result<(), ReadError> { } else { println!("non verbose message 0x{:x}", message_id); } - println!(" with payload {:?}", msg.packet.non_verbose_payload()); + println!(" with payload {:?}", non_verbose_payload); } else { println!("verbose message (parsing not yet supported)"); } diff --git a/src/lib.rs b/src/lib.rs index 1754dbf..4941a6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,9 +78,9 @@ //! match dlt_message { //! Ok(dlt_slice) => { //! //check if the message is verbose or non verbose (non verbose messages have message ids) -//! if let Some(message_id) = dlt_slice.message_id() { +//! if let Some((message_id, non_verbose_payload)) = dlt_slice.message_id_and_payload() { //! println!("non verbose message {:x}", message_id); -//! println!(" with payload {:?}", dlt_slice.non_verbose_payload()); +//! println!(" with payload {:?}", non_verbose_payload); //! } else { //! println!("verbose message (parsing not yet supported)"); //! }