Refine trace and group data retries

This commit is contained in:
mikecarper committed 2026-07-13 17:56:08 -07:00
1 parent e3f47b487b
commit fcfca64cc5
15 files changed
+427 -66

No files matched your search

+15 -10
View File
@@ -1827,18 +1827,22 @@ bool MyMesh::hasFloodRetryTargetPrefix(const mesh::Packet* packet) const {
uint8_t MyMesh::getFloodRetryMaxPathLength(const mesh::Packet* packet) const {
uint8_t gate = _prefs.flood_retry_max_path;
if (gate == FLOOD_RETRY_PATH_GATE_DISABLED) {
return FLOOD_RETRY_PATH_GATE_DISABLED;
}
if (gate > 63) {
gate = FLOOD_RETRY_ROOFTOP_MAX_PATH;
if (gate != FLOOD_RETRY_PATH_GATE_DISABLED) {
if (gate > 63) {
gate = FLOOD_RETRY_ROOFTOP_MAX_PATH;
}
uint8_t raw_hops = packet != NULL ? packet->getPathHashCount() : 0;
uint8_t effective_hops = floodRetryEffectivePathLength(packet);
uint8_t ignored_hops = raw_hops > effective_hops ? raw_hops - effective_hops : 0;
uint16_t adjusted_gate = (uint16_t)gate + ignored_hops;
gate = adjusted_gate > 63 ? 63 : (uint8_t)adjusted_gate;
}
uint8_t raw_hops = packet != NULL ? packet->getPathHashCount() : 0;
uint8_t effective_hops = floodRetryEffectivePathLength(packet);
uint8_t ignored_hops = raw_hops > effective_hops ? raw_hops - effective_hops : 0;
uint16_t adjusted_gate = (uint16_t)gate + ignored_hops;
return adjusted_gate > 63 ? 63 : (uint8_t)adjusted_gate;
uint8_t group_data_gate = _prefs.flood_retry_group_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
? FLOOD_RETRY_PATH_GATE_DISABLED
: constrain(_prefs.flood_retry_group_max_path, 0, 63);
return applyGroupDataFloodRetryPathGate(packet, gate, group_data_gate);
}
uint8_t MyMesh::getFloodRetryMaxAttempts(const mesh::Packet* packet) const {
@@ -2388,6 +2392,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
_prefs.direct_retry_recent_enabled = DIRECT_RETRY_RECENT_DEFAULT;
_prefs.flood_retry_attempts = FLOOD_RETRY_ROOFTOP_COUNT;
_prefs.flood_retry_max_path = FLOOD_RETRY_ROOFTOP_MAX_PATH;
_prefs.flood_retry_group_max_path = FLOOD_RETRY_GROUP_MAX_PATH_DEFAULT;
_prefs.flood_retry_bridge_enabled = 0;
_prefs.flood_retry_advert_enabled = FLOOD_RETRY_ADVERT_DEFAULT;
_prefs.flood_channel_data_enabled = 1;
+6 -2
View File
@@ -347,10 +347,13 @@ bool MyMesh::allowFloodRetry(const mesh::Packet* packet) const {
}
uint8_t MyMesh::getFloodRetryMaxPathLength(const mesh::Packet* packet) const {
(void)packet;
return _prefs.flood_retry_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
uint8_t general_gate = _prefs.flood_retry_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
? FLOOD_RETRY_PATH_GATE_DISABLED
: constrain(_prefs.flood_retry_max_path, 0, 63);
uint8_t group_data_gate = _prefs.flood_retry_group_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
? FLOOD_RETRY_PATH_GATE_DISABLED
: constrain(_prefs.flood_retry_group_max_path, 0, 63);
return applyGroupDataFloodRetryPathGate(packet, general_gate, group_data_gate);
}
uint8_t MyMesh::getFloodRetryMaxAttempts(const mesh::Packet* packet) const {
@@ -753,6 +756,7 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
_prefs.flood_max_unscoped = 64;
_prefs.flood_max_advert = 8;
_prefs.flood_channel_data_enabled = 1;
_prefs.flood_retry_group_max_path = FLOOD_RETRY_GROUP_MAX_PATH_DEFAULT;
_prefs.interference_threshold = 0; // disabled
_prefs.radio_fem_rxgain = 1; // LoRa FEM RX gain on by default (FEM boards)
_prefs.cad_enabled = 0; // hardware CAD before TX (off by default; 'set cad on')
+6 -2
View File
@@ -405,10 +405,13 @@ bool SensorMesh::allowFloodRetry(const mesh::Packet* packet) const {
}
uint8_t SensorMesh::getFloodRetryMaxPathLength(const mesh::Packet* packet) const {
(void)packet;
return _prefs.flood_retry_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
uint8_t general_gate = _prefs.flood_retry_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
? FLOOD_RETRY_PATH_GATE_DISABLED
: constrain(_prefs.flood_retry_max_path, 0, 63);
uint8_t group_data_gate = _prefs.flood_retry_group_max_path == FLOOD_RETRY_PATH_GATE_DISABLED
? FLOOD_RETRY_PATH_GATE_DISABLED
: constrain(_prefs.flood_retry_group_max_path, 0, 63);
return applyGroupDataFloodRetryPathGate(packet, general_gate, group_data_gate);
}
uint8_t SensorMesh::getFloodRetryMaxAttempts(const mesh::Packet* packet) const {
@@ -849,6 +852,7 @@ SensorMesh::SensorMesh(mesh::MainBoard& board, mesh::Radio& radio, mesh::Millise
_prefs.disable_fwd = true;
_prefs.flood_max = 64;
_prefs.flood_channel_data_enabled = 1;
_prefs.flood_retry_group_max_path = FLOOD_RETRY_GROUP_MAX_PATH_DEFAULT;
_prefs.interference_threshold = 0; // disabled
_prefs.radio_fem_rxgain = 1; // LoRa FEM RX gain on by default (FEM boards)
_prefs.cad_enabled = 0; // hardware CAD before TX (off by default; 'set cad on')