Mayank Gupta / Mbed OS pelion-example-frdm

Dependencies:   FXAS21002 FXOS8700Q

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mconfig.h Source File

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_INTERVAL
00051  *
00052  * \brief The number of seconds between CoAP ping messages.
00053  * By default, the value is 90 seconds.
00054  */
00055 #undef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL   /* 90 */
00056 
00057 /**
00058  * \def MBED_CLIENT_EVENT_LOOP_SIZE
00059  *
00060  * \brief Defines the size of memory allocated for
00061  * event loop (in bytes) for timer and network event
00062  * handling of mbed Client.
00063  * By default, this value is 1024 bytes.This memory is
00064  * allocated from heap
00065  */
00066 #undef MBED_CLIENT_EVENT_LOOP_SIZE      /* 1024 */
00067 
00068 /**
00069  * \def MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
00070  *
00071  * \brief CoAP resend queue size.
00072  * mbed Client can send five types of confirmable messages at the same time,
00073  * notification, file download, register update, delayed post response and ping.
00074  * \note Reducing this value can cause some resend queue which may lead to unnecessary full registrations.
00075  * By default, the message count is 5.
00076  */
00077 #undef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS  /* 5 */
00078 
00079 /**
00080  * \def MBED_CLIENT_MEMORY_OPTIMIZED_API
00081  *
00082  * \brief If enabled, this will reduce RAM and ROM consumption.
00083  * NOTE! This will disable usage of some API's and also change some API signatures.
00084  * By default this is disabled.
00085  */
00086 #undef MBED_CLIENT_MEMORY_OPTIMIZED_API
00087 
00088 #if defined MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
00089 #define MBED_CLIENT_RECONNECTION_COUNT MBED_CONF_MBED_CLIENT_RECONNECTION_COUNT
00090 #endif
00091 
00092 #if defined MBED_CONF_MBED_CLIENT_RECONNECTION_INTERVAL
00093 #define MBED_CLIENT_RECONNECTION_INTERVAL MBED_CONF_MBED_CLIENT_RECONNECTION_INTERVAL
00094 #endif
00095 
00096 #if defined MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
00097 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL MBED_CONF_MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
00098 #endif
00099 
00100 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
00101 #define MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE MBED_CONF_MBED_CLIENT_DISABLE_BOOTSTRAP_FEATURE
00102 #endif
00103 
00104 #if defined MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
00105 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE MBED_CONF_MBED_CLIENT_SN_COAP_MAX_INCOMING_MESSAGE_SIZE
00106 #endif
00107 
00108 #ifdef MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
00109 #define MBED_CLIENT_EVENT_LOOP_SIZE MBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE
00110 #endif
00111 
00112 #if defined MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
00113 #define DISABLE_INTERFACE_DESCRIPTION MBED_CONF_MBED_CLIENT_DISABLE_INTERFACE_DESCRIPTION
00114 #endif
00115 
00116 #if defined MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
00117 #define DISABLE_RESOURCE_TYPE MBED_CONF_MBED_CLIENT_DISABLE_RESOURCE_TYPE
00118 #endif
00119 
00120 #if defined MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
00121 #define DISABLE_DELAYED_RESPONSE MBED_CONF_MBED_CLIENT_DISABLE_DELAYED_RESPONSE
00122 #endif
00123 
00124 #if defined MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
00125 #define DISABLE_BLOCK_MESSAGE MBED_CONF_MBED_CLIENT_DISABLE_BLOCK_MESSAGE
00126 #endif
00127 
00128 #ifdef MBED_CONF_MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT
00129 #define MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT MBED_CONF_MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT
00130 #endif
00131 
00132 #ifdef MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
00133 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS MBED_CONF_MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
00134 #endif
00135 
00136 #ifdef MBED_CLIENT_MEMORY_OPTIMIZED_API
00137 #define MEMORY_OPTIMIZED_API MBED_CLIENT_MEMORY_OPTIMIZED_API
00138 #elif defined MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
00139 #define MEMORY_OPTIMIZED_API MBED_CONF_MBED_CLIENT_MEMORY_OPTIMIZED_API
00140 #endif
00141 
00142 #if defined (__ICCARM__)
00143 #define m2m_deprecated
00144 #else
00145 #define m2m_deprecated __attribute__ ((deprecated))
00146 #endif
00147 
00148 // This is valid for mbed-client-mbedtls
00149 // For other SSL implementation there
00150 // can be other
00151 
00152 /*
00153 *\brief A callback function for a random number
00154 * required by the mbed-client-mbedtls module.
00155 */
00156 typedef uint32_t (*random_number_cb)(void) ;
00157 
00158 /*
00159 *\brief An entropy structure for an mbedtls entropy source.
00160 * \param entropy_source_ptr The entropy function.
00161 * \param p_source  The function data.
00162 * \param threshold A minimum required from the source before entropy is released
00163 *                  (with mbedtls_entropy_func()) (in bytes).
00164 * \param strong    MBEDTLS_ENTROPY_SOURCE_STRONG = 1 or
00165 *                  MBEDTSL_ENTROPY_SOURCE_WEAK = 0.
00166 *                  At least one strong source needs to be added.
00167 *                  Weaker sources (such as the cycle counter) can be used as
00168 *                  a complement.
00169 */
00170 typedef struct mbedtls_entropy {
00171     int     (*entropy_source_ptr)(void *, unsigned char *,size_t , size_t *);
00172     void    *p_source;
00173     size_t  threshold;
00174     int     strong;
00175 }entropy_cb;
00176 
00177 #ifdef MBED_CLIENT_USER_CONFIG_FILE
00178 #include MBED_CLIENT_USER_CONFIG_FILE
00179 #endif
00180 
00181 #ifndef MBED_CLIENT_RECONNECTION_COUNT
00182 #define MBED_CLIENT_RECONNECTION_COUNT 3
00183 #endif
00184 
00185 #ifndef MBED_CLIENT_RECONNECTION_INTERVAL
00186 #define MBED_CLIENT_RECONNECTION_INTERVAL 5
00187 #endif
00188 
00189 #ifndef MBED_CLIENT_TCP_KEEPALIVE_INTERVAL
00190 #define MBED_CLIENT_TCP_KEEPALIVE_INTERVAL 90
00191 #endif
00192 
00193 #ifndef MBED_CLIENT_EVENT_LOOP_SIZE
00194 #define MBED_CLIENT_EVENT_LOOP_SIZE 1024
00195 #endif
00196 
00197 #ifndef SN_COAP_MAX_INCOMING_MESSAGE_SIZE
00198 #define SN_COAP_MAX_INCOMING_MESSAGE_SIZE UINT16_MAX
00199 #endif
00200 
00201 #ifndef MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT
00202 #define MBED_CLIENT_DTLS_PEER_MAX_TIMEOUT 80000
00203 #endif
00204 
00205 #ifndef MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS
00206 #define MBED_CLIENT_SN_COAP_RESENDING_QUEUE_SIZE_MSGS 5
00207 #endif
00208 
00209 #endif // M2MCONFIG_H