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 come last in a state handler, so that the parent state handlers execute in the correct order. SMF automatically handles the execution of exit and entry functions for all states along the path to the new state.