Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
reduce datausage on reset/wakeup #953
Reduces data consumption when the device is reset or wakes up from deep sleep.
Computes a checksum of the last set of subscriptions, functions, variables and system modules that were sent to the cloud, which is maintained in retained storage, as part of the session.
Before sending a hello after resuming the session, the device checks the current checksum for the subscriptions, functions variables and system modules. If it is the same as the persisted checksum, the hello message is stkipped, since the local application state is the same as what was last sent to the cloud. When the checksums are not the same, the hello message is sent, which clears the app state on the server, so all subsequent describe messages and subscriptions are resent.
For this to work optimally, code should use SEMI_AUTOMATIC mode and connect to the cloud after registering all subscriptions, variables and functions.
Verify data usage reduction test:
Test results (mdma):