Input messages

Asset Tracker Template

tags
Asset Tracker Template

The parent RUNNING state handles the following data operation messages:

  • STORAGE_SET_THRESHOLD: Set the threshold for triggering STORAGE_THRESHOLD_REACHED. If the threshold is 1, every sample triggers a message. Higher values enable buffering until the module reaches the threshold.
  • STORAGE_FLUSH: Flushes stored data one item at a time as individual STORAGE_DATA messages. The module sends the data in FIFO order per type. This message is available in both operational modes.
  • STORAGE_BATCH_REQUEST: Requests access to stored data through the batch interface. The module responds with STORAGE_BATCH_AVAILABLE, STORAGE_BATCH_EMPTY, STORAGE_BATCH_BUSY, or STORAGE_BATCH_ERROR. This message is available in both operational modes.
  • STORAGE_BATCH_CONSUME: Confirms that the consumer has processed the head item of an active batch session, for example by sending it to the cloud successfully. The session_id must match the active session, and data_type must identify the type of the item just read with storage_batch_read(). The module removes the item from the backend and makes the next item available in the pipe. An unknown or mismatched data_type aborts the session.
  • STORAGE_BATCH_CLOSE: Ends a batch session. You must send this message for every session, including sessions that received STORAGE_BATCH_EMPTY or STORAGE_BATCH_ERROR.
  • STORAGE_CLEAR: Clears all stored data from the backend. This message is available in both operational modes.

The parent RUNNING state also handles the following diagnostics message:

  • STORAGE_STATS: Requests storage statistics, which needs CONFIG_APP_STORAGE_SHELL_STATS. The module logs the statistics to the console. This message is available in both operational modes.