1 /* 2 * Copyright (c) 2017, The OpenThread Authors. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 3. Neither the name of the copyright holder nor the 13 * names of its contributors may be used to endorse or promote products 14 * derived from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 /** 30 * @file 31 * This file includes simulation compile-time configuration constants 32 * for OpenThread. 33 */ 34 35 #ifndef OPENTHREAD_CORE_SIMULATION_CONFIG_H_ 36 #define OPENTHREAD_CORE_SIMULATION_CONFIG_H_ 37 38 #ifndef OPENTHREAD_RADIO 39 #define OPENTHREAD_RADIO 0 40 #endif 41 42 /** 43 * @def OPENTHREAD_CONFIG_PLATFORM_INFO 44 * 45 * The platform-specific string to insert into the OpenThread version string. 46 * 47 */ 48 #define OPENTHREAD_CONFIG_PLATFORM_INFO "SIMULATION" 49 50 /** 51 * @def OPENTHREAD_CONFIG_LOG_OUTPUT 52 * 53 * Specify where the log output should go. 54 * 55 */ 56 #ifndef OPENTHREAD_CONFIG_LOG_OUTPUT /* allow command line override */ 57 #define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED 58 #endif 59 60 /** 61 * @def OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 62 * 63 * Define as 1 to enable support for adding of auto-configured SLAAC addresses by OpenThread. 64 * 65 */ 66 #ifndef OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE /* allows command line override */ 67 #define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 68 #endif 69 70 #if OPENTHREAD_RADIO 71 /** 72 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 73 * 74 * Define to 1 if you want to enable software ACK timeout logic. 75 * 76 */ 77 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 78 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 1 79 #endif 80 81 /** 82 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 83 * 84 * Define to 1 if you want to enable software energy scanning logic. 85 * 86 */ 87 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 88 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 1 89 #endif 90 91 /** 92 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 93 * 94 * Define to 1 if you want to enable software retransmission logic. 95 * 96 */ 97 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 98 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 99 #endif 100 101 /** 102 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 103 * 104 * Define to 1 if you want to enable software CSMA-CA backoff logic. 105 * 106 */ 107 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 108 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 1 109 #endif 110 111 /** 112 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 113 * 114 * Define to 1 if you want to enable software transmission security logic. 115 * 116 */ 117 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 118 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1 119 #endif 120 121 /** 122 * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 123 * 124 * Define to 1 to enable software transmission target time logic. 125 * 126 */ 127 #ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 128 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 129 #endif 130 #endif // OPENTHREAD_RADIO 131 132 /** 133 * @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 134 * 135 * Define to 1 if you want to support microsecond timer in platform. 136 * 137 */ 138 #define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 139 140 /** 141 * @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 142 * 143 * Define to 1 to enable otPlatFlash* APIs to support non-volatile storage. 144 * 145 * When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs. 146 * 147 */ 148 #define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1 149 150 /** 151 * @def CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER 152 * 153 * Define to 1 to use DefaultHandler for unhandled requests 154 * 155 */ 156 #define CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER 1 157 158 /** 159 * @def OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 160 * 161 * Define to 1 if you want to enable radio coexistence implemented in platform. 162 * 163 */ 164 #ifndef OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 165 #define OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE 1 166 #endif 167 168 #ifndef OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 169 #define OPENTHREAD_CONFIG_PARENT_SEARCH_ENABLE 1 170 #endif 171 172 /** 173 * @def OPENTHREAD_CONFIG_LOG_PLATFORM 174 * 175 * Define to enable platform region logging. 176 * 177 */ 178 #ifndef OPENTHREAD_CONFIG_LOG_PLATFORM 179 #define OPENTHREAD_CONFIG_LOG_PLATFORM 1 180 #endif 181 182 /** 183 * @def OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH 184 * 185 * The maximum size of the CLI line in bytes. 186 * 187 */ 188 #ifndef OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH 189 #define OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH 640 190 #endif 191 192 /** 193 * @def OPENTHREAD_CONFIG_CLI_UART_RX_BUFFER_SIZE 194 * 195 * The size of CLI UART RX buffer in bytes. 196 * 197 */ 198 #ifndef OPENTHREAD_CONFIG_CLI_UART_RX_BUFFER_SIZE 199 #define OPENTHREAD_CONFIG_CLI_UART_RX_BUFFER_SIZE 640 200 #endif 201 202 /** 203 * @def OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 204 * 205 * The maximum number of children. 206 * 207 */ 208 #ifndef OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 209 #define OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 128 210 #endif 211 212 /** 213 * @def OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 214 * 215 * Define as 1 for a child to inform its previous parent when it attaches to a new parent. 216 * 217 * If this feature is enabled, when a device attaches to a new parent, it will send an IP message (with empty payload 218 * and mesh-local IP address as the source address) to its previous parent. 219 * 220 */ 221 #ifndef OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 222 #define OPENTHREAD_CONFIG_MLE_INFORM_PREVIOUS_PARENT_ON_REATTACH 1 223 #endif 224 225 /** 226 * @def OPENTHREAD_CONFIG_UPTIME_ENABLE 227 * 228 * Define to 1 to enable tracking the uptime of OpenThread instance. 229 * 230 */ 231 #ifndef OPENTHREAD_CONFIG_UPTIME_ENABLE 232 #define OPENTHREAD_CONFIG_UPTIME_ENABLE 1 233 #endif 234 235 /** 236 * @def OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME 237 * 238 * Define as 1 to prepend the current uptime to all log messages. 239 * 240 */ 241 #ifndef OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME 242 #define OPENTHREAD_CONFIG_LOG_PREPEND_UPTIME 1 243 #endif 244 245 /** 246 * @def OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES 247 * 248 * Specifies number of service entries in the SRP client service pool. 249 * 250 * This config is applicable only when `OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE` is enabled. 251 * 252 */ 253 #ifndef OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES 254 #define OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_SERVICES 20 255 #endif 256 257 #endif // OPENTHREAD_CORE_SIMULATION_CONFIG_H_ 258