| ... | ... | @@ -53,7 +53,8 @@ You can find the complete implementation of the HSM class in `src/shared/events/ |
|
|
|
## Example
|
|
|
|
This example implements the following very simple hierarchical state machine behavior:
|
|
|
|
|
|
|
|

|
|
|
|
<div align="center"><img src="images/hsm/hsm.png" height="200"/><br/><i></i></div><br>
|
|
|
|
|
|
|
|
|
|
|
|
Whenever the state machine moves to state `S2` (super-state), it will automatically transition to its first sub-state, that is `S3` (`S2` is a state machine itself and `S3` is its initial state).
|
|
|
|
We can notice that state `S3` only has a self-loop trasition that is triggered by event `EV_2`. However, if the HSM receives an event `EV_1` while being in state `S3`, the event is handled by state `S2`, which is a super-state of `S3`.
|
| ... | ... | |