State transitions

Asset Tracker Template

tags
Asset Tracker Template

Transitions between states are handled using smf_set_state():

smf_set_state(SMF_CTX(state_object), &states[NEW_STATE]);

A transition to another state must be the last thing happening in a state handler. This is to ensure the correct order of execution of parent state handlers. SMF automatically handles the execution of exit and entry functions for all states along the path to the new state.