Fix control data reception handling in STEALTH_MODE
This commit is contained in:
@@ -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_REQ 0x80
|
||||||
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90
|
#define CTL_TYPE_NODE_DISCOVER_RESP 0x90
|
||||||
|
|
||||||
#if !defined(STEALTH_MODE)
|
|
||||||
void MyMesh::onControlDataRecv(mesh::Packet* packet) {
|
void MyMesh::onControlDataRecv(mesh::Packet* packet) {
|
||||||
if (!packet->payload) {
|
if (!packet->payload) {
|
||||||
MESH_DEBUG_PRINTLN("onControlDataRecv: packet->payload is null");
|
MESH_DEBUG_PRINTLN("onControlDataRecv: packet->payload is null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(STEALTH_MODE)
|
||||||
uint8_t type = packet->payload[0] & 0xF0; // just test upper 4 bits
|
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())) {
|
if (type == CTL_TYPE_NODE_DISCOVER_REQ && packet->payload_len >= 6 && discover_limiter.allow(rtc_clock.getCurrentTime())) {
|
||||||
int i = 1;
|
int i = 1;
|
||||||
@@ -661,8 +661,8 @@ void MyMesh::onControlDataRecv(mesh::Packet* packet) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondClock &ms, mesh::RNG &rng,
|
MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondClock &ms, mesh::RNG &rng,
|
||||||
mesh::RTCClock &rtc, mesh::MeshTables &tables)
|
mesh::RTCClock &rtc, mesh::MeshTables &tables)
|
||||||
|
|||||||
Reference in New Issue
Block a user