Mistake on this page? Email us
m2mconfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 ARM Limited. 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 "mbed-client/m2mstring.h"
24 
25 #include <stddef.h>
26 
27 using namespace m2m;
28 
38 #undef MBED_CLIENT_RECONNECTION_COUNT /* 3 */
39 
47 #undef MBED_CLIENT_RECONNECTION_INTERVAL /* 5 */
48 
55 #undef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL /* 90 */
56 
66 #undef MBED_CLIENT_EVENT_LOOP_SIZE /* 1024 */
67 
77 #undef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS /* 5 */
78 
87 #undef MBED_CLIENT_MEMORY_OPTIMIZED_API
88 #if defined (__ICCARM__)
89 #define m2m_deprecated
90 #else
91 #define m2m_deprecated __attribute__ ((deprecated))
92 #endif
93 
94 // This is valid for mbed-client-mbedtls
95 // For other SSL implementation there
96 // can be other
97 
98 /*
99 *\brief A callback function for a random number
100 * required by the mbed-client-mbedtls module.
101 */
102 typedef uint32_t (*random_number_cb)(void) ;
103 
104 /*
105 *\brief An entropy structure for an mbedtls entropy source.
106 * \param entropy_source_ptr The entropy function.
107 * \param p_source The function data.
108 * \param threshold A minimum required from the source before entropy is released
109 * (with mbedtls_entropy_func()) (in bytes).
110 * \param strong MBEDTLS_ENTROPY_SOURCE_STRONG = 1 or
111 * MBEDTSL_ENTROPY_SOURCE_WEAK = 0.
112 * At least one strong source needs to be added.
113 * Weaker sources (such as the cycle counter) can be used as
114 * a complement.
115 */
116 typedef struct mbedtls_entropy {
117  int (*entropy_source_ptr)(void *, unsigned char *,size_t , size_t *);
118  void *p_source;
119  size_t threshold;
120  int strong;
121 }entropy_cb;
122 
123 
124 // Include user provided configuration
125 #ifdef MBED_CLOUD_CLIENT_USER_CONFIG_FILE
126 #include MBED_CLOUD_CLIENT_USER_CONFIG_FILE
127 #endif
128 
129 #ifdef MBED_CLIENT_USER_CONFIG_FILE
130 #include MBED_CLIENT_USER_CONFIG_FILE
131 #endif
132 
133 // Handle first configuration provided via Mbed CLI.
134 
135 #if defined MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
136 #define MBED_CLIENT_RECONNECTION_COUNT MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
137 #endif
138 
139 #if defined MBED_CONF_MBED_CLIENT_RECONNECTION_INTERVAL
140 #define MBED_CLIENT_RECONNECTION_INTERVAL MBED_CONF_MBED_CLIENT_RECONNECTION_INTERVAL
141 #endif
142 
143 #if defined MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
144 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
145 #endif
146 
147 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
148 #define MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
149 #endif
150 
151 #if defined MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
152 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
153 #endif
154 
155 #ifdef MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
156 #define MBED_CLIENT_EVENT_LOOP_SIZE MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
157 #endif
158 
159 #if defined MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
160 #define DISABLE_INTERFACE_DESCRIPTION MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
161 #endif
162 
163 #if defined MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
164 #define DISABLE_RESOURCE_TYPE MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
165 #endif
166 
167 #if defined MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
168 #define DISABLE_DELAYED_RESPONSE MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
169 #endif
170 
171 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
172 #define DISABLE_BLOCK_MESSAGE MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
173 #endif
174 
175 #ifdef MBED_CONF_MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT
176 #define MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT MBED_CONF_MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT
177 #endif
178 
179 #ifdef MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
180 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
181 #endif
182 
183 #ifdef MBED_CLIENT_MEMORY_OPTIMIZED_API
184 #define MEMORY_OPTIMIZED_API MBED_CLIENT_MEMORY_OPTIMIZED_API
185 #elif defined MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
186 #define MEMORY_OPTIMIZED_API MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
187 #endif
188 
189 #ifndef MBED_CONF_MBED_CLIENT_ENABLE_OBSERVATION_PARAMETERS
190 #define MBED_CONF_MBED_CLIENT_ENABLE_OBSERVATION_PARAMETERS 1
191 #endif
192 
193 // Define defaults if not defined yet.
194 
195 #ifndef MBED_CLIENT_RECONNECTION_COUNT
196 #define MBED_CLIENT_RECONNECTION_COUNT 3
197 #endif
198 
199 #ifndef MBED_CLIENT_RECONNECTION_INTERVAL
200 #define MBED_CLIENT_RECONNECTION_INTERVAL 5
201 #endif
202 
203 #ifndef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
204 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 540
205 #endif
206 
207 #ifndef MBED_CLIENT_EVENT_LOOP_SIZE
208 #define MBED_CLIENT_EVENT_LOOP_SIZE 1024
209 #endif
210 
211 #ifndef SN_COAP_MAX_INCOMING_MESSAGE_SIZE
212 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE UINT16_MAX
213 #endif
214 
215 #ifndef MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT
216 #define MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT 80000
217 #endif
218 
219 #ifndef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
220 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS 5
221 #endif
222 
223 #endif // M2MCONFIG_H
Definition: m2mconfig.h:116
A simple C++ string class, used as replacement for std::string.
Namespace defined as replace for components defined under std namespace.
Definition: m2mstring.h:22