191 DBSTATUSln(
"Door Entering State: errorState");
214 return "State::opened";
216 return "State::closing";
219 return "State::closed";
222 return "State::opening";
225 return "State::errorState";
228 return "ERROR: No matching state";
236 return "Event::Open";
239 return "Event::Close";
242 return "Event::Opened";
245 return "Event::Closed";
248 return "Event::Error";
251 return "Event::Resume";
254 return "Event::NoEvent";
257 return "ERROR: No matching event";
State lastStateBevorError
holds the last state of the FSM so it's possible to resume after error
Event currentEvent
holds the current event of the FSM
void entryAction_closing()
executes the entry action of the closing state.
void exitAction_opening()
executes the exit action of the opening state.
DoorCtrl::Event doAction_opened()
executes the main action of the opened state.
void entryAction_closed()
executes the entry action of the closed state.
void process(Event e)
Changes the state of the FSM based on the event Here is where the magic happens :)
DoorCtrl()
Construct a new Door Ctrl object and initailize the currentState with low state.
The Door Controll class contains the FSM for the Door.
State currentState
holds the current state of the FSM
bool close()
Closes the Door one Step per Function-Call.
DoorCtrl::Event doAction_errorState()
main action of the errorState state.
DoorCtrl::Event doAction_opening()
executes the main action of the opening state.
const State getcurrentState()
Get the current State.
void exitAction_closed()
executes the exit action of the closed state.
void entryAction_errorState()
entry action of the errorState state.
DoorCtrl::Event doAction_closing()
executes the main action of the closing state.
void exitAction_opened()
executes the exit action of the opened state.
DoorCtrl::Event doAction_closed()
executes the main action of the closed state.
void entryAction_opening()
executes the entry action of the opening state.
Door pDoor
Door Object with ClosedPostion 0 and OpenPosition 10.
State
Enum holds all possible states for the Door.
String decodeState(State state)
Decodes the State-Enum and returns a description.
void exitAction_errorState()
exit action of the errorState state.
void loop()
Calls the do-function of the active state and hence generates Events.
Signal: Close position reached.
bool open()
Opens the Door one Step per Function-Call.
Signal: Open position reached.
void exitAction_closing()
executes the exit action of the closing state.
Event
Enum holds all possible events.
Event(DoorCtrl::* doActionFPtr)(void)
Functionpointer to call the current states do-function.
String decodeEvent(Event event)
Decodes the Event-Enum and returns a description.
Ext: Resume after Error occured.
void entryAction_opened()
executes the entry action of the opened state.