Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2025 Carl Seifert
3 * Copyright (C) 2024-2025 TU Dresden
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser General
6 * Public License v2.1. See the file LICENSE in the top level directory for
7 * more details.
8 */
9
10#pragma once
11
12#include <assert.h>
13
14#include "modules.h"
15
23
29
30/* MARK: - Essentials */
40#if !defined(CONFIG_UNICOAP_DEBUG_LOGGING) || defined(DOXYGEN)
41# define CONFIG_UNICOAP_DEBUG_LOGGING 0
42#endif
44
45/* MARK: - Limits */
55#if !defined(CONFIG_UNICOAP_OPTIONS_MAX) || defined(DOXYGEN)
56# define CONFIG_UNICOAP_OPTIONS_MAX (16)
57#endif
58
68#if !defined(CONFIG_UNICOAP_OPTIONS_BUFFER_DEFAULT_CAPACITY) || defined(DOXYGEN)
69# define CONFIG_UNICOAP_OPTIONS_BUFFER_DEFAULT_CAPACITY (32)
70#endif
71
76#define UNICOAP_HEADER_SIZE_MAX (15)
77/* MARK: unicoap_driver_extension_point */
78/* Developer note: If you are adding another CoAP driver, you may need to increase this value. */
79
85#if !defined(CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX) || defined(DOXYGEN)
86# define CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX (8)
87#endif
88
90 "CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX must not be zero");
91
97#if !defined(CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH) || defined(DOXYGEN)
98# define CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH (2)
99#endif
100
102 "CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH must not be zero");
103
107#define UNICOAP_ETAG_LENGTH_FIXED_WIDTH 4
109
110/* MARK: - Timing */
118
122#define UNICOAP_NSTART (1)
123
127#define UNICOAP_DEFAULT_LEISURE (5)
129
130/* MARK: - Resource observation */
140#if !defined(CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH) || defined(DOXYGEN)
141# define CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH (3)
142#endif
143
147#if (CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH == 3)
148# define UNICOAP_OBS_TICK_EXPONENT (0)
149#elif (CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH == 2)
150# define UNICOAP_OBS_TICK_EXPONENT (6)
151#elif (CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH == 1)
152# define UNICOAP_OBS_TICK_EXPONENT (14)
153#else
154# error CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH must not exceed 3
155#endif
157
158#ifdef __cplusplus
159extern "C" {
160}
161#endif
162
POSIX.1-2008 compliant version of the assert macro.
#define CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH
Length of tokens generated by the unicoap client API.
Definition config.h:98
#define CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX
Maximum length of a token received from a client.
Definition config.h:86
Common macros and compiler attributes/pragmas configuration.