quartiq / minimq

Minimal no_std MQTT v5.0 client implementation
MIT License
144 stars 16 forks source link

Refactoring MQTT state management #88

Closed ryan-summers closed 2 years ago

ryan-summers commented 2 years ago

This PR refactors the state management of the client to be entirely wrapped up in an smlang::StateMachine.

This change is intended to support more complex state management that will be required to support all QoS levels.

This PR also removes public access to the Minimq.client object. It is now exposed via Minimq::client() to support compatibility going forward.

ryan-summers commented 2 years ago

@jordens I elected to restructure it so that we only keep the SessionState as the state machine context. This should still facilitate easy management of the session state structure. There's still a small amount of reaching into the internal context, but I want to try to fix it up a bit later.