Input messages (Commands)

Asset Tracker Template

tags
Asset Tracker Template

Data operations (handled by parent RUNNING state):

  • STORAGE_SET_THRESHOLD: Set the threshold for triggering STORAGE_THRESHOLD_REACHED. If threshold is 1, every sample triggers a message. Higher values enable buffering until the threshold is reached.

  • STORAGE_FLUSH: Flushes stored data one item at a time as individual STORAGE_DATA messages. Data is sent in FIFO order per type. Available in both operational modes.

  • STORAGE_BATCH_REQUEST: Requests access to stored data through batch interface. Responds with STORAGE_BATCH_AVAILABLE, STORAGE_BATCH_EMPTY, STORAGE_BATCH_BUSY, or STORAGE_BATCH_ERROR. Available in both operational modes.

  • STORAGE_BATCH_CONSUME: Confirms that the head item of an active batch session has been processed (for example, successfully sent to the cloud). The session_id must match the active session and data_type must identify the type of the item just read with storage_batch_read(). Storage 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. Must be sent for every session, including sessions that received STORAGE_BATCH_EMPTY or STORAGE_BATCH_ERROR.

  • STORAGE_CLEAR: Clears all stored data from the backend. Available in both operational modes.

Diagnostics (handled by parent RUNNING state):

  • STORAGE_STATS : Requests storage statistics (requires CONFIG_APP_STORAGE_SHELL_STATS). Statistics are logged to the console. Available in both operational modes.