This commit is contained in:
parent
008f7cdc08
commit
7dc750d68b
1 changed files with 6 additions and 4 deletions
|
@ -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<RoomMessageEventContent>,
|
||||
// packet: MeshPacket,
|
||||
decoded: Data,
|
||||
packet: &meshtastic::protobufs::MeshPacket,
|
||||
decoded: &Data,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
match decoded.portnum() {
|
||||
meshtastic::protobufs::PortNum::TextMessageApp => {
|
||||
log::debug!("posting packet to matrix: {:?}", packet);
|
||||
log::debug!("decoded: {:?}", decoded);
|
||||
debug_message(
|
||||
&matrix_sender,
|
||||
format!(
|
||||
|
|
Loading…
Reference in a new issue