#ifndef espnow_h
#define espnow_h

#include <WiFi.h>
#include <esp_wifi.h>

#include <esp_now.h>
#include <Adafruit_NeoPixel.h>

extern Adafruit_NeoPixel statuspixel;

// Must match the receiver structure
enum Action {
  HELLO=0,
  PRESS=1,
  RELEASE=2,
  DOWN=3,
  UP=4
}; 

#define INPUT_SIZE 6
enum Input {
  KEY_LEFT=0,
  KEY_RIGHT=1,
  KEY_UP=2,
  KEY_DOWN=3,
  KEY_A=4,
  KEY_B=5
}; 


typedef struct struct_message {
  uint8_t id;
  Action action;
  Input input;
} struct_message;


extern void processCommand(struct_message espnowdata);

void readMacAddress();

void initESPNOW();





// callback function that will be executed when data is received
void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len);


#endif