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.
State currentState
holds the current state of the FSM
DoorCtrl::Event doAction_errorState()
main action of the errorState state.
DoorCtrl::Event doAction_opening()
executes the main action of the opening state.
Provides the basic Functions to Controll the Door.
const State getcurrentState()
Get the current State.
Contains the FSM for the Door.
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.
Contains Pre-Compiler directives for diffent Serialprints for Datalogin.
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.
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.
Implementation of the Door-Class.
void entryAction_opened()
executes the entry action of the opened state.