forked from ruvnet/RuView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstream_sender.h
More file actions
44 lines (37 loc) · 1001 Bytes
/
stream_sender.h
File metadata and controls
44 lines (37 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file stream_sender.h
* @brief UDP stream sender for CSI frames.
*/
#ifndef STREAM_SENDER_H
#define STREAM_SENDER_H
#include <stdint.h>
#include <stddef.h>
/**
* Initialize the UDP sender.
* Creates a UDP socket targeting the configured aggregator.
*
* @return 0 on success, -1 on error.
*/
int stream_sender_init(void);
/**
* Initialize the UDP sender with explicit IP and port.
* Used when configuration is loaded from NVS at runtime.
*
* @param ip Aggregator IP address string (e.g. "192.168.1.20").
* @param port Aggregator UDP port.
* @return 0 on success, -1 on error.
*/
int stream_sender_init_with(const char *ip, uint16_t port);
/**
* Send a serialized CSI frame over UDP.
*
* @param data Frame data buffer.
* @param len Length of data to send.
* @return Number of bytes sent, or -1 on error.
*/
int stream_sender_send(const uint8_t *data, size_t len);
/**
* Close the UDP sender socket.
*/
void stream_sender_deinit(void);
#endif /* STREAM_SENDER_H */