Open
Conversation
A State Machine implementation with configurable state transitions. It maintains state decoupling, allowing it to scale and support multiple setups. Setup/Definition logic: - Create a State Machine. - Create states. - Set the SM initial state. - Set the SM default behavior: Action to take if no map is found. (NULL specifies to remain in the same state) - Map State & Result to the next State. (state, result, nextState) Receiving an event wile in state, triggers a state operation, resulting in a StateResult. SM State is changed to the nextState based on the result. Operation: - Usually called from a controller that receives events in an asynchronous mode. Usage example: State *state = sm->getCurrentState(); sm->execEvent(state->evExist()); // At this stage sm->getCurrentState() will return a new state.
The controller is serving the cards (devices) by providing them means to register to the controller with their SM and giving each a unique id for communication. regCard() is used for card registration. run() is used for running the controller, usually in it's own task in an endless loop, blocking on recv messages.
An UML and a README file have been added.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.