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 {
|
match payload_variant {
|
||||||
PayloadVariant::Packet(packet) => {
|
PayloadVariant::Packet(packet) => {
|
||||||
let payload_variant = match packet.payload_variant {
|
let payload_variant = match &packet.payload_variant {
|
||||||
Some(payload_variant) => payload_variant,
|
Some(payload_variant) => payload_variant,
|
||||||
None => {
|
None => {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
|
@ -68,7 +68,7 @@ impl MeshtasticClient {
|
||||||
|
|
||||||
match payload_variant {
|
match payload_variant {
|
||||||
mesh_packet::PayloadVariant::Decoded(decoded) => {
|
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) => {
|
mesh_packet::PayloadVariant::Encrypted(encrypted) => {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
|
@ -113,11 +113,13 @@ impl MeshtasticClient {
|
||||||
|
|
||||||
async fn handle_decoded_packet(
|
async fn handle_decoded_packet(
|
||||||
matrix_sender: &Sender<RoomMessageEventContent>,
|
matrix_sender: &Sender<RoomMessageEventContent>,
|
||||||
// packet: MeshPacket,
|
packet: &meshtastic::protobufs::MeshPacket,
|
||||||
decoded: Data,
|
decoded: &Data,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
match decoded.portnum() {
|
match decoded.portnum() {
|
||||||
meshtastic::protobufs::PortNum::TextMessageApp => {
|
meshtastic::protobufs::PortNum::TextMessageApp => {
|
||||||
|
log::debug!("posting packet to matrix: {:?}", packet);
|
||||||
|
log::debug!("decoded: {:?}", decoded);
|
||||||
debug_message(
|
debug_message(
|
||||||
&matrix_sender,
|
&matrix_sender,
|
||||||
format!(
|
format!(
|
||||||
|
|
Loading…
Reference in a new issue