Open stephanh opened 4 years ago
Hi. Yep, I did plan to make the API more safe against misuse in the future :slightly_smiling_face: Using typestates would be a nice approach, thanks for the proposal.
I do have one caveat though, I would first want to implement the embedded-nal traits since that might influence the design of the client. For that, the current blocker is receiving incoming data from the ESP device. This in turn is blocked by https://github.com/BlackbirdHQ/atat/issues/33. I already have an idea how it might be possible to handle that though. If time permits, I'll try out that approach in a branch tonight.
Ok.
I think it would be good to use types to encode state specific methods and transitions between state similar to how embedded_hal does it and guard users from illegal state transitions.
What do you think?