Mistake on this page? Email us
m2mconfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2021 Pelion. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  * Licensed under the Apache License, Version 2.0 (the License); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef M2MCONFIG_H
17 #define M2MCONFIG_H
18 
23 #include <stddef.h>
24 #include "mbed-client/m2mversion.h"
25 
26 #ifdef __cplusplus
27 
28 #include "mbed-client/m2mstring.h"
29 
30 using namespace m2m;
31 
32 #endif
33 
34 
44 #undef MBED_CLIENT_RECONNECTION_COUNT /* 3 */
45 
52 #undef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL /* 90 */
53 
63 #undef MBED_CLIENT_EVENT_LOOP_SIZE /* 1024 */
64 
74 #undef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS /* 5 */
75 
84 #undef MBED_CLIENT_MEMORY_OPTIMIZED_API
85 #if defined (__ICCARM__)
86 #define m2m_deprecated
87 #else
88 #define m2m_deprecated __attribute__ ((deprecated))
89 #endif
90 
91 // This is valid for mbed-client-mbedtls
92 // For other SSL implementation there
93 // can be other
94 
95 /*
96 *\brief A callback function for a random number
97 * required by the mbed-client-mbedtls module.
98 */
99 typedef uint32_t (*random_number_cb)(void) ;
100 
101 /*
102 *\brief An entropy structure for an mbedtls entropy source.
103 * \param entropy_source_ptr The entropy function.
104 * \param p_source The function data.
105 * \param threshold A minimum required from the source before entropy is released
106 * (with mbedtls_entropy_func()) (in bytes).
107 * \param strong MBEDTLS_ENTROPY_SOURCE_STRONG = 1 or
108 * MBEDTSL_ENTROPY_SOURCE_WEAK = 0.
109 * At least one strong source needs to be added.
110 * Weaker sources (such as the cycle counter) can be used as
111 * a complement.
112 */
113 typedef struct mbedtls_entropy {
114  int (*entropy_source_ptr)(void *, unsigned char *, size_t, size_t *);
115  void *p_source;
116  size_t threshold;
117  int strong;
118 } entropy_cb;
119 
120 
121 // Include user provided configuration
122 #ifdef MBED_CLOUD_CLIENT_USER_CONFIG_FILE
123 #include MBED_CLOUD_CLIENT_USER_CONFIG_FILE
124 #endif
125 
126 #ifdef MBED_CLIENT_USER_CONFIG_FILE
127 #include MBED_CLIENT_USER_CONFIG_FILE
128 #endif
129 
130 // Handle first configuration provided via Mbed CLI.
131 
132 #if defined MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
133 #define MBED_CLIENT_RECONNECTION_COUNT MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
134 #endif
135 
136 #if defined MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
137 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
138 #endif
139 
140 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
141 #define MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
142 #endif
143 
144 #if defined MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
145 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
146 #endif
147 
148 #ifdef MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
149 #define MBED_CLIENT_EVENT_LOOP_SIZE MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
150 #endif
151 
152 #if defined MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
153 #define DISABLE_INTERFACE_DESCRIPTION MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
154 #endif
155 
156 #if defined MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
157 #define DISABLE_RESOURCE_TYPE MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
158 #endif
159 
160 #if defined MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
161 #define DISABLE_DELAYED_RESPONSE MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
162 #endif
163 
164 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
165 #define DISABLE_BLOCK_MESSAGE MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
166 #endif
167 
168 #ifdef MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
169 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
170 #endif
171 
172 #ifdef MBED_CLIENT_MEMORY_OPTIMIZED_API
173 #define MEMORY_OPTIMIZED_API MBED_CLIENT_MEMORY_OPTIMIZED_API
174 #elif defined MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
175 #define MEMORY_OPTIMIZED_API MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
176 #endif
177 
178 #ifdef MBED_CONF_MBED_CLIENT_MAX_CERTIFICATE_SIZE
179 #define MAX_CERTIFICATE_SIZE MBED_CONF_MBED_CLIENT_MAX_CERTIFICATE_SIZE
180 #else
181 #define MAX_CERTIFICATE_SIZE 1024
182 #endif
183 
184 #ifndef MBED_CONF_MBED_CLIENT_ENABLE_OBSERVATION_PARAMETERS
185 #define MBED_CONF_MBED_CLIENT_ENABLE_OBSERVATION_PARAMETERS 1
186 #endif
187 
188 #ifndef MBED_CONF_MBED_CLIENT_ENABLE_DISCOVERY
189 #define MBED_CONF_MBED_CLIENT_ENABLE_DISCOVERY 1
190 #endif
191 
192 #ifdef MBED_CONF_MBED_CLIENT_BOOTSTRAP_PIGGYBACKED_RESPONSE
193 #define MBED_CLIENT_BOOTSTRAP_PIGGYBACKED_RESPONSE MBED_CONF_MBED_CLIENT_BOOTSTRAP_PIGGYBACKED_RESPONSE
194 #endif
195 #ifndef MBED_CLIENT_BOOTSTRAP_PIGGYBACKED_RESPONSE
196 #define MBED_CLIENT_BOOTSTRAP_PIGGYBACKED_RESPONSE 1
197 #endif
198 
199 #ifdef MBED_CONF_MBED_CLIENT_MAX_RECONNECT_TIMEOUT
200 #define MBED_CLIENT_MAX_RECONNECT_TIMEOUT MBED_CONF_MBED_CLIENT_MAX_RECONNECT_TIMEOUT
201 #endif
202 #ifndef MBED_CLIENT_MAX_RECONNECT_TIMEOUT
203 #define MBED_CLIENT_MAX_RECONNECT_TIMEOUT 14400 // 4 hours
204 #endif
205 
206 #ifndef MBED_CLIENT_RECONNECTION_COUNT
207 #define MBED_CLIENT_RECONNECTION_COUNT 3
208 #endif
209 
210 #ifndef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
211 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 540
212 #endif
213 
214 #ifndef MBED_CLIENT_EVENT_LOOP_SIZE
215 #define MBED_CLIENT_EVENT_LOOP_SIZE 1024
216 #endif
217 
218 #ifndef SN_COAP_MAX_INCOMING_MESSAGE_SIZE
219 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE UINT16_MAX
220 #endif
221 
222 #ifndef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
223 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS 5
224 #endif
225 
226 #ifdef MBED_CONF_MBED_CLIENT_ENABLE_DYNAMIC_OBSERVABLE
227 #define MBED_CLIENT_ENABLE_DYNAMIC_OBSERVABLE MBED_CONF_MBED_CLIENT_ENABLE_DYNAMIC_OBSERVABLE
228 #endif
229 
230 #ifndef MBED_CLIENT_ENABLE_DYNAMIC_OBSERVABLE
231 #define MBED_CLIENT_ENABLE_DYNAMIC_OBSERVABLE 1
232 #endif
233 
234 #ifdef MBED_CONF_MBED_CLIENT_DYNAMIC_LOGGING_BUFFER_SIZE
235 #define MBED_CLIENT_DYNAMIC_LOGGING_BUFFER_SIZE MBED_CONF_MBED_CLIENT_DYNAMIC_LOGGING_BUFFER_SIZE
236 #endif
237 
238 #ifdef MBED_CONF_MBED_CLIENT_DYNAMIC_LOGGING_USE_FILESYSTEM
239 #define MBED_CLIENT_DYNAMIC_LOGGING_USE_FILESYSTEM MBED_CONF_MBED_CLIENT_DYNAMIC_LOGGING_USE_FILESYSTEM
240 #endif
241 
242 #endif // M2MCONFIG_H
Definition: m2mconfig.h:113
header for m2m::String
Namespace defined as replace for components defined under std namespace.
Definition: m2mstring.h:24