Fix control data reception handling in STEALTH_MODE

This commit is contained in:
João Brázio
2025-12-10 10:37:10 +00:00
parent 5871c69f6f
commit 3a497a4b99

View File

@@ -628,13 +628,13 @@ bool MyMesh::onPeerPathRecv(mesh::Packet *packet, int sender_idx, const uint8_t
#define CTL_TYPE_NODE_DISCOVER_REQ 0x80
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90
#if !defined(STEALTH_MODE)
void MyMesh::onControlDataRecv(mesh::Packet* packet) {
if (!packet->payload) {
MESH_DEBUG_PRINTLN("onControlDataRecv: packet->payload is null");
return;
}
#if !defined(STEALTH_MODE)
uint8_t type = packet->payload[0] & 0xF0; // just test upper 4 bits
if (type == CTL_TYPE_NODE_DISCOVER_REQ && packet->payload_len >= 6 && discover_limiter.allow(rtc_clock.getCurrentTime())) {
int i = 1;
@@ -661,8 +661,8 @@ void MyMesh::onControlDataRecv(mesh::Packet* packet) {
}
}
}
}
#endif
}
MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondClock &ms, mesh::RNG &rng,
mesh::RTCClock &rtc, mesh::MeshTables &tables)