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

◆ nrf_edgeai_obsv_memfault_collect()

int nrf_edgeai_obsv_memfault_collect ( void )

#include <include/nrf_edgeai_obsv/nrf_edgeai_obsv_memfault.h>

Encodes observability metrics as CBOR and stages them for Memfault.

Overwrites any previously staged payload. The CBOR blob is stored internally and handed out by the registered CDR source on the next transport drain cycle.

Note
This function acquires each registered observability context's lock (ctx->lock) while encoding.
Allocates a NRF_EDGEAI_OBSV_ENCODE_LIST_BUFSZ-byte buffer on the calling thread's stack. When invoked from the system workqueue (e.g. via CONFIG_NRF_EDGEAI_OBSV_MEMFAULT_AUTO_COLLECT), increase CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE accordingly.
Return values
0Success; payload staged and ready for the next drain cycle.
-EINVALNot initialized (no context registered).
-ENODATACBOR encoding failed.