Loading...
Searching...
No Matches
bplib_cla_udp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Hamburg University of Technology (TUHH)
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5#pragma once
29
30#include <stdint.h>
31
32#include "thread_config.h"
33#include "net/sock/udp.h"
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
42#ifndef CONFIG_BPLIB_CLA_UDP_BUFLEN
43# define CONFIG_BPLIB_CLA_UDP_BUFLEN (1024)
44#endif
45
49#ifndef CONFIG_BPLIB_CLA_UDP_TIMEOUT
50# define CONFIG_BPLIB_CLA_UDP_TIMEOUT (10000)
51#endif
52
54#define BPLIB_CLA_UDP_RX_STACK_SIZE (THREAD_STACKSIZE_MEDIUM + CONFIG_BPLIB_CLA_UDP_BUFLEN)
56#define BPLIB_CLA_UDP_TX_STACK_SIZE (THREAD_STACKSIZE_MEDIUM + CONFIG_BPLIB_CLA_UDP_BUFLEN)
57
78
90int bplib_cla_udp_start(bplib_cla_udp_t* cla, uint32_t contact_id);
91
105
106#ifdef __cplusplus
107}
108#endif
109
struct sock_udp sock_udp_t
forward declare for async
Definition types.h:139
int bplib_cla_udp_start(bplib_cla_udp_t *cla, uint32_t contact_id)
Starts the UDP CLA.
#define BPLIB_CLA_UDP_TX_STACK_SIZE
TX stack size, including egress buffer.
void bplib_cla_udp_stop(bplib_cla_udp_t *cla)
Stops the CLA.
#define BPLIB_CLA_UDP_RX_STACK_SIZE
RX stack size, including receive buffer.
UDP sock definitions.
Holds an instance of a UDP CLA, including its stacks.
sock_udp_t sock
Connection socket.
volatile int running
Whether the CLA is running.
uint32_t contact_id
Index of the contact in the contact table.
char stack_rx[BPLIB_CLA_UDP_RX_STACK_SIZE]
Stack of the ingress thread (sock recv -> bplib)
char stack_tx[BPLIB_CLA_UDP_TX_STACK_SIZE]
Stack of the egress thread (bplib -> sock send)
Thread configuration defines.