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#include "net/unicoap/client.h" /* IWYU pragma: export */
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
25
31
32/* MARK: - Managing the unicoap instance */
46
56
57#if !defined(DOXYGEN) && !IS_ACTIVE(CONFIG_UNICOAP_CREATE_THREAD)
58/* Internal thread function */
59void* _unicoap_loop_run(void* arg);
60#endif
61
62#if defined(DOXYGEN) || !IS_ACTIVE(CONFIG_UNICOAP_CREATE_THREAD)
73static inline void unicoap_loop_run(void) {
74 _unicoap_loop_run(NULL);
75}
76#endif
77
79typedef struct {
87
94#define UNICOAP_JOB(func) { \
95 .super = { \
96 .handler = _UNICOAP_TRY_TYPECHECK_JOB_FUNC(func) \
97 } \
98}
99
122
124
125#ifdef __cplusplus
126}
127#endif
Constants used in CoAP such as option numbers and message codes.
int16_t kernel_pid_t
Unique process identifier.
Definition sched.h:138
static void unicoap_loop_run(void)
Runs unicoap processing loop.
Definition unicoap.h:73
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:79
event_t super
Event that is posted on internal queue.
Definition unicoap.h:85
Compile-time configuration parameters.
CoAP transport protocol abstraction layer.
Client APIs.