#ifndef ESPNOW_H #define ESPNOW_H #include #include #include #include #include #include "debug.h" #define MAC_LEN 6 #define MAC_ADDR 0 class EspNow { public: enum {NOT_CONNECTED = -1, CONNECTED = 0, PAIRING = 1}; enum {NO_DATA = 0, DATA_READY = 1}; volatile int status; void init(); int sendData(char*); int sendData(void* = NULL, int = 0); int getStatus(); int getData(void*, int); void receiveData(const uint8_t* mac, const uint8_t* incomingData, int len); private: static const int MAX_LEN = 32; volatile uint8_t data[MAX_LEN]; volatile int dataReady; uint8_t destinationAddress[MAC_LEN]; void addPeer(const uint8_t* mac); }; #endif