The state machine is run using smf_run_state(). SMF executes the run function defined for the current state, and then:
- If the run function returns
SMF_EVENT_PROPAGATE, the process is repeated for the parent state, if there is one. - If the run function triggers a state transition, SMF runs any relevant exit and entry functions.
In the Asset Tracker Template, smf_run_state() is run from the module threads to process incoming messages, as described in Module threads.