NimBLE-Arduino
2.3.0
Loading...
Searching...
No Matches
nimconfig.h
1
#pragma once
2
3
#ifdef ESP_PLATFORM
4
#include "sdkconfig.h"
5
#else
6
#include "ext_nimble_config.h"
7
/* Clear redefinition warnings */
8
#undef CONFIG_BT_NIMBLE_ROLE_CENTRAL
9
#undef CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
10
#undef CONFIG_BT_NIMBLE_ROLE_BROADCASTER
11
#undef CONFIG_BT_NIMBLE_ROLE_OBSERVER
12
#endif
13
14
#include "nimconfig_rename.h"
15
16
/***********************************************
17
* Arduino user-config options start here
18
**********************************************/
19
21
// #define CONFIG_BT_NIMBLE_MAX_CONNECTIONS 3
22
29
// #define CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED 0
30
37
// #define CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH 20
38
39
40
/****************************************************
41
* Extended advertising settings *
42
* NOT FOR USE WITH ORIGINAL ESP32 *
43
***************************************************/
44
46
// #define CONFIG_BT_NIMBLE_EXT_ADV 1
47
49
// #define CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES 1
50
52
// #define CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN 251
53
55
// #define CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV 1
56
58
// #define CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS 1
59
60
/****************************************************
61
* END Extended advertising settings *
62
***************************************************/
63
64
66
// #define CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU 255
67
69
// #define CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME "nimble"
70
75
// #define CONFIG_BT_NIMBLE_LOG_LEVEL 5
76
81
// #define CONFIG_NIMBLE_CPP_LOG_LEVEL 0
82
84
// #define CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED 1
85
89
// #define CONFIG_NIMBLE_CPP_ENABLE_RETURN_CODE_TEXT
90
94
// #define CONFIG_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT
95
99
// #define CONFIG_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT
100
102
// #define CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE 0x0
103
107
// #define CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
108
112
// #define CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED
113
117
// #define CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED
118
122
// #define CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED
123
125
// #define CONFIG_BT_NIMBLE_MAX_BONDS 3
126
128
// #define CONFIG_BT_NIMBLE_MAX_CCCDS 8
129
131
// #define CONFIG_BT_NIMBLE_RPA_TIMEOUT 900
132
139
// #define CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT 12
140
142
// #define CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL 1
143
145
// #define CONFIG_BT_NIMBLE_PINNED_TO_CORE 0
146
148
// #define CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE 4096
149
154
// #define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 1
155
161
// #define CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT 31
162
166
// #define CONFIG_NIMBLE_CPP_ADDR_FMT_EXCLUDE_DELIMITER 1
167
171
// #define CONFIG_NIMBLE_CPP_ADDR_FMT_UPPERCASE 1
172
177
// #define CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS 1
178
179
/**********************************
180
End Arduino user-config
181
**********************************/
182
183
/* This section should not be altered */
184
#ifndef CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
185
#define CONFIG_BT_NIMBLE_ROLE_CENTRAL 1
186
#endif
187
188
#ifndef CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED
189
#define CONFIG_BT_NIMBLE_ROLE_OBSERVER 1
190
#endif
191
192
#ifndef CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED
193
#define CONFIG_BT_NIMBLE_ROLE_PERIPHERAL 1
194
#endif
195
196
#ifndef CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED
197
#define CONFIG_BT_NIMBLE_ROLE_BROADCASTER 1
198
#endif
199
200
#ifndef CONFIG_BT_NIMBLE_PINNED_TO_CORE
201
#define CONFIG_BT_NIMBLE_PINNED_TO_CORE 0
202
#endif
203
204
#ifndef CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE
205
#define CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE 4096
206
#endif
207
208
#ifndef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL
209
#define CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
210
#endif
211
212
#ifndef CONFIG_BT_NIMBLE_MAX_CONNECTIONS
213
#define CONFIG_BT_NIMBLE_MAX_CONNECTIONS 3
214
#endif
215
216
#ifndef CONFIG_BT_NIMBLE_MAX_BONDS
217
#define CONFIG_BT_NIMBLE_MAX_BONDS 3
218
#endif
219
220
#ifndef CONFIG_BT_NIMBLE_MAX_CCCDS
221
#define CONFIG_BT_NIMBLE_MAX_CCCDS 8
222
#endif
223
224
#ifndef CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME
225
#define CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME "nimble"
226
#endif
227
228
#ifndef CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU
229
#define CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU 255
230
#endif
231
232
#ifndef CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE
233
#define CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE 0x0
234
#endif
235
236
#ifdef CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT
// backward compatibility
237
#define CONFIG_BT_NIMBLE_MSYS_1_BLOCK_COUNT CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT
238
#elif !defined(CONFIG_BT_NIMBLE_MSYS_1_BLOCK_COUNT)
239
#define CONFIG_BT_NIMBLE_MSYS_1_BLOCK_COUNT 12
240
#endif
241
242
#ifndef CONFIG_BT_NIMBLE_MSYS_1_BLOCK_SIZE
243
#define CONFIG_BT_NIMBLE_MSYS_1_BLOCK_SIZE 256
244
#endif
245
246
#ifndef CONFIG_BT_NIMBLE_RPA_TIMEOUT
247
#define CONFIG_BT_NIMBLE_RPA_TIMEOUT 900
248
#endif
249
250
#ifndef CONFIG_BT_NIMBLE_LOG_LEVEL
251
#define CONFIG_BT_NIMBLE_LOG_LEVEL 5
252
#endif
253
254
#ifndef CONFIG_NIMBLE_STACK_USE_MEM_POOLS
255
#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
256
#endif
257
259
#ifndef CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM
260
#define CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM 0
261
#endif
262
264
#define CONFIG_BT_NIMBLE_NVS_PERSIST 1
265
267
#define CONFIG_BT_NIMBLE_SM_LEGACY 1
268
270
#define CONFIG_BT_NIMBLE_SM_SC 1
271
273
#define CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN 31
274
276
#define CONFIG_BT_NIMBLE_TRANSPORT_ACL_FROM_LL_COUNT 12
277
279
#define CONFIG_BT_NIMBLE_TRANSPORT_ACL_SIZE 255
280
282
#if CONFIG_BT_NIMBLE_EXT_ADV
283
# define CONFIG_BT_NIMBLE_TRANSPORT_EVT_SIZE 257
284
#else
285
# define CONFIG_BT_NIMBLE_TRANSPORT_EVT_SIZE 70
286
#endif
287
289
#define CONFIG_BT_NIMBLE_TRANSPORT_EVT_COUNT 30
290
292
#define CONFIG_BT_NIMBLE_TRANSPORT_EVT_DISCARD_COUNT 8
293
294
#define CONFIG_BT_NIMBLE_L2CAP_COC_SDU_BUFF_COUNT 1
295
#define CONFIG_BT_NIMBLE_EATT_CHAN_NUM 0
296
#define CONFIG_BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION -1
297
#define CONFIG_BT_NIMBLE_GATT_MAX_PROCS 4
298
#define CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS 2000
299
300
#ifndef CONFIG_BT_ENABLED
301
#define CONFIG_BT_ENABLED
302
#endif
303
304
#ifndef CONFIG_BT_NIMBLE_ENABLED
305
#define CONFIG_BT_NIMBLE_ENABLED 1
306
#endif
307
308
#ifndef CONFIG_BT_CONTROLLER_ENABLED
309
#define CONFIG_BT_CONTROLLER_ENABLED 1
310
#endif
311
312
#ifndef CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS
313
#define CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS 0
314
#endif
315
316
#ifndef MYNEWT_VAL_BLE_CRYPTO_STACK_MBEDTLS
317
#define MYNEWT_VAL_BLE_CRYPTO_STACK_MBEDTLS (CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS)
318
#endif
319
320
#ifdef ESP_PLATFORM
321
#ifndef CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
322
#define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
323
#endif
324
325
#ifndef CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE
326
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE 0
327
#endif
328
329
#ifndef CONFIG_BTDM_SCAN_DUPL_TYPE_DATA
330
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA 1
331
#endif
332
333
#ifndef CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE
334
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE 2
335
#endif
336
337
#if !defined(CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE) && defined(CONFIG_IDF_TARGET_ESP32) || \
338
defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3)
339
#define CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE 1
340
#endif
341
342
#ifdef CONFIG_IDF_TARGET_ESP32
343
#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL 1
344
#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL_ITVL 1000
345
#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL_THRESH 2
346
#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL_TX_ON_DISCONNECT 1
347
#endif
348
349
#if !defined(CONFIG_BT_CONTROLLER_DISABLED)
350
#define CONFIG_BT_CONTROLLER_DISABLED 0
351
#endif
352
353
#if CONFIG_BT_NIMBLE_EXT_ADV || CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV
354
# if defined(CONFIG_IDF_TARGET_ESP32)
355
# error Extended advertising is not supported on ESP32.
356
# endif
357
#endif
358
359
#ifndef CONFIG_BT_NIMBLE_USE_ESP_TIMER
360
#define CONFIG_BT_NIMBLE_USE_ESP_TIMER 1
361
#endif
362
363
#ifndef CONFIG_BT_NIMBLE_WHITELIST_SIZE
364
#define CONFIG_BT_NIMBLE_WHITELIST_SIZE 12
365
#endif
366
367
#endif
// ESP_PLATFORM
368
369
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
370
# error Extended advertising must be enabled to use periodic advertising.
371
#endif
372
373
/* Must have max instances and data length set if extended advertising is enabled */
374
#if CONFIG_BT_NIMBLE_EXT_ADV
375
# if !defined(CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES)
376
# define CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES 1
377
# endif
378
# if !defined(CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN)
379
# define CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN 251
380
# endif
381
#endif
382
383
/* Must set max number of syncs if periodic advertising is enabled */
384
#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !defined(CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS)
385
# define CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS 1
386
#endif
387
388
/* Cannot use client without scan */
389
#if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL) && !defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
390
#define CONFIG_BT_NIMBLE_ROLE_OBSERVER
391
#endif
392
393
/* Cannot use server without advertise */
394
#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) && !defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
395
#define CONFIG_BT_NIMBLE_ROLE_BROADCASTER
396
#endif
397
398
/* Enables the use of Arduino String class for attribute values */
399
#if defined __has_include
400
# if __has_include (<Arduino.h>)
401
# define NIMBLE_CPP_ARDUINO_STRING_AVAILABLE
402
# endif
403
#endif
404
405
#ifndef CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED
406
#define CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED 0
407
#endif
408
409
#ifndef CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT
410
#define CONFIG_NIMBLE_CPP_FREERTOS_TASK_BLOCK_BIT 31
411
#endif
412
413
#if CONFIG_NIMBLE_CPP_DEBUG_ASSERT_ENABLED && !defined NDEBUG
414
void
nimble_cpp_assert(
const
char
*file,
unsigned
line) __attribute((weak, noreturn));
415
# define NIMBLE_ATT_VAL_FILE (__builtin_strrchr(__FILE__, '/') ? \
416
__builtin_strrchr (__FILE__, '/') + 1 : __FILE__)
417
# define NIMBLE_CPP_DEBUG_ASSERT(cond) \
418
if (!(cond)) { \
419
nimble_cpp_assert(NIMBLE_ATT_VAL_FILE, __LINE__); \
420
}
421
#else
422
# define NIMBLE_CPP_DEBUG_ASSERT(cond) (void(0))
423
#endif
src
nimconfig.h
Generated by
1.9.8