nRF5 SDK for Mesh v3.2.0  08c60f6
nrf_mesh_config_core.h
1 /* Copyright (c) 2010 - 2019, Nordic Semiconductor ASA
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form, except as embedded into a Nordic
11  * Semiconductor ASA integrated circuit in a product or a software update for
12  * such product, must reproduce the above copyright notice, this list of
13  * conditions and the following disclaimer in the documentation and/or other
14  * materials provided with the distribution.
15  *
16  * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17  * contributors may be used to endorse or promote products derived from this
18  * software without specific prior written permission.
19  *
20  * 4. This software, with or without modification, must only be used with a
21  * Nordic Semiconductor ASA integrated circuit.
22  *
23  * 5. Any software provided in binary form under this license must not be reverse
24  * engineered, decompiled, modified and/or disassembled.
25  *
26  * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
27  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28  * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
30  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
35  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef NRF_MESH_CONFIG_CORE_H__
39 #define NRF_MESH_CONFIG_CORE_H__
40 
41 #include "nrf_mesh_defines.h"
42 #ifdef CONFIG_APP_IN_CORE
43 #include "nrf_mesh_config_app.h"
44 #endif
45 
62 #ifndef PERSISTENT_STORAGE
63 #define PERSISTENT_STORAGE 1
64 #endif
65 
69 #ifndef NRF_MESH_UECC_ENABLE
70 #define NRF_MESH_UECC_ENABLE 1
71 #endif
72 
76 #define FLASH_MANAGER_BACKEND
77 
94 #ifndef AES_USE_HARDWARE
95 #define AES_USE_HARDWARE 1
96 #endif
97 
106 #ifndef CORE_TX_QUEUE_BUFFER_SIZE_ORIGINATOR
107 #define CORE_TX_QUEUE_BUFFER_SIZE_ORIGINATOR 256
108 #endif
109 
111 #ifndef CORE_TX_QUEUE_BUFFER_SIZE_RELAY
112 #define CORE_TX_QUEUE_BUFFER_SIZE_RELAY 128
113 #endif
114 
116 #ifndef CORE_TX_QUEUE_BUFFER_SIZE_INSTABURST_ORIGINATOR
117 #define CORE_TX_QUEUE_BUFFER_SIZE_INSTABURST_ORIGINATOR 4096
118 #endif
119 
121 #ifndef CORE_TX_QUEUE_BUFFER_SIZE_INSTABURST_RELAY
122 #define CORE_TX_QUEUE_BUFFER_SIZE_INSTABURST_RELAY 2048
123 #endif
124 
126 #ifndef CORE_TX_INSTABURST_CHANNELS
127 #define CORE_TX_INSTABURST_CHANNELS \
128  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, \
129  19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36}
130 #endif
131 
133 #ifndef CORE_TX_REPEAT_ORIGINATOR_DEFAULT
134 #define CORE_TX_REPEAT_ORIGINATOR_DEFAULT 1
135 #endif
136 
138 #ifndef CORE_TX_REPEAT_RELAY_DEFAULT
139 #define CORE_TX_REPEAT_RELAY_DEFAULT 1
140 #endif
141 
143 #ifndef MESH_FEATURE_RELAY_ENABLED
144 #define MESH_FEATURE_RELAY_ENABLED (1)
145 #endif
146 
155 #ifndef CCM_DEBUG_MODE_ENABLED
156 #define CCM_DEBUG_MODE_ENABLED 0
157 #endif
158 
170 #ifndef FIFO_STATS
171 #define FIFO_STATS 0
172 #endif
173 
186 #ifndef INTERNAL_EVT_ENABLE
187 #define INTERNAL_EVT_ENABLE 0
188 #endif
189 
191 #ifndef INTERNAL_EVENT_BUFFER_SIZE
192 #define INTERNAL_EVENT_BUFFER_SIZE 32
193 #endif
194 
203 #ifndef NRF_MESH_LOG_ENABLE
204 #define NRF_MESH_LOG_ENABLE 1
205 #endif
206 
208 #ifndef LOG_LEVEL_DEFAULT
209 #define LOG_LEVEL_DEFAULT LOG_LEVEL_WARN
210 #endif
211 
213 #ifndef LOG_MSK_DEFAULT
214 #define LOG_MSK_DEFAULT LOG_GROUP_STACK
215 #endif
216 
218 #ifndef LOG_ENABLE_RTT
219 #define LOG_ENABLE_RTT 1
220 #endif
221 
223 #ifndef LOG_CALLBACK_DEFAULT
224 #if defined(NRF51) || defined(NRF52_SERIES)
225  #define LOG_CALLBACK_DEFAULT log_callback_rtt
226 #else
227  #define LOG_CALLBACK_DEFAULT log_callback_stdout
228 #endif
229 #endif
230 
239 #ifndef MSG_CACHE_ENTRY_COUNT
240 #define MSG_CACHE_ENTRY_COUNT 32
241 #endif
242 
254 #ifndef NETWORK_SEQNUM_IV_UPDATE_START_THRESHOLD
255 #define NETWORK_SEQNUM_IV_UPDATE_START_THRESHOLD (NETWORK_SEQNUM_MAX / 2)
256 #endif
257 
262 #ifndef NETWORK_SEQNUM_IV_UPDATE_END_THRESHOLD
263 #define NETWORK_SEQNUM_IV_UPDATE_END_THRESHOLD (NETWORK_SEQNUM_MAX - TRANSPORT_SAR_SEQNUM_DIFF_MAX)
264 #endif
265 
266 /* Sanity check for NETWORK_SEQNUM_IV_UPDATE_END_THRESHOLD */
267 #if NETWORK_SEQNUM_IV_UPDATE_START_THRESHOLD > NETWORK_SEQNUM_IV_UPDATE_END_THRESHOLD
268 #error "The network sequence number start threshold must be lower than the end threshold."
269 #endif
270 #if NETWORK_SEQNUM_IV_UPDATE_END_THRESHOLD > (NETWORK_SEQNUM_MAX - TRANSPORT_SAR_SEQNUM_DIFF_MAX)
271 #error "The network sequence number IV update threshold must be low enough to fit a full SAR session."
272 #endif
273 
280 #ifndef NETWORK_SEQNUM_FLASH_BLOCK_SIZE
281 #define NETWORK_SEQNUM_FLASH_BLOCK_SIZE 8192ul
282 #endif
283 
288 #ifndef NETWORK_SEQNUM_FLASH_BLOCK_THRESHOLD
289 #define NETWORK_SEQNUM_FLASH_BLOCK_THRESHOLD 64
290 #endif
291 
295 #ifndef NET_FLASH_PAGE_COUNT
296 #define NET_FLASH_PAGE_COUNT 1
297 #endif
298 
310 #ifndef TRANSPORT_SAR_SESSIONS_MAX
311 #define TRANSPORT_SAR_SESSIONS_MAX (4)
312 #endif
313 
315 #ifndef TRANSPORT_SAR_RX_CACHE_LEN
316 #define TRANSPORT_SAR_RX_CACHE_LEN (8)
317 #endif
318 
320 #ifndef TRANSPORT_SAR_SEGACK_TTL_DEFAULT
321 #define TRANSPORT_SAR_SEGACK_TTL_DEFAULT (8)
322 #endif
323 
342 #ifndef PACKET_MGR_DEBUG_MODE
343 #define PACKET_MGR_DEBUG_MODE 0
344 #endif
345 
346 
352 #ifndef PACKET_MGR_MEMORY_POOL_SIZE
353 #define PACKET_MGR_MEMORY_POOL_SIZE 4096
354 #endif
355 
365 #ifndef PACKET_MGR_BLAME_MODE
366 #define PACKET_MGR_BLAME_MODE 0
367 #endif
368 
383 #ifndef PACKET_BUFFER_DEBUG_MODE
384 #define PACKET_BUFFER_DEBUG_MODE 0
385 #endif
386 
408 #ifndef REPLAY_CACHE_ENTRIES
409 #define REPLAY_CACHE_ENTRIES 40
410 #endif
411 
420 #ifndef FLASH_MANAGER_PAGE_COUNT_MAX
421 #define FLASH_MANAGER_PAGE_COUNT_MAX 255
422 #endif
423 
425 #ifndef FLASH_MANAGER_POOL_SIZE
426 #define FLASH_MANAGER_POOL_SIZE 256
427 #endif
428 
430 #ifndef FLASH_MANAGER_ENTRY_MAX_SIZE
431 #define FLASH_MANAGER_ENTRY_MAX_SIZE 128
432 #endif
433 
437 #ifndef FLASH_MANAGER_RECOVERY_PAGE_OFFSET_PAGES
438 #define FLASH_MANAGER_RECOVERY_PAGE_OFFSET_PAGES 0
439 #endif
440 
449 #ifndef MESH_FEATURE_GATT_PROXY_ENABLED
450 #define MESH_FEATURE_GATT_PROXY_ENABLED 0
451 #endif
452 
454 #ifndef MESH_GATT_PROXY_FILTER_ADDR_COUNT
455 #define MESH_GATT_PROXY_FILTER_ADDR_COUNT 32
456 #endif
457 
461 #ifndef MESH_GATT_PROXY_NETWORK_ID_ADV_INT_MS
462 #define MESH_GATT_PROXY_NETWORK_ID_ADV_INT_MS 2000
463 #endif
464 
472 #ifndef MESH_GATT_PROXY_NODE_IDENTITY_ADV_INT_MS
473 #define MESH_GATT_PROXY_NODE_IDENTITY_ADV_INT_MS 200
474 #endif
475 
482 #ifndef MESH_GATT_PROXY_NODE_IDENTITY_DURATION_MS
483 #define MESH_GATT_PROXY_NODE_IDENTITY_DURATION_MS 60000
484 #endif
485 
487 #ifndef MESH_GATT_PROXY_BEACON_CACHE_SIZE
488 #define MESH_GATT_PROXY_BEACON_CACHE_SIZE 8
489 #endif
490 
505 #ifndef ACCESS_MODEL_PUBLISH_PERIOD_RESTORE
506 #define ACCESS_MODEL_PUBLISH_PERIOD_RESTORE 0
507 #endif
508 
509 
518 #ifndef FSM_DEBUG
519 #define FSM_DEBUG (0)
520 #endif
521 
530 #ifndef MESH_FEATURE_LPN_ENABLED
531 #define MESH_FEATURE_LPN_ENABLED 0
532 #endif
533 
542 #ifndef MESH_FEATURE_LPN_ACT_AS_REGULAR_NODE_OUT_OF_FRIENDSHIP
543 #define MESH_FEATURE_LPN_ACT_AS_REGULAR_NODE_OUT_OF_FRIENDSHIP 0
544 #endif
545 
547 #ifndef MESH_FEATURE_FRIEND_ENABLED
548 #define MESH_FEATURE_FRIEND_ENABLED 0
549 #endif
550 
552 #ifndef MESH_FRIEND_FRIENDSHIP_COUNT
553 #define MESH_FRIEND_FRIENDSHIP_COUNT 2
554 #endif
555 
557 #ifndef MESH_FRIEND_SUBLIST_SIZE
558 #define MESH_FRIEND_SUBLIST_SIZE 16
559 #endif
560 
562 #ifndef MESH_FRIEND_QUEUE_SIZE
563 #define MESH_FRIEND_QUEUE_SIZE 16
564 #endif
565 
570 #endif