Loading...
Searching...
No Matches
unicoap.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024-2026 Carl Seifert
3 * SPDX-FileCopyrightText: 2024-2026 TU Dresden
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
9#include "net/unicoap/constants.h" /* IWYU pragma: export */
10#include "net/unicoap/config.h" /* IWYU pragma: export */
11#include "net/unicoap/message.h" /* IWYU pragma: export */
12#include "net/unicoap/options.h" /* IWYU pragma: export */
13#include "net/unicoap/transport.h" /* IWYU pragma: export */
14#include "net/unicoap/server.h" /* IWYU pragma: export */
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
24
30
31/* MARK: - Managing the unicoap instance */
45
55
56#if !defined(DOXYGEN) && !IS_ACTIVE(CONFIG_UNICOAP_CREATE_THREAD)
57/* Internal thread function */
58void* _unicoap_loop_run(void* arg);
59#endif
60
61#if defined(DOXYGEN) || !IS_ACTIVE(CONFIG_UNICOAP_CREATE_THREAD)
72static inline void unicoap_loop_run(void) {
73 _unicoap_loop_run(NULL);
74}
75#endif
76
78typedef struct {
86
93#define UNICOAP_JOB(func) { \
94 .super = { \
95 .handler = _UNICOAP_TRY_TYPECHECK_JOB_FUNC(func) \
96 } \
97}
98
121
123
124#ifdef __cplusplus
125}
126#endif
Constants used in CoAP such as option numbers and message codes.
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:134
static void unicoap_loop_run(void)
Runs unicoap processing loop.
Definition unicoap.h:72
int unicoap_loop_enqueue(unicoap_job_t *job)
Schedules event to be run in the internal processing loop at the next possible instance.
kernel_pid_t unicoap_init(void)
Initializes the unicoap stack.
int unicoap_deinit(void)
Tears down the unicoap stack, closing the background thread.
struct event event_t
event structure forward declaration
Definition event.h:132
CoAP Message API.
Options umbrella header.
Server APIs.
A job that can be enqueued and executed by the unicoap message processing loop.
Definition unicoap.h:78
event_t super
Event that is posted on internal queue.
Definition unicoap.h:84
Compile-time configuration parameters.
CoAP transport protocol abstraction layer.