Skip to content

Commit

Permalink
drivers: fake: sink: Add human friendly message
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric authored and joaoantoniocardoso committed Sep 7, 2024
1 parent 2785e0e commit 3f02501
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/drivers/fake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ impl Driver for FakeSink {
}
}

let mut bytes = mavlink::peek_reader::PeekReader::new(message.raw_bytes());
let (header, message): (mavlink::MavHeader, mavlink::ardupilotmega::MavMessage) =
mavlink::read_v2_msg(&mut bytes).unwrap();
if self.print {
println!("Message received: {message:?}");
println!("Message received: {header:?} {message:?}");
} else {
trace!("Message received: {message:?}");
trace!("Message received: {header:?} {message:?}");
}
}

Expand Down

0 comments on commit 3f02501

Please sign in to comment.