mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 14:42:05 +00:00
Exclude preferred routing roles from nodeinfo interrogation behavior (#5242)
* Exclude prefered routing roles from nodeinfo interrogation behavior * Exclude prefered routing roles from nodeinfo interrogation behavior * Update MeshService.cpp * Rework logic to prevent spammy router logs
This commit is contained in:
parent
0a82fd28b3
commit
03aaaafa13
@ -12,8 +12,8 @@
|
|||||||
#include "RTC.h"
|
#include "RTC.h"
|
||||||
#include "TypeConversions.h"
|
#include "TypeConversions.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "meshUtils.h"
|
|
||||||
#include "mesh-pb-constants.h"
|
#include "mesh-pb-constants.h"
|
||||||
|
#include "meshUtils.h"
|
||||||
#include "modules/NodeInfoModule.h"
|
#include "modules/NodeInfoModule.h"
|
||||||
#include "modules/PositionModule.h"
|
#include "modules/PositionModule.h"
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
@ -79,14 +79,16 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
|
|||||||
powerFSM.trigger(EVENT_PACKET_FOR_PHONE); // Possibly keep the node from sleeping
|
powerFSM.trigger(EVENT_PACKET_FOR_PHONE); // Possibly keep the node from sleeping
|
||||||
|
|
||||||
nodeDB->updateFrom(*mp); // update our DB state based off sniffing every RX packet from the radio
|
nodeDB->updateFrom(*mp); // update our DB state based off sniffing every RX packet from the radio
|
||||||
|
bool isPreferredRebroadcaster =
|
||||||
|
IS_ONE_OF(config.device.role, meshtastic_Config_DeviceConfig_Role_ROUTER, meshtastic_Config_DeviceConfig_Role_REPEATER);
|
||||||
if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
|
||||||
mp->decoded.portnum == meshtastic_PortNum_TELEMETRY_APP && mp->decoded.request_id > 0) {
|
mp->decoded.portnum == meshtastic_PortNum_TELEMETRY_APP && mp->decoded.request_id > 0) {
|
||||||
LOG_DEBUG("Received telemetry response. Skip sending our NodeInfo."); // because this potentially a Repeater which will
|
LOG_DEBUG("Received telemetry response. Skip sending our NodeInfo."); // because this potentially a Repeater which will
|
||||||
// ignore our request for its NodeInfo
|
// ignore our request for its NodeInfo
|
||||||
} else if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag && !nodeDB->getMeshNode(mp->from)->has_user &&
|
} else if (mp->which_payload_variant == meshtastic_MeshPacket_decoded_tag && !nodeDB->getMeshNode(mp->from)->has_user &&
|
||||||
nodeInfoModule) {
|
nodeInfoModule && !isPreferredRebroadcaster) {
|
||||||
LOG_INFO("Heard new node on channel %d, sending NodeInfo and asking for a response.", mp->channel);
|
|
||||||
if (airTime->isTxAllowedChannelUtil(true)) {
|
if (airTime->isTxAllowedChannelUtil(true)) {
|
||||||
|
LOG_INFO("Heard new node on channel %d, sending NodeInfo and asking for a response.", mp->channel);
|
||||||
nodeInfoModule->sendOurNodeInfo(mp->from, true, mp->channel);
|
nodeInfoModule->sendOurNodeInfo(mp->from, true, mp->channel);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG("Skip sending NodeInfo due to > 25 percent channel util.");
|
LOG_DEBUG("Skip sending NodeInfo due to > 25 percent channel util.");
|
||||||
|
Loading…
Reference in New Issue
Block a user