Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
protocol.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 */
6
7#ifndef DATA_FORWARDER_PROTOCOL_H_
8#define DATA_FORWARDER_PROTOCOL_H_
9
17#include "protocol_types.h"
18
19#include <stdbool.h>
20#include <stddef.h>
21#include <stdint.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
32 int (*send)(const uint8_t *buf, size_t len, void *ctx);
34 void *ctx;
40};
41
47 uint16_t rate_hz;
49 uint8_t channels;
51 uint8_t sensor_type;
53 const char *const *channel_names;
55 const char *device_name;
56};
57
69int proto_init(const struct proto_transport *transport);
70
83
92
98uint32_t proto_get_session_id(void);
99
115int proto_send_samples(const proto_value_t *values, uint8_t count);
116
117#ifdef __cplusplus
118}
119#endif
120
125#endif /* DATA_FORWARDER_PROTOCOL_H_ */
int proto_send_samples(const proto_value_t *values, uint8_t count)
Enqueue sensor samples for transmission.
float proto_value_t
Definition protocol_types.h:21
int proto_start_session(const struct proto_session_config *cfg)
Start a new streaming session.
int proto_init(const struct proto_transport *transport)
Initialize the data forwarder protocol layer.
uint32_t proto_get_session_id(void)
Get the ID of the current or most recently started session.
int proto_stop_session(void)
Stop the current session.
const char *const * channel_names
Definition protocol.h:53
uint8_t sensor_type
Definition protocol.h:51
uint16_t rate_hz
Definition protocol.h:47
const char * device_name
Definition protocol.h:55
uint8_t channels
Definition protocol.h:49
Session metadata included in periodic session-info messages.
Definition protocol.h:45
void * ctx
Definition protocol.h:34
bool has_message_boundaries
Definition protocol.h:39
int(* send)(const uint8_t *buf, size_t len, void *ctx)
Definition protocol.h:32
Transport callbacks used to send framed protocol messages.
Definition protocol.h:30