Edge AI Add-on API 3.0.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;
41};
42
48 uint16_t rate_hz;
50 uint8_t channels;
52 uint8_t sensor_type;
54 const char *const *channel_names;
56 const char *device_name;
57};
58
70int proto_init(const struct proto_transport *transport);
71
84
93
99uint32_t proto_get_session_id(void);
100
116int proto_send_samples(const proto_value_t *values, uint8_t count);
117
118#ifdef __cplusplus
119}
120#endif
121
126#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:54
uint8_t sensor_type
Definition protocol.h:52
uint16_t rate_hz
Definition protocol.h:48
const char * device_name
Definition protocol.h:56
uint8_t channels
Definition protocol.h:50
Session metadata included in periodic session-info messages.
Definition protocol.h:46
void * ctx
Definition protocol.h:34
bool has_message_boundaries
Definition protocol.h:40
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