Enhance traffic management by adjusting position update interval and refining hop exhaustion logic based on channel congestion (#9921)
This commit is contained in:
+2
-2
@@ -32,8 +32,8 @@
|
||||
#define default_map_publish_interval_secs 60 * 60
|
||||
|
||||
// Traffic management defaults
|
||||
#define default_traffic_mgmt_position_precision_bits 24 // ~10m grid cells
|
||||
#define default_traffic_mgmt_position_min_interval_secs ONE_DAY // 1 day between identical positions
|
||||
#define default_traffic_mgmt_position_precision_bits 24 // ~10m grid cells
|
||||
#define default_traffic_mgmt_position_min_interval_secs (ONE_DAY / 2) // 12 hours between identical positions
|
||||
|
||||
#ifdef USERPREFS_RINGTONE_NAG_SECS
|
||||
#define default_ringtone_nag_secs USERPREFS_RINGTONE_NAG_SECS
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "NodeDB.h"
|
||||
#include "Router.h"
|
||||
#include "TypeConversions.h"
|
||||
#include "airtime.h"
|
||||
#include "concurrency/LockGuard.h"
|
||||
#include "configuration.h"
|
||||
#include "mesh-pb-constants.h"
|
||||
@@ -1001,7 +1002,11 @@ void TrafficManagementModule::alterReceived(meshtastic_MeshPacket &mp)
|
||||
const auto &cfg = moduleConfig.traffic_management;
|
||||
const bool isTelemetry = mp.decoded.portnum == meshtastic_PortNum_TELEMETRY_APP;
|
||||
const bool isPosition = mp.decoded.portnum == meshtastic_PortNum_POSITION_APP;
|
||||
const bool shouldExhaust = (isTelemetry && cfg.exhaust_hop_telemetry) || (isPosition && cfg.exhaust_hop_position);
|
||||
// Only exhaust telemetry hops when channel is actually congested, mirroring the same
|
||||
// airtime checks that gate self-generated telemetry in the telemetry modules.
|
||||
const bool channelBusy = airTime && (!airTime->isTxAllowedChannelUtil(true) || !airTime->isTxAllowedAirUtil());
|
||||
const bool shouldExhaust =
|
||||
((channelBusy && isTelemetry && cfg.exhaust_hop_telemetry) || (isPosition && cfg.exhaust_hop_position));
|
||||
|
||||
if (!shouldExhaust || !isBroadcast(mp.to))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user