From c9c44a934daad581541fc2dfbbedd340d8212013 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 5 Mar 2021 12:37:26 +0800 Subject: [PATCH] don't generate acks for locally sourced msgs --- docs/software/TODO.md | 2 ++ src/mesh/MeshPlugin.cpp | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/software/TODO.md b/docs/software/TODO.md index 622a95af3..d256cd15d 100644 --- a/docs/software/TODO.md +++ b/docs/software/TODO.md @@ -34,6 +34,8 @@ You probably don't care about this section - skip to the next one. * DONE combine acks and responses in a single message if possible (do routing plugin LAST and drop ACK if someone else has already replied) * DONE don't send packets we received from the phone BACK TOWARDS THE PHONE (possibly use fromnode 0 for packets the phone sends?) * fix 1.1.50 android debug panel display +* test android channel setting +* release to users * DONE warn in android app about unset regions * DONE use set-channel from android * DONE add gui in android app for setting region diff --git a/src/mesh/MeshPlugin.cpp b/src/mesh/MeshPlugin.cpp index 562f31c73..e17cc5475 100644 --- a/src/mesh/MeshPlugin.cpp +++ b/src/mesh/MeshPlugin.cpp @@ -109,7 +109,11 @@ void setReplyTo(MeshPacket *p, const MeshPacket &to) { assert(p->which_payloadVariant == MeshPacket_decoded_tag); // Should already be set by now p->to = getFrom(&to); - p->want_ack = to.want_ack; + + // No need for an ack if we are just delivering locally (it just generates an ignored ack) + p->want_ack = (to.from != 0) ? to.want_ack : false; + if(p->priority == MeshPacket_Priority_UNSET) + p->priority = MeshPacket_Priority_RELIABLE; p->decoded.request_id = to.id; }