Persist cloud store after cps and last_error were reset.
@@ -116,6 +116,7 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx,
cloud_manager_stop(ctx);
ctx->last_error = 0;
ctx->store.cps = 0;
+ cloud_store_dump(&ctx->store);
}
#endif /* OC_SECURITY */
@@ -137,10 +138,10 @@ oc_cloud_reset_context(size_t device)
#endif /* OC_SECURITY */
cloud_store_initialize(&ctx->store);
- cloud_store_dump(&ctx->store);
cloud_manager_stop(ctx);
ctx->last_error = 0;
ctx->store.cps = 0;
+ cloud_store_dump(&ctx->store);
return 0;
}
