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 <stddef.h>
24 
25 #ifdef __cplusplus
26 
27 #include "mbed-client/m2mstring.h"
28 
29 using namespace m2m;
30 
31 #endif
32 
33 
43 #undef MBED_CLIENT_RECONNECTION_COUNT /* 3 */
44 
51 #undef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL /* 90 */
52 
62 #undef MBED_CLIENT_EVENT_LOOP_SIZE /* 1024 */
63 
73 #undef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS /* 5 */
74 
83 #undef MBED_CLIENT_MEMORY_OPTIMIZED_API
84 #if defined (__ICCARM__)
85 #define m2m_deprecated
86 #else
87 #define m2m_deprecated __attribute__ ((deprecated))
88 #endif
89 
90 // This is valid for mbed-client-mbedtls
91 // For other SSL implementation there
92 // can be other
93 
94 /*
95 *\brief A callback function for a random number
96 * required by the mbed-client-mbedtls module.
97 */
98 typedef uint32_t (*random_number_cb)(void) ;
99 
100 /*
101 *\brief An entropy structure for an mbedtls entropy source.
102 * \param entropy_source_ptr The entropy function.
103 * \param p_source The function data.
104 * \param threshold A minimum required from the source before entropy is released
105 * (with mbedtls_entropy_func()) (in bytes).
106 * \param strong MBEDTLS_ENTROPY_SOURCE_STRONG = 1 or
107 * MBEDTSL_ENTROPY_SOURCE_WEAK = 0.
108 * At least one strong source needs to be added.
109 * Weaker sources (such as the cycle counter) can be used as
110 * a complement.
111 */
112 typedef struct mbedtls_entropy {
113  int (*entropy_source_ptr)(void *, unsigned char *,size_t , size_t *);
114  void *p_source;
115  size_t threshold;
116  int strong;
117 }entropy_cb;
118 
119 
120 // Include user provided configuration
121 #ifdef MBED_CLOUD_CLIENT_USER_CONFIG_FILE
122 #include MBED_CLOUD_CLIENT_USER_CONFIG_FILE
123 #endif
124 
125 #ifdef MBED_CLIENT_USER_CONFIG_FILE
126 #include MBED_CLIENT_USER_CONFIG_FILE
127 #endif
128 
129 // Handle first configuration provided via Mbed CLI.
130 
131 #if defined MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
132 #define MBED_CLIENT_RECONNECTION_COUNT MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
133 #endif
134 
135 #if defined MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
136 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
137 #endif
138 
139 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
140 #define MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
141 #endif
142 
143 #if defined MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
144 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
145 #endif
146 
147 #ifdef MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
148 #define MBED_CLIENT_EVENT_LOOP_SIZE MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
149 #endif
150 
151 #if defined MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
152 #define DISABLE_INTERFACE_DESCRIPTION MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
153 #endif
154 
155 #if defined MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
156 #define DISABLE_RESOURCE_TYPE MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
157 #endif
158 
159 #if defined MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
160 #define DISABLE_DELAYED_RESPONSE MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
161 #endif
162 
163 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
164 #define DISABLE_BLOCK_MESSAGE MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
165 #endif
166 
167 #ifdef MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
168 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
169 #endif
170 
171 #ifdef MBED_CLIENT_MEMORY_OPTIMIZED_API
172 #define MEMORY_OPTIMIZED_API MBED_CLIENT_MEMORY_OPTIMIZED_API
173 #elif defined MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
174 #define MEMORY_OPTIMIZED_API MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
175 #endif
176 
177 #ifndef MBED_CONF_MBED_CLIENT_ENABLE_OBSERVATION_PARAMETERS
178 #define MBED_CONF_MBED_CLIENT_ENABLE_OBSERVATION_PARAMETERS 1
179 #endif
180 
181 // Define defaults if not defined yet.
182 
183 #ifndef MBED_CLIENT_RECONNECTION_COUNT
184 #define MBED_CLIENT_RECONNECTION_COUNT 3
185 #endif
186 
187 #ifndef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
188 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 540
189 #endif
190 
191 #ifndef MBED_CLIENT_EVENT_LOOP_SIZE
192 #define MBED_CLIENT_EVENT_LOOP_SIZE 1024
193 #endif
194 
195 #ifndef SN_COAP_MAX_INCOMING_MESSAGE_SIZE
196 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE UINT16_MAX
197 #endif
198 
199 #ifndef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
200 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS 5
201 #endif
202 
203 #endif // M2MCONFIG_H
Definition: m2mconfig.h:112
header for m2m::String
Namespace defined as replace for components defined under std namespace.
Definition: m2mstring.h:24