mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 03:29:17 +00:00
adding user pref to aid in testing.
This commit is contained in:
parent
ef4850ec8c
commit
584ecd0b4e
@ -160,6 +160,10 @@ void FloodingRouter::mergeMyCoverage(CoverageFilter &coverage)
|
|||||||
|
|
||||||
float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming, NodeNum from)
|
float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming, NodeNum from)
|
||||||
{
|
{
|
||||||
|
#ifdef USERPREFS_USE_COVERAGE_FILTER
|
||||||
|
bool useCoverageFilter = USERPREFS_USE_COVERAGE_FILTER;
|
||||||
|
if (!useCoverageFilter) return 1.0f;
|
||||||
|
#endif
|
||||||
// If we are a router or repeater, always forward because it's assumed these are in the most advantageous locations
|
// 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 ||
|
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
|
||||||
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
config.device.role == meshtastic_Config_DeviceConfig_Role_REPEATER) {
|
||||||
@ -203,7 +207,7 @@ float FloodingRouter::calculateForwardProbability(const CoverageFilter &incoming
|
|||||||
forwardProb = std::min(std::max(forwardProb, 0.0f), 1.0f);
|
forwardProb = std::min(std::max(forwardProb, 0.0f), 1.0f);
|
||||||
|
|
||||||
LOG_DEBUG("CoverageRatio=%.2f, ForwardProb=%.2f (Uncovered=%d, Total=%zu)", coverageRatio, forwardProb, uncovered,
|
LOG_DEBUG("CoverageRatio=%.2f, ForwardProb=%.2f (Uncovered=%d, Total=%zu)", coverageRatio, forwardProb, uncovered,
|
||||||
recentNeighbors.size());
|
neighbors);
|
||||||
|
|
||||||
return forwardProb;
|
return forwardProb;
|
||||||
}
|
}
|
@ -53,10 +53,12 @@ enum RxSource {
|
|||||||
#define NUM_HASH_FUNCTIONS 2
|
#define NUM_HASH_FUNCTIONS 2
|
||||||
|
|
||||||
// Base forwarding probability - never drop below this value
|
// Base forwarding probability - never drop below this value
|
||||||
|
// 0.2 seems suitable because the worst case False Positive Rate of the
|
||||||
|
// coverage filter is 37%. That's if its fully saturated with 60 unique nodes.
|
||||||
#define BASE_FORWARD_PROB 0.2f
|
#define BASE_FORWARD_PROB 0.2f
|
||||||
|
|
||||||
// Coverage scaling factor
|
// Coverage scaling factor
|
||||||
#define COVERAGE_SCALE_FACTOR 0.9f
|
#define COVERAGE_SCALE_FACTOR 2.0f
|
||||||
|
|
||||||
// Recency threshold in minutes
|
// Recency threshold in minutes
|
||||||
// Currently set to 1 hour because that is the minimum interval for nodeinfo broadcasts
|
// Currently set to 1 hour because that is the minimum interval for nodeinfo broadcasts
|
||||||
|
@ -30,9 +30,10 @@
|
|||||||
// "USERPREFS_LORACONFIG_CHANNEL_NUM": "31",
|
// "USERPREFS_LORACONFIG_CHANNEL_NUM": "31",
|
||||||
// "USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST",
|
// "USERPREFS_LORACONFIG_MODEM_PRESET": "meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST",
|
||||||
// "USERPREFS_SPLASH_TITLE": "DEFCONtastic",
|
// "USERPREFS_SPLASH_TITLE": "DEFCONtastic",
|
||||||
"USERPREFS_TZ_STRING": "tzplaceholder "
|
"USERPREFS_TZ_STRING": "tzplaceholder ",
|
||||||
// "USERPREFS_USE_ADMIN_KEY_0": "{ 0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c }",
|
// "USERPREFS_USE_ADMIN_KEY_0": "{ 0xcd, 0xc0, 0xb4, 0x3c, 0x53, 0x24, 0xdf, 0x13, 0xca, 0x5a, 0xa6, 0x0c, 0x0d, 0xec, 0x85, 0x5a, 0x4c, 0xf6, 0x1a, 0x96, 0x04, 0x1a, 0x3e, 0xfc, 0xbb, 0x8e, 0x33, 0x71, 0xe5, 0xfc, 0xff, 0x3c }",
|
||||||
// "USERPREFS_USE_ADMIN_KEY_1": "{}",
|
// "USERPREFS_USE_ADMIN_KEY_1": "{}",
|
||||||
// "USERPREFS_USE_ADMIN_KEY_2": "{}"
|
// "USERPREFS_USE_ADMIN_KEY_2": "{}",
|
||||||
// "USERPREFS_NODEINFO_BROADCAST_CHANNEL_HASH": "8"
|
// "USERPREFS_NODEINFO_BROADCAST_CHANNEL_HASH": "8"
|
||||||
|
"USERPREFS_USE_COVERAGE_FILTER": "true"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user