From 089442edacaac0819b83f1baf2a2bf43011addb6 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Wed, 4 Sep 2024 18:57:39 +0200 Subject: [PATCH] lib update: mesh detector --- src/mesh/api/PacketAPI.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesh/api/PacketAPI.cpp b/src/mesh/api/PacketAPI.cpp index 1e6f6c2dd..348b32949 100644 --- a/src/mesh/api/PacketAPI.cpp +++ b/src/mesh/api/PacketAPI.cpp @@ -4,6 +4,7 @@ #include "MeshService.h" #include "PowerFSM.h" #include "RadioInterface.h" +#include "modules/NodeInfoModule.h" PacketAPI *packetAPI = nullptr; @@ -54,7 +55,14 @@ bool PacketAPI::receivePacket(void) break; } case meshtastic_ToRadio_heartbeat_tag: - LOG_DEBUG("Got client heartbeat\n"); + if (mr->heartbeat.dummy_field == 1) { + if (nodeInfoModule) { + LOG_INFO("Broadcasting nodeinfo ping\n"); + nodeInfoModule->sendOurNodeInfo(NODENUM_BROADCAST, true, 0, true); + } + } else { + LOG_DEBUG("Got client heartbeat\n"); + } break; default: LOG_ERROR("Error: unhandled meshtastic_ToRadio variant: %d\n", mr->which_payload_variant);