Loading...
Searching...
No Matches
bplib_cla_udp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026 Technische Universität Hamburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5#pragma once
32
33#include <stdint.h>
34
35#include "thread_config.h"
36#include "net/sock/udp.h"
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
45#ifndef CONFIG_BPLIB_CLA_UDP_BUFLEN
46# define CONFIG_BPLIB_CLA_UDP_BUFLEN (1024)
47#endif
48
52#ifndef CONFIG_BPLIB_CLA_UDP_TIMEOUT
53# define CONFIG_BPLIB_CLA_UDP_TIMEOUT (10000)
54#endif
55
57#define BPLIB_CLA_UDP_RX_STACK_SIZE (THREAD_STACKSIZE_MEDIUM + CONFIG_BPLIB_CLA_UDP_BUFLEN)
59#define BPLIB_CLA_UDP_TX_STACK_SIZE (THREAD_STACKSIZE_MEDIUM + CONFIG_BPLIB_CLA_UDP_BUFLEN)
60
81
93int bplib_cla_udp_start(bplib_cla_udp_t* cla, uint32_t contact_id);
94
108
109#ifdef __cplusplus
110}
111#endif
112
struct sock_udp sock_udp_t
forward declare for async
Definition types.h:136
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.