22#ifndef __ECU_STATE_H__
23#define __ECU_STATE_H__
Special logging functionality.
const char * LOG_TAG
Type definition of logging tags This typedef is necessary to allow for easier manipulation of code by...
Compilation of various helpful preprocessor macros.
A state machine implementation, refer to State.h for more info.
NotifyValue
Common codes that can be used by states.
@ E_RESTART
Special code that makes the state machine start from the first state again.
@ E_ERROR
An error has occurred, attempt to skip the state.
@ E_CONTINUE
An error has occurred but we can continue normally.
@ E_NOERR
No error has occurred.
@ E_FATAL
Special code that makes the state machine completely stop.
void begin(State_t &entry)
Begin the state machine with a pointer to a state.
The parent state structure to extend from to create more states.
int notifyCode
Used for receiving values from other states.
void notify(int notify)
Send a code to the next state.
LOG_TAG ID
The unique ID of the state, used for logging.
virtual LOG_TAG getID(void)
Returns the LOG_TAG of the state.
virtual State_t * run(void)
Runs the state.
State_t * getLastState()
Get a pointer of the last state.
int getNotify(void)
Get the code of the previous state.