From d2f38320c0b468901079a272104e537085f2bb8a Mon Sep 17 00:00:00 2001 From: Pawel Krawczyk Date: Thu, 11 Jul 2024 16:41:39 +0100 Subject: [PATCH] Disable hop limit enforcement Disable hop limit enforcement for Vangelis linear topology. --- protobufs | 2 +- src/mesh/FloodingRouter.cpp | 7 ++++--- src/mesh/ReliableRouter.cpp | 3 ++- src/mesh/generated/meshtastic/config.pb.h | 7 ++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/protobufs b/protobufs index a3030d5ff1..983ee3a4d6 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit a3030d5ff187091c9fbbd08dd797cca5085736fe +Subproject commit 983ee3a4d6fa74e78698f9d92636c548f1f6d2b9 diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index 7866fa444e..5972e9eaec 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -45,8 +45,9 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas if (p->id != 0) { if (config.device.role != meshtastic_Config_DeviceConfig_Role_CLIENT_MUTE) { meshtastic_MeshPacket *tosend = packetPool.allocCopy(*p); // keep a copy because we will be sending it - - tosend->hop_limit--; // bump down the hop count +// Commented out because new role value breaks iOS/Android clients, so this is just disabled for this firmware build +// if(config.device.role != meshtastic_Config_DeviceConfig_Role_NO_HOP_LIMIT) +// tosend->hop_limit--; // bump down the hop count LOG_INFO("Rebroadcasting received floodmsg to neighbors\n"); // Note: we are careful to resend using the original senders node id @@ -61,4 +62,4 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas } // handle the packet as normal Router::sniffReceived(p, c); -} \ No newline at end of file +} diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index d3246b48d0..263d83707d 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -79,7 +79,8 @@ bool ReliableRouter::shouldFilterReceived(const meshtastic_MeshPacket *p) if (wasSeenRecently(p, false) && isRepeated && !MeshModule::currentReply && p->to != nodeDB->getNodeNum()) { LOG_DEBUG("Resending implicit ack for a repeated floodmsg\n"); meshtastic_MeshPacket *tosend = packetPool.allocCopy(*p); - tosend->hop_limit--; // bump down the hop count +// if(config.device.role != meshtastic_Config_DeviceConfig_Role_NO_HOP_LIMIT) +// tosend->hop_limit--; // bump down the hop count Router::send(tosend); } diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 2da4b86e6a..882b5b964d 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -58,7 +58,8 @@ typedef enum _meshtastic_Config_DeviceConfig_Role { Technical Details: Turns off many of the routine broadcasts to favor ATAK CoT packet stream and automatic TAK PLI (position location information) broadcasts. Uses position module configuration to determine TAK PLI broadcast interval. */ - meshtastic_Config_DeviceConfig_Role_TAK_TRACKER = 10 + meshtastic_Config_DeviceConfig_Role_TAK_TRACKER = 10, + meshtastic_Config_DeviceConfig_Role_NO_HOP_LIMIT = 11 } meshtastic_Config_DeviceConfig_Role; /* Defines the device's behavior for how messages are rebroadcast */ @@ -538,8 +539,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_Config_DeviceConfig_Role_MIN meshtastic_Config_DeviceConfig_Role_CLIENT -#define _meshtastic_Config_DeviceConfig_Role_MAX meshtastic_Config_DeviceConfig_Role_TAK_TRACKER -#define _meshtastic_Config_DeviceConfig_Role_ARRAYSIZE ((meshtastic_Config_DeviceConfig_Role)(meshtastic_Config_DeviceConfig_Role_TAK_TRACKER+1)) +#define _meshtastic_Config_DeviceConfig_Role_MAX meshtastic_Config_DeviceConfig_Role_NO_HOP_LIMIT +#define _meshtastic_Config_DeviceConfig_Role_ARRAYSIZE ((meshtastic_Config_DeviceConfig_Role)(meshtastic_Config_DeviceConfig_Role_NO_HOP_LIMIT+1)) #define _meshtastic_Config_DeviceConfig_RebroadcastMode_MIN meshtastic_Config_DeviceConfig_RebroadcastMode_ALL #define _meshtastic_Config_DeviceConfig_RebroadcastMode_MAX meshtastic_Config_DeviceConfig_RebroadcastMode_KNOWN_ONLY