From 6a8e6c15e0163e98b975752289e3fe326dd3334e Mon Sep 17 00:00:00 2001 From: medentem Date: Mon, 23 Dec 2024 13:50:20 -0600 Subject: [PATCH] adjusting params --- src/mesh/FloodingRouter.cpp | 6 ++++++ src/mesh/MeshTypes.h | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mesh/FloodingRouter.cpp b/src/mesh/FloodingRouter.cpp index a49b55ccc..ca267ca64 100644 --- a/src/mesh/FloodingRouter.cpp +++ b/src/mesh/FloodingRouter.cpp @@ -143,6 +143,12 @@ void FloodingRouter::mergeMyCoverage(CoverageFilter &coverage) float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming) { + // If we are a router or repeater, always forward because it's assumed these are in the most advantageous locations + if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER || + config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) { + return 1.0f; + } + // Retrieve recent direct neighbors within the time window std::vector recentNeighbors = nodeDB->getDistinctRecentDirectNeighborIds(RECENCY_THRESHOLD_MINUTES * 60); diff --git a/src/mesh/MeshTypes.h b/src/mesh/MeshTypes.h index 2cd669356..15b027bc6 100644 --- a/src/mesh/MeshTypes.h +++ b/src/mesh/MeshTypes.h @@ -53,13 +53,14 @@ enum RxSource { #define NUM_HASH_FUNCTIONS 2 // Base forwarding probability - never drop below this value -#define BASE_FORWARD_PROB 0.1f +#define BASE_FORWARD_PROB 0.2f // Coverage scaling factor #define COVERAGE_SCALE_FACTOR 0.9f // Recency threshold in minutes -#define RECENCY_THRESHOLD_MINUTES 5 +// Currently set to 1 hour because that is the minimum interval for nodeinfo broadcasts +#define RECENCY_THRESHOLD_MINUTES 60 typedef int ErrorCode;