Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches

◆ nrf_edgeai_obsv_encode_cbor()

size_t nrf_edgeai_obsv_encode_cbor ( nrf_edgeai_obsv_core_t * state,
uint8_t * buf,
size_t max_len )

#include <lib/nrf_edgeai_obsv/nrf_edgeai_obsv_encode.h>

Encode observability state and metrics as CBOR (no mutex).

Wire format is defined in obsv.cddl. On Zephyr, prefer Observability CBOR encoding (buffer sizing) on nrf_edgeai_obsv_ctx_t* so the context mutex serializes with inference.

Parameters
stateInitialized portable state with registered metrics.
bufOutput buffer.
max_lenSize of buf.
Returns
Encoded byte count on success, 0 on encoding failure or overflow.
Note
Every registered metric is emitted. The required buffer size depends on the registered metrics and their Kconfig dimensions; custom or larger snapshots need a correspondingly larger buf and max_len.