//where I am #include "R1_FA_State.h" //manager #include "StateManager.h" //home #include "R0_Init_State.h" //a step after #include "R2_FAFE_State.h" namespace PamOffLineSW { R1_FA_State R1_FA_State::instance; R1_FA_State::R1_FA_State() { } R1_FA_State::~R1_FA_State() { } void R1_FA_State::readInput(char inputbyte) { //the byte before this one is 0xFA, searching byte 0xFE if((unsigned char)inputbyte==CODE_FE) { //changing state to R2 StateManager::getInstance().changeState(&R2_FAFE_State::getInstance()); } else if((unsigned char)inputbyte==CODE_FA) { //do nothing remain in the current state } else { //Return to state R0, restart search StateManager::getInstance().changeState(&R0_Init_State::getInstance()); } } }