nRF5 SDK for Mesh v5.0.0
nrf_mesh_defines.h
1 /* Copyright (c) 2010 - 2020, 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_DEFINES_H__
39 #define NRF_MESH_DEFINES_H__
40 
50 /* Check platform defines */
51 #if defined(NRF51)
52  #if defined(NRF52_SERIES)
53  #error "Both NRF51 and NRF52_SERIES should not be defined."
54  #endif
55 #elif !defined(NRF52_SERIES) && !defined(HOST)
56  #error "At least NRF51, NRF52_SERIES or HOST must be defined."
57 #endif
58 
65 #define NRF_MESH_SEG_PAYLOAD_SIZE_MAX (380)
66 
68 #define NRF_MESH_UPPER_TRANSPORT_PDU_SIZE_MAX (384)
69 
71 #define NRF_MESH_UNSEG_PAYLOAD_SIZE_MAX (11)
72 
74 #define NRF_MESH_ADV_CHAN_ALL {37, 38, 39}
75 
77 #define NRF_MESH_ADV_CHAN_DEFAULT NRF_MESH_ADV_CHAN_ALL
78 
80 #define NRF_MESH_KEY_SIZE (16)
81 
83 #define NRF_MESH_NETID_SIZE (8)
84 
86 #define NRF_MESH_UUID_SIZE (16)
87 
89 #define NRF_MESH_TTL_BIT_COUNT (7)
90 
92 #define NRF_MESH_TTL_MAX ((1 << NRF_MESH_TTL_BIT_COUNT) - 1)
93 
95 #define NRF_MESH_GLOBAL_KEY_INDEX_MAX (0xFFF)
96 
98 #define NRF_MESH_BEACON_SECURE_NET_BCAST_INTERVAL_SECONDS 10
99 
101 #define NRF_MESH_BEACON_OBSERVATION_PERIODS 2
102 
104 #define NRF_MESH_BEACON_UNPROV_URI_HASH_SIZE (4)
105 
107 #define NRF_MESH_ECDH_PUBLIC_KEY_SIZE (64)
108 
110 #define NRF_MESH_ECDH_PRIVATE_KEY_SIZE (32)
111 
113 #define NRF_MESH_ECDH_SHARED_SECRET_SIZE (32)
114 
116 #define NRF_MESH_ADDR_UNASSIGNED (0x0000)
117 
119 #define NRF_MESH_ALL_PROXIES_ADDR (0xFFFC)
120 
122 #define NRF_MESH_ALL_FRIENDS_ADDR (0xFFFD)
123 
125 #define NRF_MESH_ALL_RELAYS_ADDR (0xFFFE)
126 
128 #define NRF_MESH_ALL_NODES_ADDR (0xFFFF)
129 
131 #define NRF_MESH_ADDR_TYPE_BITS_OFFSET (14)
132 
134 #define NRF_MESH_ADDR_TYPE_BITS_MASK (0xC000)
135 
137 #if defined(NRF51)
138 #define NRF_MESH_IRQ_PRIORITY_THREAD (4)
139 #else
140 #define NRF_MESH_IRQ_PRIORITY_THREAD (15)
141 #endif
142 
144 #if defined(NRF51)
145 #define NRF_MESH_IRQ_PRIORITY_LOWEST (3)
146 #else
147 #define NRF_MESH_IRQ_PRIORITY_LOWEST (6)
148 #endif
149 
158 #define NETWORK_SEQNUM_BITS 24
159 
161 #define NETWORK_SEQNUM_MAX ((1 << NETWORK_SEQNUM_BITS) - 1)
162 
164 #define NETWORK_RELAY_RETRANSMITS_MAX ((1 << 3) - 1)
165 
167 #define NETWORK_RELAY_INTERVAL_STEPS_MAX ((1 << 5) - 1)
168 
170 #define NETWORK_RELAY_INTERVAL_MAX_MS ((NETWORK_RELAY_INTERVAL_STEPS_MAX + 1) * 10)
171 
173 #define NETWORK_MIN_IV_UPDATE_INTERVAL_MINUTES (96 * 60)
174 
176 #define NETWORK_IV_RECOVERY_LIMIT 42
177 
179 #define NETWORK_BEARER BEARER_ADV_RADIO
180 
189 #define TRANSPORT_SAR_RX_TIMEOUT_MIN MS_TO_US(10000)
190 
191 #define TRANSPORT_SAR_RX_TIMEOUT_MAX MS_TO_US(120000)
192 
194 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_BASE_MIN MS_TO_US(150)
195 
196 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_BASE_MAX MS_TO_US(10000)
197 
199 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_PER_HOP_ADDITION_MIN MS_TO_US(50)
200 
201 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_PER_HOP_ADDITION_MAX MS_TO_US(10000)
202 
204 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_BASE_MIN MS_TO_US(200)
205 
206 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_BASE_MAX MS_TO_US(10000)
207 
209 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_PER_HOP_ADDITION_MIN MS_TO_US(200)
210 
211 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_PER_HOP_ADDITION_MAX MS_TO_US(10000)
212 
214 #define TRANSPORT_SAR_TX_TIMEOUT_MIN MS_TO_US(150)
215 
216 #define TRANSPORT_SAR_TX_TIMEOUT_MAX MS_TO_US(60000)
217 
219 #define TRANSPORT_SAR_TX_RETRIES_MIN (2)
220 
221 #define TRANSPORT_SAR_TX_RETRIES_MAX (255)
222 
225 #define TRANSPORT_SAR_SEQNUM_DIFF_MAX (8191)
226 
235 #define HEARTBEAT_TRIGGER_TYPE_RELAY 0x0001
236 
237 #define HEARTBEAT_TRIGGER_TYPE_PROXY 0x0002
238 
239 #define HEARTBEAT_TRIGGER_TYPE_FRIEND 0x0004
240 
241 #define HEARTBEAT_TRIGGER_TYPE_LPN 0x0008
242 
243 #define HEARTBEAT_TRIGGER_TYPE_RFU_MASK 0x000F
244 
249 #endif /* NRF_MESH_DEFINES_H__ */

Documentation feedback | Developer Zone | Subscribe | Updated