config.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2024-2025 Carl Seifert
3  * SPDX-FileCopyrightText: 2024-2025 TU Dresden
4  * SPDX-License-Identifier: LGPL-2.1-only
5  */
6 
7 #pragma once
8 
9 #include <assert.h>
10 
11 #include "modules.h"
12 
27 /* MARK: - Essentials */
37 #if !defined(CONFIG_UNICOAP_DEBUG_LOGGING) || defined(DOXYGEN)
38 # define CONFIG_UNICOAP_DEBUG_LOGGING 0
39 #endif
42 /* MARK: - Limits */
52 #if !defined(CONFIG_UNICOAP_OPTIONS_MAX) || defined(DOXYGEN)
53 # define CONFIG_UNICOAP_OPTIONS_MAX (16)
54 #endif
55 
65 #if !defined(CONFIG_UNICOAP_OPTIONS_BUFFER_DEFAULT_CAPACITY) || defined(DOXYGEN)
66 # define CONFIG_UNICOAP_OPTIONS_BUFFER_DEFAULT_CAPACITY (32)
67 #endif
68 
73 #define UNICOAP_HEADER_SIZE_MAX (15)
74 /* MARK: unicoap_driver_extension_point */
75 /* Developer note: If you are adding another CoAP driver, you may need to increase this value. */
76 
82 #if !defined(CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX) || defined(DOXYGEN)
83 # define CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX (8)
84 #endif
85 
87  "CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX must not be zero");
88 
94 #if !defined(CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH) || defined(DOXYGEN)
95 # define CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH (2)
96 #endif
97 
99  "CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH must not be zero");
100 
104 #define UNICOAP_ETAG_LENGTH_FIXED_WIDTH 4
107 /* MARK: - Timing */
119 #define UNICOAP_NSTART (1)
120 
124 #define UNICOAP_DEFAULT_LEISURE (5)
127 /* MARK: - Resource observation */
137 #if !defined(CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH) || defined(DOXYGEN)
138 # define CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH (3)
139 #endif
140 
144 #if (CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH == 3)
145 # define UNICOAP_OBS_TICK_EXPONENT (0)
146 #elif (CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH == 2)
147 # define UNICOAP_OBS_TICK_EXPONENT (6)
148 #elif (CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH == 1)
149 # define UNICOAP_OBS_TICK_EXPONENT (14)
150 #else
151 # error CONFIG_UNICOAP_OBSERVE_VALUE_WIDTH must not exceed 3
152 #endif
155 #ifdef __cplusplus
156 extern "C" {
157 }
158 #endif
159 
POSIX.1-2008 compliant version of the assert macro.
#define static_assert(cond,...)
static_assert for c-version < c11
Definition: assert.h:160
#define CONFIG_UNICOAP_GENERATED_TOKEN_LENGTH
Length of tokens generated by the unicoap client API.
Definition: config.h:95
#define CONFIG_UNICOAP_EXTERNAL_TOKEN_LENGTH_MAX
Maximum length of a token received from a client.
Definition: config.h:83
Common macros and compiler attributes/pragmas configuration.