The parent RUNNING state handles the following data operation messages:
- STORAGE_SET_THRESHOLD: Set the threshold for triggering
STORAGE_THRESHOLD_REACHED. If the threshold is1, 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_DATAmessages. 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, orSTORAGE_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_idmust match the active session, anddata_typemust identify the type of the item just read withstorage_batch_read(). The module removes the item from the backend and makes the next item available in the pipe. An unknown or mismatcheddata_typeaborts the session. - STORAGE_BATCH_CLOSE: Ends a batch session. You must send this message for every session, including
sessions that received
STORAGE_BATCH_EMPTYorSTORAGE_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.