Closed pinkavaj closed 8 years ago
In one of my early projects I defined a large state machine for a BLE connection sequence. I had a set of callbacks defined for each state, so that I didn't have to have "if state == START: elif state == MIDDLE:" etc. in every single callback function. It made implementation of a hierarchical state machine very easy. I could inherit methods that were unchanged and override methods with different behavior.
Makes sense, I'm now working on something similar but want to achieve it different way but this give mi new inspiration.
Hi,
this is just prequell and minor cleanup for more changes which I intend to push latter (response-03) after more testing.
I have one question, it is necessary pass callbacks into parse_bgapi_packet/parse_bgapi_response/.. functions? I think about replace it by some more conviniet way for changing callbacks.