Skip to content

Commit

Permalink
Merge pull request arttupii#3 from leodesigner/bugfixes
Browse files Browse the repository at this point in the history
bugfixes 3
  • Loading branch information
leodesigner committed Jun 8, 2020
2 parents 58ab975 + 98e6f3c commit 4d1a375
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions EspNowFloodingMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions espnowBroadcast.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//#define DEBUG_PRINTS

#ifdef ESP32
#include <esp_now.h>
#include <WiFi.h>
Expand All @@ -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);
}
Expand Down

0 comments on commit 4d1a375

Please sign in to comment.