//where I am
#include "R2_FAFE_State.h"
//manager
#include "StateManager.h"
//home
#include "R0_Init_State.h"
//a step after
#include "R3_FAFEDE_State.h"

namespace PamOffLineSW
{
R2_FAFE_State R2_FAFE_State::instance;

R2_FAFE_State::R2_FAFE_State()
{
}

R2_FAFE_State::~R2_FAFE_State()
{
}
void R2_FAFE_State::readInput(char inputbyte)
{
//the two bytes before this one are 0xFA 0xFE, searching byte 0xDE	
		if((unsigned char)inputbyte==CODE_DE)
		{
		//changing state to R3
			StateManager::getInstance().changeState(&R3_FAFEDE_State::getInstance());
		}
		else
		{
			//Return to state R0, restart search	
			StateManager::getInstance().changeState(&R0_Init_State::getInstance());
		}

	
	
}

}
