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

◆ nrf_edgeai_obsv_encode_list_and_reset()

size_t nrf_edgeai_obsv_encode_list_and_reset ( nrf_edgeai_obsv_ctx_t *const * ctxs,
uint8_t n,
uint8_t * buf,
size_t max_len )

#include <include/nrf_edgeai_obsv/nrf_edgeai_obsv.h>

Encode multiple contexts as a CBOR list and reset them atomically.

Same wire format as nrf_edgeai_obsv_encode_list. All n context locks are held across encode and reset, so no update is lost between the snapshot and the reset, and all contexts are snapshotted at the same point. Use it for incremental (per-interval) reporting.

Contexts are reset only when the whole list encodes successfully; on error they keep their data.

Requires CONFIG_NRF_EDGEAI_OBSV_ENCODE.

Parameters
ctxsArray of n distinct initialized context pointers.
nNumber of contexts. Must be 1–23 (CBOR tiny integer limit).
bufOutput buffer.
max_lenSize of buf in bytes.
Returns
Encoded byte count on success, 0 on error or buffer overflow.