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

◆ nrf_edgeai_obsv_encode()

size_t nrf_edgeai_obsv_encode ( nrf_edgeai_obsv_ctx_t * ctx,
uint8_t * buf,
size_t max_len )

#include <include/nrf_edgeai_obsv/nrf_edgeai_obsv.h>

Encode all metrics as a CBOR blob under the context lock.

Wire format is defined in obsv.cddl. Size buf for the worst-case encoded payload (see nrf_edgeai_obsv_encode.c for the formula).

Requires CONFIG_NRF_EDGEAI_OBSV_ENCODE.

Parameters
ctxInitialized context.
bufOutput buffer.
max_lenSize of buf in bytes.
Returns
Encoded byte count on success, 0 on error or buffer overflow.