ChunkSender

Send chunks for a given device to Memfault's web services.

One chunk sender must be created for each device; all chunk senders can then share the same MemfaultCloud instance.

Initialization

Use the Builder to instantiate a ChunkSender:

Kotlin:

val chunkSender = ChunkSender.Builder()
.setMemfaultCloud(memfaultCloud)
.setDeviceSerialNumber(deviceSerial)
.build()

Java:

final ChunkSender chunkSender = new ChunkSender.Builder()
.setMemfaultCloud(memfaultCloud)
.setDeviceSerialNumber(deviceSerial)
.build()

Persistent Queuing

By default, the ChunkSender's queue 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 ChunkSender with a ChunkQueue that is persistent.

Types

Link copied to clipboard
class Builder

Build a ChunkSender instance for a given device.

Functions

Link copied to clipboard

Enqueue the chunks for the given device.

Link copied to clipboard
fun send(callback: SendChunksCallback)

Attempt to drain all chunks for the given device.