diff --git a/EspNowFloodingMesh.h b/EspNowFloodingMesh.h index b7577ab..37e48ae 100644 --- a/EspNowFloodingMesh.h +++ b/EspNowFloodingMesh.h @@ -15,6 +15,7 @@ //#define DISABLE_CRYPTING //send messages as plain text //#define DEBUG_PRINTS + #define MAX_ALLOWED_TIME_DIFFERENCE_IN_MESSAGES 3 //if message time differens more than this from RTC, reject message #ifndef USE_RAW_801_11 diff --git a/espnowBroadcast.cpp b/espnowBroadcast.cpp index 346d364..66189f6 100644 --- a/espnowBroadcast.cpp +++ b/espnowBroadcast.cpp @@ -1,3 +1,5 @@ +//#define DEBUG_PRINTS + #ifdef ESP32 #include #include @@ -19,6 +21,12 @@ void esp_msg_recv_cb(const uint8_t *mac_addr, const uint8_t *data, int len) void esp_msg_recv_cb(u8 *mac_addr, u8 *data, u8 len) #endif { + #ifdef DEBUG_PRINTS + char macStr[18]; + snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x", + mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]); + Serial.print("Last Packet Recv from: "); Serial.println(macStr); + #endif if ( espnowCB != NULL ) { espnowCB(data, len); }