Simple interface for Mbed Cloud Client
Embed:
(wiki syntax)
Show/hide line numbers
m2mconfig.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (c) 2015 ARM Limited. All rights reserved. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * Licensed under the Apache License, Version 2.0 (the License); you may 00005 * not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #ifndef M2MCONFIG_H 00017 #define M2MCONFIG_H 00018 00019 /*! \file m2mconfig.h 00020 * \brief File defining all system build time configuration used by mbed-client. 00021 */ 00022 00023 #include "mbed-client/m2mstring.h" 00024 00025 #include <stddef.h> 00026 00027 using namespace m2m; 00028 00029 /** 00030 * \def MBED_CLIENT_RECONNECTION_COUNT 00031 * 00032 * \brief Sets Reconnection count for mbed Client 00033 * to attempt a reconnection re-tries until 00034 * reaches the defined value either by the application 00035 * or the default value set in Client. 00036 * By default, the value is 3. 00037 */ 00038 #undef MBED_CLIENT_RECONNECTION_COUNT /* 3 */ 00039 00040 /** 00041 * \def MBED_CLIENT_RECONNECTION_INTERVAL 00042 * 00043 * \brief Sets Reconnection interval (in seconds) for 00044 * mbed Client to attempt a reconnection re-tries. 00045 * By default, the value is 5 seconds. 00046 */ 00047 #undef MBED_CLIENT_RECONNECTION_INTERVAL /* 5 */ 00048 00049 /** 00050 * \def MBED_CLIENT_TCP_KEEPALIVE_TIME 00051 * 00052 * \brief Keep alive time (in seconds) to send pings 00053 * in case mbed Client is connected through TCP. 00054 * By default, the value is 600 seconds. 00055 */ 00056 #undef MBED_CLIENT_TCP_KEEPALIVE_TIME /* 600 */ 00057 00058 /** 00059 * \def MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 00060 * 00061 * \brief The number of seconds between TCP keep-alive probes. 00062 * By default, the value is 75 seconds. 00063 */ 00064 #undef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL /* 75 */ 00065 00066 /** 00067 * \def MBED_CLIENT_EVENT_LOOP_SIZE 00068 * 00069 * \brief Defines the size of memory allocated for 00070 * event loop (in bytes) for timer and network event 00071 * handling of mbed Client. 00072 * By default, this value is 1024 bytes.This memory is 00073 * allocated from heap 00074 */ 00075 #undef MBED_CLIENT_EVENT_LOOP_SIZE /* 1024 */ 00076 00077 #ifdef YOTTA_CFG_RECONNECTION_COUNT 00078 #define MBED_CLIENT_RECONNECTION_COUNT YOTTA_CFG_RECONNECTION_COUNT 00079 #elif defined MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT 00080 #define MBED_CLIENT_RECONNECTION_COUNT MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT 00081 #endif 00082 00083 #ifdef YOTTA_CFG_RECONNECTION_INTERVAL 00084 #define MBED_CLIENT_RECONNECTION_INTERVAL YOTTA_CFG_RECONNECTION_INTERVAL 00085 #elif defined MBED_CONF_MBED_CLIENT_RECONNECTION_INTERVAL 00086 #define MBED_CLIENT_RECONNECTION_INTERVAL MBED_CONF_MBED_CLIENT_RECONNECTION_INTERVAL 00087 #endif 00088 00089 #ifdef YOTTA_CFG_TCP_KEEPALIVE_TIME 00090 #define MBED_CLIENT_TCP_KEEPALIVE_TIME YOTTA_CFG_TCP_KEEPALIVE_TIME 00091 #elif defined MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_TIME 00092 #define MBED_CLIENT_TCP_KEEPALIVE_TIME MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_TIME 00093 #endif 00094 00095 #ifdef YOTTA_CFG_TCP_KEEPALIVE_INTERVAL 00096 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL YOTTA_CFG_TCP_KEEPALIVE_INTERVAL 00097 #elif defined MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 00098 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 00099 #endif 00100 00101 #ifdef YOTTA_CFG_DISABLE_BOOTSTRAP_FEATURE 00102 #define MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE YOTTA_CFG_DISABLE_BOOTSTRAP_FEATURE 00103 #elif defined MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE 00104 #define MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE 00105 #endif 00106 00107 #ifdef YOTTA_CFG_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE 00108 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE YOTTA_CFG_COAP_MAX_INCOMING_BLOCK_MESSAGE_SIZE 00109 #elif defined MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE 00110 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE 00111 #endif 00112 00113 #ifdef MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE 00114 #define MBED_CLIENT_EVENT_LOOP_SIZE MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE 00115 #endif 00116 00117 #ifdef YOTTA_CFG_DISABLE_INTERFACE_DESCRIPTION 00118 #define DISABLE_INTERFACE_DESCRIPTION YOTTA_CFG_DISABLE_INTERFACE_DESCRIPTION 00119 #elif defined MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION 00120 #define DISABLE_INTERFACE_DESCRIPTION MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION 00121 #endif 00122 00123 #ifdef YOTTA_CFG_DISABLE_RESOURCE_TYPE 00124 #define DISABLE_RESOURCE_TYPE YOTTA_CFG_DISABLE_RESOURCE_TYPE 00125 #elif defined MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE 00126 #define DISABLE_RESOURCE_TYPE MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE 00127 #endif 00128 00129 #ifdef YOTTA_CFG_DISABLE_DELAYED_RESPONSE 00130 #define DISABLE_DELAYED_RESPONSE YOTTA_CFG_DISABLE_DELAYED_RESPONSE 00131 #elif defined MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE 00132 #define DISABLE_DELAYED_RESPONSE MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE 00133 #endif 00134 00135 #ifdef YOTTA_CFG_DISABLE_BLOCK_MESSAGE 00136 #define DISABLE_BLOCK_MESSAGE YOTTA_CFG_DISABLE_BLOCK_MESSAGE 00137 #elif defined MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE 00138 #define DISABLE_BLOCK_MESSAGE MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE 00139 #endif 00140 00141 #ifdef MBED_CONF_MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT 00142 #define MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT MBED_CONF_MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT 00143 #endif 00144 00145 00146 #if defined (__ICCARM__) 00147 #define m2m_deprecated 00148 #else 00149 #define m2m_deprecated __attribute__ ((deprecated)) 00150 #endif 00151 00152 // This is valid for mbed-client-mbedtls 00153 // For other SSL implementation there 00154 // can be other 00155 00156 /* 00157 *\brief A callback function for a random number 00158 * required by the mbed-client-mbedtls module. 00159 */ 00160 typedef uint32_t (*random_number_cb)(void) ; 00161 00162 /* 00163 *\brief An entropy structure for an mbedtls entropy source. 00164 * \param entropy_source_ptr The entropy function. 00165 * \param p_source The function data. 00166 * \param threshold A minimum required from the source before entropy is released 00167 * (with mbedtls_entropy_func()) (in bytes). 00168 * \param strong MBEDTLS_ENTROPY_SOURCE_STRONG = 1 or 00169 * MBEDTSL_ENTROPY_SOURCE_WEAK = 0. 00170 * At least one strong source needs to be added. 00171 * Weaker sources (such as the cycle counter) can be used as 00172 * a complement. 00173 */ 00174 typedef struct mbedtls_entropy { 00175 int (*entropy_source_ptr)(void *, unsigned char *,size_t , size_t *); 00176 void *p_source; 00177 size_t threshold; 00178 int strong; 00179 }entropy_cb; 00180 00181 #ifdef MBED_CLIENT_USER_CONFIG_FILE 00182 #include MBED_CLIENT_USER_CONFIG_FILE 00183 #endif 00184 00185 #ifndef MBED_CLIENT_RECONNECTION_COUNT 00186 #define MBED_CLIENT_RECONNECTION_COUNT 3 00187 #endif 00188 00189 #ifndef MBED_CLIENT_RECONNECTION_INTERVAL 00190 #define MBED_CLIENT_RECONNECTION_INTERVAL 5 00191 #endif 00192 00193 #ifndef MBED_CLIENT_TCP_KEEPALIVE_TIME 00194 #define MBED_CLIENT_TCP_KEEPALIVE_TIME 600 00195 #endif 00196 00197 #ifndef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 00198 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 75 00199 #endif 00200 00201 #ifndef MBED_CLIENT_EVENT_LOOP_SIZE 00202 #define MBED_CLIENT_EVENT_LOOP_SIZE 1024 00203 #endif 00204 00205 #ifndef SN_COAP_MAX_INCOMING_MESSAGE_SIZE 00206 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE UINT16_MAX 00207 #endif 00208 00209 #ifndef MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT 00210 #define MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT 80000 00211 #endif 00212 00213 #endif // M2MCONFIG_H
Generated on Tue Jul 12 2022 19:01:34 by 1.7.2