From 7dc750d68bb5b52969c5c33ebe84b4962cd200af Mon Sep 17 00:00:00 2001 From: Finn Date: Thu, 17 Oct 2024 00:08:14 -0700 Subject: [PATCH] Log payload --- src/meshtastic.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/meshtastic.rs b/src/meshtastic.rs index 60593d8..83efdad 100644 --- a/src/meshtastic.rs +++ b/src/meshtastic.rs @@ -56,7 +56,7 @@ impl MeshtasticClient { match payload_variant { PayloadVariant::Packet(packet) => { - let payload_variant = match packet.payload_variant { + let payload_variant = match &packet.payload_variant { Some(payload_variant) => payload_variant, None => { log::debug!( @@ -68,7 +68,7 @@ impl MeshtasticClient { match payload_variant { mesh_packet::PayloadVariant::Decoded(decoded) => { - handle_decoded_packet(&matrix_sender, decoded).await?; + handle_decoded_packet(&matrix_sender, &packet, decoded).await?; } mesh_packet::PayloadVariant::Encrypted(encrypted) => { log::debug!( @@ -113,11 +113,13 @@ impl MeshtasticClient { async fn handle_decoded_packet( matrix_sender: &Sender, - // packet: MeshPacket, - decoded: Data, + packet: &meshtastic::protobufs::MeshPacket, + decoded: &Data, ) -> Result<(), Box> { match decoded.portnum() { meshtastic::protobufs::PortNum::TextMessageApp => { + log::debug!("posting packet to matrix: {:?}", packet); + log::debug!("decoded: {:?}", decoded); debug_message( &matrix_sender, format!(