SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
State::State_t Struct Reference

The parent state structure to extend from to create more states. More...

#include <State.h>

Inherited by ECUStates::Bounce_t, ECUStates::Button_State, ECUStates::Charging_State, ECUStates::Driving_Mode_State, ECUStates::FaultState, ECUStates::Idle_State, ECUStates::Initialize_State, ECUStates::Logger_t, and ECUStates::PreCharge_State.

Public Member Functions

virtual State_trun (void)
 Runs the state.
 
virtual LOG_TAG getID (void)
 Returns the LOG_TAG of the state.
 
State_tgetLastState ()
 Get a pointer of the last state.
 

Public Attributes

int notifyCode = 0
 Used for receiving values from other states.
 
LOG_TAG ID = "ID NOT SET"
 The unique ID of the state, used for logging.
 

Protected Member Functions

int getNotify (void)
 Get the code of the previous state.
 
void notify (int notify)
 Send a code to the next state.
 

Detailed Description

The parent state structure to extend from to create more states.

Definition at line 70 of file State.h.

Member Function Documentation

◆ getID()

virtual LOG_TAG State::State_t::getID ( void  )
virtual

Returns the LOG_TAG of the state.

Returns
LOG_TAG The unique tag

◆ getLastState()

State_t * State::State_t::getLastState ( )

Get a pointer of the last state.

Note
If the state machine has just started, this will return a nullptr
Returns
State_t* pointer of last state

◆ getNotify()

int State::State_t::getNotify ( void  )
protected

Get the code of the previous state.

Returns
int notify code

◆ notify()

void State::State_t::notify ( int  notify)
protected

Send a code to the next state.

Parameters
notifycode to send

◆ run()

virtual State_t * State::State_t::run ( void  )
virtual

Runs the state.

Returns
State_t* A pointer to the next state to switch to

Member Data Documentation

◆ ID

LOG_TAG State::State_t::ID = "ID NOT SET"

The unique ID of the state, used for logging.

Definition at line 95 of file State.h.

◆ notifyCode

int State::State_t::notifyCode = 0

Used for receiving values from other states.

Definition at line 90 of file State.h.


The documentation for this struct was generated from the following file: