From af3d7c316ae3286429790d3345865929753a360b Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 17 Oct 2024 00:39:52 -0700 Subject: [PATCH] include some debug info in matrix message --- src/meshtastic.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/meshtastic.rs b/src/meshtastic.rs index 83efdad..4e3bb50 100644 --- a/src/meshtastic.rs +++ b/src/meshtastic.rs @@ -120,15 +120,18 @@ async fn handle_decoded_packet( meshtastic::protobufs::PortNum::TextMessageApp => { log::debug!("posting packet to matrix: {:?}", packet); log::debug!("decoded: {:?}", decoded); - debug_message( - &matrix_sender, - format!( - "Text from {:?}: {}", - decoded.source, - std::str::from_utf8(&decoded.payload)? - ), - ) - .await?; + + let message = format!( + "text from {:02x}: {} (snr: {}, rssi: {}, hop limit: {}, hop start: {})", + packet.from, + std::str::from_utf8(&decoded.payload)?, + packet.rx_snr, + packet.rx_rssi, + packet.hop_limit, + packet.hop_start + ); + + debug_message(&matrix_sender, message).await?; } _ => log::debug!( "dropping packet we havent implemented support for ({})",