From 3f02501ef8e3d84b31aaf01f6e8b0327c554b995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Sat, 7 Sep 2024 18:20:58 -0300 Subject: [PATCH] drivers: fake: sink: Add human friendly message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/drivers/fake.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/fake.rs b/src/drivers/fake.rs index 58b89b33..b7da176c 100644 --- a/src/drivers/fake.rs +++ b/src/drivers/fake.rs @@ -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:?}"); } }