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
commit 899f9dd7bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,7 +99,6 @@ NeighborInfoModule::NeighborInfoModule()
setIntervalFromNow(35 * 1000);
} else {
LOG_DEBUG("NeighborInfoModule is disabled\n");
neighborState = meshtastic_NeighborInfo_init_zero;
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)
{
if (enabled) {
printNeighborInfo("RECEIVED", np);
updateNeighbors(mp, np);
}
// Allow others to handle this packet
return false;
}