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

◆ NRF_EDGEAI_OBSV_ENCODE_METRIC_SIZE

#define NRF_EDGEAI_OBSV_ENCODE_METRIC_SIZE ( n_rows,
n_cols )

#include <include/nrf_edgeai_obsv/nrf_edgeai_obsv_encode_sizes.h>

Value:
(_NRF_EDGEAI_OBSV_ENCODE_METRIC_BLOCK_FIXED + \
(n_rows) * (_NRF_EDGEAI_OBSV_ENCODE_TABLE_ROW_FIXED + \
(n_cols) * _NRF_EDGEAI_OBSV_ENCODE_UINT32_WORST))

CBOR encoded size budget for one custom metric.

Computes the worst-case encoded size (bytes) for a single metric whose snapshot() returns n_rows rows and n_cols columns of uint32_t counters. Use this to determine how many extra bytes are needed in the encode buffer for a custom metric, and set CONFIG_NRF_EDGEAI_OBSV_EXTRA_ENCODE_BYTES to the sum across all custom metrics. Optionally guard the value with a BUILD_ASSERT:

BUILD_ASSERT(CONFIG_NRF_EDGEAI_OBSV_EXTRA_ENCODE_BYTES >=
"EXTRA_ENCODE_BYTES too small for custom metric");
#define NRF_EDGEAI_OBSV_ENCODE_METRIC_SIZE(n_rows, n_cols)
CBOR encoded size budget for one custom metric.
Definition nrf_edgeai_obsv_encode_sizes.h:230
Parameters
n_rowsNumber of rows in the counter matrix (num_rows from snapshot).
n_colsNumber of columns in the counter matrix (num_cols from snapshot).