Cloud synchronization

Serial Modem Host Applications

tags
Serial Modem Host Applications

While the cloud connection is up, the module performs a synchronization every CONFIG_APP_MAIN_SYNC_INTERVAL_SECONDS, and once immediately on connect. Each synchronization advances through the sync substates in order, waiting for the current step to complete before starting the next:

  1. CLOUD_MESSAGE_SEND with a demo JSON payload: {"appId":"SMHA","messageType":"DATA","data":"hello"}. Advances on CLOUD_MESSAGE_SENT.
  2. LOCATION_SEARCH_TRIGGER, when the application is built with the location overlay. Advances on LOCATION_SEARCH_DONE.
  3. CLOUD_SHADOW_POLL_REQUEST, to pick up any desired configuration from the device shadow. Advances on CLOUD_SHADOW_POLLED.
  4. FOTA_POLL_REQUEST, when the FOTA module is enabled. Advances on FOTA_ABORTED, or moves to STATE_FOTA on FOTA_STARTING.
  5. CLOUD_MEMFAULT_POST_REQUEST, to post any pending Memfault data. Advances on CLOUD_MEMFAULT_POSTED.

Only STATE_SYNC_IDLE acts on the periodic trigger, so a synchronization already in progress is never restarted by the timer.