Merge pull request #2775 from GUVWAF/disabledNeighbor

Only update neighbors when module is enabled
This commit is contained in:
code8buster
2023-09-05 23:43:09 +00:00
committed by GitHub
+4 -3
View File
@@ -99,7 +99,6 @@ NeighborInfoModule::NeighborInfoModule()
setIntervalFromNow(35 * 1000); setIntervalFromNow(35 * 1000);
} else { } else {
LOG_DEBUG("NeighborInfoModule is disabled\n"); LOG_DEBUG("NeighborInfoModule is disabled\n");
neighborState = meshtastic_NeighborInfo_init_zero;
disable(); disable();
} }
} }
@@ -203,8 +202,10 @@ Pass it to an upper client; do not persist this data on the mesh
*/ */
bool NeighborInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_NeighborInfo *np) bool NeighborInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_NeighborInfo *np)
{ {
printNeighborInfo("RECEIVED", np); if (enabled) {
updateNeighbors(mp, np); printNeighborInfo("RECEIVED", np);
updateNeighbors(mp, np);
}
// Allow others to handle this packet // Allow others to handle this packet
return false; return false;
} }