Skip to content

Commit

Permalink
Disable hop limit enforcement
Browse files Browse the repository at this point in the history
Disable hop limit enforcement for Vangelis linear topology.
  • Loading branch information
kravietz committed Jul 11, 2024
1 parent abea389 commit d2f3832
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/mesh/FloodingRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -61,4 +62,4 @@ void FloodingRouter::sniffReceived(const meshtastic_MeshPacket *p, const meshtas
}
// handle the packet as normal
Router::sniffReceived(p, c);
}
}
3 changes: 2 additions & 1 deletion src/mesh/ReliableRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
7 changes: 4 additions & 3 deletions src/mesh/generated/meshtastic/config.pb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d2f3832

Please sign in to comment.