nRF5 SDK for Mesh v2.2.0
nrf_mesh_defines.h
1 /* Copyright (c) 2010 - 2018, 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_UNSEG_PAYLOAD_SIZE_MAX (11)
69 
71 #define NRF_MESH_ADV_CHAN_ALL {37, 38, 39}
72 
74 #define NRF_MESH_ADV_CHAN_DEFAULT NRF_MESH_ADV_CHAN_ALL
75 
77 #define NRF_MESH_KEY_SIZE (16)
78 
80 #define NRF_MESH_NETID_SIZE (8)
81 
83 #define NRF_MESH_UUID_SIZE (16)
84 
86 #define NRF_MESH_TTL_BIT_COUNT (7)
87 
89 #define NRF_MESH_TTL_MAX ((1 << NRF_MESH_TTL_BIT_COUNT) - 1)
90 
92 #define NRF_MESH_GLOBAL_KEY_INDEX_MAX (0xFFF)
93 
95 #define NRF_MESH_BEACON_SECURE_NET_BCAST_INTERVAL_SECONDS 10
96 
98 #define NRF_MESH_BEACON_OBSERVATION_PERIODS 2
99 
101 #define NRF_MESH_BEACON_UNPROV_URI_HASH_SIZE (4)
102 
104 #define NRF_MESH_ECDH_PUBLIC_KEY_SIZE (64)
105 
107 #define NRF_MESH_ECDH_PRIVATE_KEY_SIZE (32)
108 
110 #define NRF_MESH_ECDH_SHARED_SECRET_SIZE (32)
111 
113 #define NRF_MESH_ADDR_UNASSIGNED (0x0000)
114 
116 #define NRF_MESH_ALL_PROXIES_ADDR (0xFFFC)
117 
119 #define NRF_MESH_ALL_FRIENDS_ADDR (0xFFFD)
120 
122 #define NRF_MESH_ALL_RELAYS_ADDR (0xFFFE)
123 
125 #define NRF_MESH_ALL_NODES_ADDR (0xFFFF)
126 
128 #define NRF_MESH_ADDR_TYPE_BITS_OFFSET (14)
129 
131 #define NRF_MESH_ADDR_TYPE_BITS_MASK (0xC000)
132 
134 #if defined(NRF51)
135 #define NRF_MESH_IRQ_PRIORITY_THREAD (4)
136 #else
137 #define NRF_MESH_IRQ_PRIORITY_THREAD (15)
138 #endif
139 
141 #if defined(NRF51)
142 #define NRF_MESH_IRQ_PRIORITY_LOWEST (3)
143 #else
144 #define NRF_MESH_IRQ_PRIORITY_LOWEST (7)
145 #endif
146 
155 #define NETWORK_SEQNUM_BITS 24
156 
158 #define NETWORK_SEQNUM_MAX ((1 << NETWORK_SEQNUM_BITS) - 1)
159 
161 #define NETWORK_RELAY_RETRANSMITS_MAX ((1 << 3) - 1)
162 
164 #define NETWORK_RELAY_INTERVAL_STEPS_MAX ((1 << 5) - 1)
165 
167 #define NETWORK_RELAY_INTERVAL_MAX_MS (NETWORK_RELAY_INTERVAL_STEPS_MAX * 10)
168 
170 #define NETWORK_MIN_IV_UPDATE_INTERVAL_MINUTES (96 * 60)
171 
173 #define NETWORK_IV_RECOVERY_LIMIT 42
174 
176 #define NETWORK_BEARER BEARER_ADV_RADIO
177 
186 #define TRANSPORT_SAR_RX_TIMEOUT_MIN MS_TO_US(10000)
187 
188 #define TRANSPORT_SAR_RX_TIMEOUT_MAX MS_TO_US(120000)
189 
191 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_BASE_MIN MS_TO_US(150)
192 
193 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_BASE_MAX MS_TO_US(10000)
194 
196 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_PER_HOP_ADDITION_MIN MS_TO_US(50)
197 
198 #define TRANSPORT_SAR_RX_ACK_TIMEOUT_PER_HOP_ADDITION_MAX MS_TO_US(10000)
199 
201 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_BASE_MIN MS_TO_US(200)
202 
203 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_BASE_MAX MS_TO_US(10000)
204 
206 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_PER_HOP_ADDITION_MIN MS_TO_US(200)
207 
208 #define TRANSPORT_SAR_TX_RETRY_TIMEOUT_PER_HOP_ADDITION_MAX MS_TO_US(10000)
209 
211 #define TRANSPORT_SAR_TX_TIMEOUT_MIN MS_TO_US(150)
212 
213 #define TRANSPORT_SAR_TX_TIMEOUT_MAX MS_TO_US(60000)
214 
216 #define TRANSPORT_SAR_TX_RETRIES_MIN (2)
217 
218 #define TRANSPORT_SAR_TX_RETRIES_MAX (255)
219 
222 #define TRANSPORT_SAR_SEQNUM_DIFF_MAX (8191)
223 
232 #define HEARTBEAT_TRIGGER_TYPE_RELAY 0x0001
233 
234 #define HEARTBEAT_TRIGGER_TYPE_PROXY 0x0002
235 
236 #define HEARTBEAT_TRIGGER_TYPE_FRIEND 0x0004
237 
238 #define HEARTBEAT_TRIGGER_TYPE_LPN 0x0008
239 
240 #define HEARTBEAT_TRIGGER_TYPE_RFU_MASK 0x000F
241 
246 #endif /* NRF_MESH_DEFINES_H__ */

Documentation feedback | Developer Zone | Subscribe | Updated