I want to design a state machine for one module that have to communicate with another module via a protocol.
Multiple states need might endup needing to communicate, State A, State B, State C. they build the package and the go to the send state. The thing is that once the communication ends they need to return to different states, as they need to process the replied data differently. One possibility is to replicate the communications state Fig 2 or to have a register save the return state, Fig 1 where the communication state will go to the return state depending on what state arrive to it.
I am wondering which is a better design choice, and if they are both awful, then what have people been using? I feel like this is something that is found a lot in design.
Thanks