mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Scale default intervals based for *online* mesh size past 40 nodes (#4277)
* Add congestion scaling coefficient * Added active mesh sized based interval scaling * Moved back to bottom * Format * Add observers and use correct number of online nodes
This commit is contained in:
@@ -29,4 +29,17 @@ class Default
|
||||
static uint32_t getConfiguredOrDefaultMs(uint32_t configuredInterval);
|
||||
static uint32_t getConfiguredOrDefaultMs(uint32_t configuredInterval, uint32_t defaultInterval);
|
||||
static uint32_t getConfiguredOrDefault(uint32_t configured, uint32_t defaultValue);
|
||||
static uint32_t getConfiguredOrDefaultMsScaled(uint32_t configured, uint32_t defaultValue, uint32_t numOnlineNodes);
|
||||
|
||||
private:
|
||||
static float congestionScalingCoefficient(int numOnlineNodes)
|
||||
{
|
||||
if (numOnlineNodes <= 40) {
|
||||
return 1.0; // No scaling for 40 or fewer nodes
|
||||
} else {
|
||||
// Sscaling based on number of nodes over 40
|
||||
int nodesOverForty = (numOnlineNodes - 40);
|
||||
return 1.0 + (nodesOverForty * 0.075); // Each number of online node scales by 0.075
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user