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!(