When hearing a node we don't know, send NodeInfo and ask for response

This commit is contained in:
GUVWAF
2023-02-11 15:58:26 +01:00
committed by Thomas Göttgens
co-authored by Thomas Göttgens
parent 5cadcd355f
commit 5f28ef6814
+5 -1
View File
@@ -75,9 +75,13 @@ int MeshService::handleFromRadio(const meshtastic_MeshPacket *mp)
{
powerFSM.trigger(EVENT_PACKET_FOR_PHONE); // Possibly keep the node from sleeping
printPacket("Forwarding to phone", mp);
nodeDB.updateFrom(*mp); // update our DB state based off sniffing every RX packet from the radio
if (!nodeDB.getNode(mp->from)->has_user) {
LOG_INFO("Heard a node we don't know, sending NodeInfo and asking for a response.\n");
nodeInfoModule->sendOurNodeInfo(mp->from, true);
}
printPacket("Forwarding to phone", mp);
sendToPhone((meshtastic_MeshPacket *)mp);
return 0;