MemfaultCloudManager

class MemfaultCloudManager(config: MemfaultConfig, chunkQueue: ChunkQueue? = null)

Manages the upload of chunks to the Memfault cloud.

By default, the ChunkQueue lives in memory. If the application is closed or crashes with chunks un-sent, they will be lost.

If this is an issue for your application, you can provide the ChunkQueue that is persistent, for example PersistentChunkQueue.

Parameters

config

Configuration for Memfault, including AAuthorization Token and device ID (serial).

chunkQueue

A queue for storing chunks to be uploaded. If null, a default in-memory queue will be used. Use PersistentChunkQueue for persistent storage.

Constructors

Link copied to clipboard
constructor(config: MemfaultConfig, chunkQueue: ChunkQueue? = null)

Properties

Link copied to clipboard
val status: StateFlow<UploadingStatus>

Functions

Link copied to clipboard
fun close()

Closes the uploader.

Link copied to clipboard
suspend fun uploadChunks()

Uploads already collected chunks to the cloud.