MonitoringAndDiagnosticsProfile

open class MonitoringAndDiagnosticsProfile : Profile.Simple, ChunksEmitter

An implementation of the Monitoring & Diagnostics Service (MDS) that streams diagnostic data from the collector over Bluetooth Low Energy.

This profile can be attached to any connected Peripheral using Peripheral.profile. It does not create or manage the Bluetooth LE connection itself.

Once attached, it reads the device configuration, subscribes to the data export characteristic, and exposes the result using state and chunks, which can be consumed directly, or passed to ObservabilityManager.connect.

Example

// Create the profile and attach it to the Peripheral object.
val profile = MonitoringAndDiagnosticsProfile()
peripheral.profile(profile)
// Connect the profile with observability manager to upload chunks to nRF Cloud.
observabilityManager.connect(profile)

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val chunks: SharedFlow<ByteArray>

A flow of streamed data (chunks).

Link copied to clipboard
var logger: Log.Sink<Category>?

The log sink for events produced by this profile.

Link copied to clipboard
val name: String?
Link copied to clipboard
open override val state: StateFlow<ChunksEmitter.State>

The current state of the source.