Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
nrf_edgeai_obsv.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
14#ifndef NRF_EDGEAI_OBSV_H
15#define NRF_EDGEAI_OBSV_H
16
17#include <stddef.h>
18#include <stdint.h>
19
20#include <zephyr/kernel.h>
21
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
42
53
69 const void *cfg);
70
81
93
102
115int nrf_edgeai_obsv_update_features(nrf_edgeai_obsv_ctx_t *ctx, const float *feats, uint16_t n);
116
126 void *user);
127
141size_t nrf_edgeai_obsv_encode(nrf_edgeai_obsv_ctx_t *ctx, uint8_t *buf, size_t max_len);
142
160 uint8_t *buf, size_t max_len);
161
162#ifdef __cplusplus
163}
164#endif
165
166#endif /* NRF_EDGEAI_OBSV_H */
167
bool(* nrf_edgeai_obsv_metric_cb_t)(const nrf_edgeai_obsv_metric_snapshot_t *snap, void *user)
Callback invoked once per registered metric by nrf_edgeai_obsv_core_for_each_metric().
Definition nrf_edgeai_obsv_core.h:71
int nrf_edgeai_obsv_deregister(nrf_edgeai_obsv_ctx_t *ctx, nrf_edgeai_obsv_metric_t *metric)
Deregister a previously registered metric.
int nrf_edgeai_obsv_init(nrf_edgeai_obsv_ctx_t *ctx, const nrf_edgeai_obsv_model_info_t *model)
Initialize an observability context.
int nrf_edgeai_obsv_for_each_metric(nrf_edgeai_obsv_ctx_t *ctx, nrf_edgeai_obsv_metric_cb_t cb, void *user)
Iterate over all registered metrics under the context lock.
struct nrf_edgeai_obsv_ctx nrf_edgeai_obsv_ctx_t
Zephyr RTOS synchronization for one observability context.
int nrf_edgeai_obsv_update_features(nrf_edgeai_obsv_ctx_t *ctx, const float *feats, uint16_t n)
Feed one extracted-feature vector to all FEATURES-source metrics.
int nrf_edgeai_obsv_register(nrf_edgeai_obsv_ctx_t *ctx, nrf_edgeai_obsv_metric_t *metric, const void *cfg)
Register a metric with the context.
size_t nrf_edgeai_obsv_encode_list(nrf_edgeai_obsv_ctx_t *const *ctxs, uint8_t n, uint8_t *buf, size_t max_len)
Encode multiple contexts as a CBOR list (obsv-list format).
int nrf_edgeai_obsv_update_probs(nrf_edgeai_obsv_ctx_t *ctx, const float *probs)
Feed one inference result to all registered metrics.
int nrf_edgeai_obsv_reset(nrf_edgeai_obsv_ctx_t *ctx)
Reset inference counters and all registered metrics.
size_t nrf_edgeai_obsv_encode(nrf_edgeai_obsv_ctx_t *ctx, uint8_t *buf, size_t max_len)
Encode all metrics as a CBOR blob under the context lock.
Portable observability core (no RTOS).
Definition nrf_edgeai_obsv_core.h:51
struct k_mutex lock
Serializes observability API for this context.
Definition nrf_edgeai_obsv.h:38
nrf_edgeai_obsv_core_t state
Portable observability state (shared with encode/snapshot paths).
Definition nrf_edgeai_obsv.h:40
Zephyr RTOS synchronization for one observability context.
Definition nrf_edgeai_obsv.h:36
Observability metric operation table and list node.
Definition nrf_edgeai_obsv_metrics.h:87
Static model metadata included in observability snapshots.
Definition nrf_edgeai_obsv_core.h:31