/*
 Name:		IrTransponderValidator.ino
 Created:	7/18/2017 8:26:08 PM
 Author:	Chris Watts
*/
#include <EventManager.h>
#include "GPIOHelper.h"
#include "DisplayManager.h"
#include "BoardDefs.h"

int transponderId = -1;
EventManager _evtManager;
GPIOHelper gpio(_evtManager);
DisplayManager dispManager;

// the setup function runs once when you press reset or power the board
void setup() {
	Serial.begin(SERIAL_BAUD_RATE);
	_evtManager.addListener(ID_RECOGNISED_EVENT, myListener);
	gpio.Init();
	dispManager.Initialise();
}

// the loop function runs over and over again until power down or reset
void loop() {
	gpio.Check();
	//Serial.println("exiting loop");
	_evtManager.processEvent();
}

void myListener(int eventCode, int eventParam)
{
	Serial.println("Event Received");
	dispManager.DisplayValue(eventParam);
	// Do something with the event
}