
Yes Precisely, Basically my question is how can I tell what was my active state? and how can I go back to it directly without having to go through the initial state? Thank yoyu
You don't need to go back to it, your state machine does not change state until you use it (send it an event). This is called "run-to-completion" in UML terminology. Often, people get confused because some libraries are actually actively doing something constantly. MSM does not do anything until you process an event. Then it moves to a next state, possibly executing some entry/exit/transition actions and stays there until a new event is sent. This happens entirely inside process_event. At the end of a process_event call, MSM does nothing at all. HTH, Christophe