1 /*
2  * Copyright (C) 2019-2020 Alibaba Group Holding Limited
3  */
4 
5 #ifndef _BLE_MESH_DEFAULT_CONFIG_H_
6 #define _BLE_MESH_DEFAULT_CONFIG_H_
7 
8 #ifdef CONFIG_BT
9 
10 #ifdef CONFIG_BT_HCI
11 
12 #if !defined(CONFIG_BT_OBSERVER) || !defined(CONFIG_BT_BROADCASTER)
13 #error "CONFIG_BT_OBSERVER || CONFIG_BT_BROADCASTER not defined!"
14 #endif
15 
16 #ifndef CONFIG_BT_MESH
17 #define CONFIG_BT_MESH 1
18 #endif
19 
20 #ifdef CONFIG_BT_MESH
21 
22 #ifndef CONFIG_BT_MESH_PB_ADV
23 #define CONFIG_BT_MESH_PB_ADV 1
24 #endif
25 
26 #ifndef CONFIG_BT_MESH_PROV
27 #ifdef CONFIG_BT_MESH_PB_ADV
28 #define CONFIG_BT_MESH_PROV 1
29 #endif
30 #endif
31 
32 #ifdef CONFIG_BT_CONN
33 
34 #ifndef CONFIG_BT_MESH_PB_GATT
35 //#define CONFIG_BT_MESH_PB_GATT 1
36 #endif
37 
38 #ifndef CONFIG_BT_MESH_PROXY
39 #ifdef CONFIG_BT_MESH_PB_GATT
40 #define CONFIG_BT_MESH_PROXY 1
41 #endif
42 #endif
43 
44 #ifndef CONFIG_BT_MESH_PROV
45 #ifdef CONFIG_BT_MESH_PB_GATT
46 #define CONFIG_BT_MESH_PROV 1
47 #endif
48 #endif
49 
50 #ifndef CONFIG_BT_MESH_GATT_PROXY
51 // #define CONFIG_BT_MESH_GATT_PROXY 1
52 #endif
53 
54 #ifndef CONFIG_BT_PERIPHERAL
55 #ifdef CONFIG_BT_MESH_GATT_PROXY
56 #define CONFIG_BT_PERIPHERAL 1
57 #endif
58 #endif
59 
60 #ifndef CONFIG_BT_MESH_PROXY
61 #ifdef CONFIG_BT_MESH_GATT_PROXY
62 #define CONFIG_BT_MESH_PROXY 1
63 #endif
64 #endif
65 
66 #ifndef CONFIG_BT_MESH_NODE_ID_TIMEOUT
67 #ifdef CONFIG_BT_MESH_GATT_PROXY
68 #define CONFIG_BT_MESH_NODE_ID_TIMEOUT 60
69 #endif
70 #endif
71 
72 #ifdef CONFIG_BT_MESH_PROXY
73 
74 #ifndef CONFIG_BT_MESH_PROXY_FILTER_SIZE
75 
76 #ifdef CONFIG_BT_MESH_GATT_PROXY
77 #define CONFIG_BT_MESH_PROXY_FILTER_SIZE 3
78 #else
79 #define CONFIG_BT_MESH_PROXY_FILTER_SIZE 1
80 #endif
81 
82 #endif //CONFIG_BT_MESH_PROXY_FILTER_SIZE
83 
84 #endif //CONFIG_BT_MESH_PROXY
85 
86 #endif //CONFIG_BT_CONN
87 
88 #ifndef CONFIG_BT_MESH_SELF_TEST
89 //#define CONFIG_BT_MESH_SELF_TEST 1
90 #endif
91 
92 #ifndef CONFIG_BT_MESH_IV_UPDATE_TEST
93 //#define CONFIG_BT_MESH_IV_UPDATE_TEST 1
94 #endif
95 
96 #ifndef CONFIG_BT_MESH_SUBNET_COUNT
97 #define CONFIG_BT_MESH_SUBNET_COUNT 1
98 #endif
99 
100 #ifndef CONFIG_BT_MESH_APP_KEY_COUNT
101 #define CONFIG_BT_MESH_APP_KEY_COUNT 1
102 #endif
103 
104 #ifndef CONFIG_BT_MESH_MODEL_KEY_COUNT
105 #define CONFIG_BT_MESH_MODEL_KEY_COUNT 1
106 #endif
107 
108 #ifndef CONFIG_BT_MESH_MODEL_GROUP_COUNT
109 #define CONFIG_BT_MESH_MODEL_GROUP_COUNT 1
110 #endif
111 
112 #ifndef CONFIG_BT_MESH_LABEL_COUNT
113 #define CONFIG_BT_MESH_LABEL_COUNT 1
114 #endif
115 
116 #ifndef CONFIG_BT_MESH_CRPL
117 #define CONFIG_BT_MESH_CRPL 10
118 #endif
119 
120 #ifndef CONFIG_BT_MESH_MSG_CACHE_SIZE
121 #define CONFIG_BT_MESH_MSG_CACHE_SIZE 10
122 #endif
123 
124 #ifndef CONFIG_BT_MESH_ADV_BUF_COUNT
125 #define CONFIG_BT_MESH_ADV_BUF_COUNT 9
126 #endif
127 
128 #ifndef CONFIG_BT_MESH_IVU_DIVIDER
129 #define CONFIG_BT_MESH_IVU_DIVIDER 4
130 #endif
131 
132 #ifndef CONFIG_BT_MESH_TX_SEG_MSG_COUNT
133 #define CONFIG_BT_MESH_TX_SEG_MSG_COUNT 1
134 #endif
135 
136 #ifndef CONFIG_BT_MESH_RX_SEG_MSG_COUNT
137 #define CONFIG_BT_MESH_RX_SEG_MSG_COUNT 1
138 #endif
139 
140 #ifndef CONFIG_BT_MESH_RX_SDU_MAX
141 #define CONFIG_BT_MESH_RX_SDU_MAX 72
142 #endif
143 
144 #ifndef CONFIG_BT_MESH_TX_SEG_MAX
145 #define CONFIG_BT_MESH_TX_SEG_MAX (CONFIG_BT_MESH_ADV_BUF_COUNT - 3)
146 #endif
147 
148 #ifndef CONFIG_BT_MESH_RELAY
149 // #define CONFIG_BT_MESH_RELAY 1
150 #endif
151 
152 #ifndef CONFIG_BT_MESH_LOW_POWER
153 // #define CONFIG_BT_MESH_LOW_POWER 1
154 #endif
155 
156 #ifdef CONFIG_BT_MESH_LOW_POWER
157 
158 #ifndef CONFIG_BT_MESH_LPN_ESTABLISHMENT
159 #define CONFIG_BT_MESH_LPN_ESTABLISHMENT 1
160 #endif
161 
162 #ifndef CONFIG_BT_MESH_LPN_AUTO
163 #define CONFIG_BT_MESH_LPN_AUTO 1
164 #endif
165 
166 #ifndef CONFIG_BT_MESH_LPN_AUTO_TIMEOUT
167 #ifdef CONFIG_BT_MESH_LPN_AUTO
168 #define CONFIG_BT_MESH_LPN_AUTO_TIMEOUT 15
169 #endif
170 #endif
171 
172 #ifndef CONFIG_BT_MESH_LPN_RETRY_TIMEOUT
173 #define CONFIG_BT_MESH_LPN_RETRY_TIMEOUT 8
174 #endif
175 
176 #ifndef CONFIG_BT_MESH_LPN_RSSI_FACTOR
177 #define CONFIG_BT_MESH_LPN_RSSI_FACTOR 0
178 #endif
179 
180 #ifndef CONFIG_BT_MESH_LPN_RECV_WIN_FACTOR
181 #define CONFIG_BT_MESH_LPN_RECV_WIN_FACTOR 0
182 #endif
183 
184 #ifndef CONFIG_BT_MESH_LPN_MIN_QUEUE_SIZE
185 #define CONFIG_BT_MESH_LPN_MIN_QUEUE_SIZE 1
186 #endif
187 
188 #ifndef CONFIG_BT_MESH_LPN_RECV_DELAY
189 #define CONFIG_BT_MESH_LPN_RECV_DELAY 100
190 #endif
191 
192 #ifndef CONFIG_BT_MESH_LPN_POLL_TIMEOUT
193 #define CONFIG_BT_MESH_LPN_POLL_TIMEOUT 300
194 #endif
195 
196 #ifndef CONFIG_BT_MESH_LPN_INIT_POLL_TIMEOUT
197 #define CONFIG_BT_MESH_LPN_INIT_POLL_TIMEOUT CONFIG_BT_MESH_LPN_POLL_TIMEOUT
198 #endif
199 
200 #ifndef CONFIG_BT_MESH_LPN_SCAN_LATENCY
201 #define CONFIG_BT_MESH_LPN_SCAN_LATENCY 10
202 #endif
203 
204 #ifndef CONFIG_BT_MESH_LPN_GROUPS
205 #define CONFIG_BT_MESH_LPN_GROUPS 8
206 #endif
207 
208 #endif //CONFIG_BT_MESH_LOW_POWER
209 
210 #ifndef CONFIG_BT_MESH_FRIEND
211 //#define CONFIG_BT_MESH_FRIEND 1
212 #endif
213 
214 #ifdef CONFIG_BT_MESH_FRIEND
215 
216 #ifndef CONFIG_BT_MESH_FRIEND_RECV_WIN
217 #define CONFIG_BT_MESH_FRIEND_RECV_WIN 255
218 #endif
219 
220 #ifndef CONFIG_BT_MESH_FRIEND_QUEUE_SIZE
221 #define CONFIG_BT_MESH_FRIEND_QUEUE_SIZE 16
222 #endif
223 
224 #ifndef CONFIG_BT_MESH_FRIEND_SUB_LIST_SIZE
225 #define CONFIG_BT_MESH_FRIEND_SUB_LIST_SIZE 3
226 #endif
227 
228 #ifndef CONFIG_BT_MESH_FRIEND_LPN_COUNT
229 #define CONFIG_BT_MESH_FRIEND_LPN_COUNT 2
230 #endif
231 
232 #ifndef CONFIG_BT_MESH_FRIEND_SEG_RX
233 #define CONFIG_BT_MESH_FRIEND_SEG_RX 1
234 #endif
235 
236 #endif //CONFIG_BT_MESH_FRIEND
237 
238 #ifndef CONFIG_BT_MESH_CFG_CLI
239 //#define CONFIG_BT_MESH_CFG_CLI 1
240 #endif
241 
242 #ifndef CONFIG_BT_MESH_HEALTH_CLI
243 //#define CONFIG_BT_MESH_HEALTH_CLI 1
244 #endif
245 
246 #ifndef CONFIG_BT_MESH_SHELL
247 //#define CONFIG_BT_MESH_SHELL 1
248 #endif
249 
250 #ifdef CONFIG_BT_SETTINGS
251 #ifndef CONFIG_BT_MESH_STORE_TIMEOUT
252 #define CONFIG_BT_MESH_STORE_TIMEOUT 2
253 #endif
254 
255 #ifndef CONFIG_BT_MESH_SEQ_STORE_RATE
256 #define CONFIG_BT_MESH_SEQ_STORE_RATE 128
257 #endif
258 
259 #ifndef CONFIG_BT_MESH_RPL_STORE_TIMEOUT
260 #define CONFIG_BT_MESH_RPL_STORE_TIMEOUT 5
261 #endif
262 
263 #endif // CONFIG_BT_SETTINGS
264 
265 #ifndef CONFIG_BT_MESH_DEBUG
266 // #define CONFIG_BT_MESH_DEBUG 1
267 #endif
268 
269 #ifdef CONFIG_BT_MESH_DEBUG
270 
271 #ifndef CONFIG_BT_MESH_DEBUG_USE_ID_ADDR
272 // #define CONFIG_BT_MESH_DEBUG_USE_ID_ADDR 1
273 #endif
274 
275 #ifndef CONFIG_BT_MESH_DEBUG_NET
276 // #define CONFIG_BT_MESH_DEBUG_NET 1
277 #endif
278 
279 #ifndef CONFIG_BT_MESH_DEBUG_TRANS
280 // #define CONFIG_BT_MESH_DEBUG_TRANS 1
281 #endif
282 
283 #ifndef CONFIG_BT_MESH_DEBUG_BEACON
284 // #define CONFIG_BT_MESH_DEBUG_BEACON 1
285 #endif
286 
287 #ifndef CONFIG_BT_MESH_DEBUG_BEACON
288 // #define CONFIG_BT_MESH_DEBUG_BEACON 1
289 #endif
290 
291 #ifndef CONFIG_BT_MESH_DEBUG_CRYPTO
292 // #define CONFIG_BT_MESH_DEBUG_CRYPTO 1
293 #endif
294 
295 #ifndef CONFIG_BT_MESH_DEBUG_PROV
296 // #define CONFIG_BT_MESH_DEBUG_PROV 1
297 #endif
298 
299 #ifndef CONFIG_BT_MESH_DEBUG_ACCESS
300 // #define CONFIG_BT_MESH_DEBUG_ACCESS 1
301 #endif
302 
303 #ifndef CONFIG_BT_MESH_DEBUG_MODEL
304 //#define CONFIG_BT_MESH_DEBUG_MODEL 1
305 #endif
306 
307 #ifndef CONFIG_BT_MESH_DEBUG_ADV
308 // #define CONFIG_BT_MESH_DEBUG_ADV 1
309 #endif
310 
311 #ifndef CONFIG_BT_MESH_DEBUG_LOW_POWER
312 // #define CONFIG_BT_MESH_DEBUG_LOW_POWER 1
313 #endif
314 
315 #ifndef CONFIG_BT_MESH_DEBUG_FRIEND
316 //#define CONFIG_BT_MESH_DEBUG_FRIEND 1
317 #endif
318 
319 #ifndef CONFIG_BT_MESH_DEBUG_PROXY
320 // #define CONFIG_BT_MESH_DEBUG_PROXY 1
321 #endif
322 
323 #ifndef CONFIG_BT_MESH_DEBUG_SETTINGS
324 // #define CONFIG_BT_MESH_DEBUG_SETTINGS 1
325 #endif
326 
327 #endif // CONFIG_BT_MESH_DEBUG
328 
329 #ifndef CONFIG_BT_MESH_PROVISIONER
330 // #define CONFIG_BT_MESH_PROVISIONER 1
331 #endif
332 
333 #ifdef CONFIG_BT_MESH_PROVISIONER
334 
335 #ifndef CONFIG_BT_MESH_PROVISIONER_APP_KEY_COUNT
336 #define CONFIG_BT_MESH_PROVISIONER_APP_KEY_COUNT 3
337 #endif
338 
339 #ifndef CONFIG_BT_MESH_PROVISIONER_SUBNET_COUNT
340 #define CONFIG_BT_MESH_PROVISIONER_SUBNET_COUNT 3
341 #endif
342 
343 #ifndef CONFIG_BT_MESH_MAX_PROV_NODES
344 #define CONFIG_BT_MESH_MAX_PROV_NODES 10
345 #endif
346 
347 #ifndef CONFIG_BT_MESH_MAX_STORED_NODES
348 #define CONFIG_BT_MESH_MAX_STORED_NODES 10
349 #endif
350 
351 #ifndef CONFIG_BT_CENTRAL
352 #define CONFIG_BT_CENTRAL 1
353 #endif
354 
355 #ifndef CONFIG_BT_GATT_CLIENT
356 #define CONFIG_BT_GATT_CLIENT 1
357 #endif
358 
359 #endif // CONFIG_BT_MESH_PROVISIONER
360 
361 #endif // CONFIG_BT_MESH
362 
363 #endif // CONFIG_BT_HCI
364 
365 #endif // CONFIG_BT
366 
367 #endif // _BLE_MESH_DEFAULT_CONFIG_H_
368