NimBLE-Arduino 1.4.2
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#endif
8
9#include "nimconfig_rename.h"
10
11/***********************************************
12 * Arduino user-config options start here
13 **********************************************/
14
16// #define CONFIG_BT_NIMBLE_MAX_CONNECTIONS 3
17
24// #define CONFIG_NIMBLE_CPP_ATT_VALUE_TIMESTAMP_ENABLED 0
25
32// #define CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH 20
33
34
35/****************************************************
36 * Extended advertising settings *
37 * For use with ESP32C3, ESP32S3, ESP32H2 ONLY! *
38 ***************************************************/
39
41// #define CONFIG_BT_NIMBLE_EXT_ADV 1
42
44// #define CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES 1
45
47// #define CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN 251
48
50// #define CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV 1
51
53// #define CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS 1
54
55/****************************************************
56 * END For use with ESP32C3, ESP32S3, ESP32H2 ONLY! *
57 ***************************************************/
58
59
61// #define CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU 255
62
64// #define CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME "nimble"
65
70 // #define CONFIG_BT_NIMBLE_LOG_LEVEL 5
71
76 // #define CONFIG_NIMBLE_CPP_LOG_LEVEL 0
77
81// #define CONFIG_NIMBLE_CPP_ENABLE_RETURN_CODE_TEXT
82
86// #define CONFIG_NIMBLE_CPP_ENABLE_GAP_EVENT_CODE_TEXT
87
91// #define CONFIG_NIMBLE_CPP_ENABLE_ADVERTISEMENT_TYPE_TEXT
92
94// #define CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE 0x0
95
99// #define CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
100
104// #define CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED
105
109// #define CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED
110
114// #define CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED
115
117// #define CONFIG_BT_NIMBLE_MAX_BONDS 3
118
120// #define CONFIG_BT_NIMBLE_MAX_CCCDS 8
121
123// #define CONFIG_BT_NIMBLE_RPA_TIMEOUT 900
124
131// #define CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT 12
132
134// #define CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL 1
135
137// #define CONFIG_BT_NIMBLE_PINNED_TO_CORE 0
138
140// #define CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE 4096
141
146// #define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 1
147
148/**********************************
149 End Arduino user-config
150**********************************/
151
152/* This section should not be altered */
153#ifndef CONFIG_BT_NIMBLE_ROLE_CENTRAL_DISABLED
154#define CONFIG_BT_NIMBLE_ROLE_CENTRAL
155#endif
156
157#ifndef CONFIG_BT_NIMBLE_ROLE_OBSERVER_DISABLED
158#define CONFIG_BT_NIMBLE_ROLE_OBSERVER
159#endif
160
161#ifndef CONFIG_BT_NIMBLE_ROLE_PERIPHERAL_DISABLED
162#define CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
163#endif
164
165#ifndef CONFIG_BT_NIMBLE_ROLE_BROADCASTER_DISABLED
166#define CONFIG_BT_NIMBLE_ROLE_BROADCASTER
167#endif
168
169#ifndef CONFIG_BT_NIMBLE_PINNED_TO_CORE
170#define CONFIG_BT_NIMBLE_PINNED_TO_CORE 0
171#endif
172
173#ifndef CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE
174#define CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE 4096
175#endif
176
177#ifndef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL
178#define CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL 1
179#endif
180
181#ifndef CONFIG_BT_NIMBLE_MAX_CONNECTIONS
182#define CONFIG_BT_NIMBLE_MAX_CONNECTIONS 3
183#endif
184
185#ifndef CONFIG_BT_NIMBLE_MAX_BONDS
186#define CONFIG_BT_NIMBLE_MAX_BONDS 3
187#endif
188
189#ifndef CONFIG_BT_NIMBLE_MAX_CCCDS
190#define CONFIG_BT_NIMBLE_MAX_CCCDS 8
191#endif
192
193#ifndef CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME
194#define CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME "nimble"
195#endif
196
197#ifndef CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU
198#define CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU 255
199#endif
200
201#ifndef CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE
202#define CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE 0x0
203#endif
204
205#ifndef CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT
206#define CONFIG_BT_NIMBLE_MSYS1_BLOCK_COUNT 12
207#endif
208
209#ifndef CONFIG_BT_NIMBLE_RPA_TIMEOUT
210#define CONFIG_BT_NIMBLE_RPA_TIMEOUT 900
211#endif
212
213#ifndef CONFIG_BT_NIMBLE_LOG_LEVEL
214#define CONFIG_BT_NIMBLE_LOG_LEVEL 5
215#endif
216
217#ifndef CONFIG_NIMBLE_STACK_USE_MEM_POOLS
218#define CONFIG_NIMBLE_STACK_USE_MEM_POOLS 0
219#endif
220
222#define CONFIG_BT_NIMBLE_NVS_PERSIST 1
223
225#define CONFIG_BT_NIMBLE_SM_LEGACY 1
226
228#define CONFIG_BT_NIMBLE_SM_SC 1
229
231#define CONFIG_BT_NIMBLE_GAP_DEVICE_NAME_MAX_LEN 31
232
234#define CONFIG_BT_NIMBLE_ACL_BUF_COUNT 12
235
237#define CONFIG_BT_NIMBLE_ACL_BUF_SIZE 255
238
240#if CONFIG_BT_NIMBLE_EXT_ADV || CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV
241# define CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE 257
242#else
243# define CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE 70
244#endif
245
247#define CONFIG_BT_NIMBLE_HCI_EVT_HI_BUF_COUNT 30
248
250#define CONFIG_BT_NIMBLE_HCI_EVT_LO_BUF_COUNT 8
251
253#define CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM 0
254
255#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL 1
256#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL_ITVL 1000
257#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL_THRESH 2
258#define CONFIG_BT_NIMBLE_HS_FLOW_CTRL_TX_ON_DISCONNECT 1
259
260#define CONFIG_BT_NIMBLE_HS_STOP_TIMEOUT_MS 2000
261
262#ifndef CONFIG_BT_ENABLED
263#define CONFIG_BT_ENABLED
264#endif
265
266#ifndef CONFIG_BT_NIMBLE_ENABLED
267#define CONFIG_BT_NIMBLE_ENABLED 1
268#endif
269
270#ifdef ESP_PLATFORM
271#ifndef CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
272#define CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY
273#endif
274
275#ifndef CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE
276#define CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE 0
277#endif
278
279#ifndef CONFIG_BTDM_SCAN_DUPL_TYPE_DATA
280#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA 1
281#endif
282
283#ifndef CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE
284#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE 2
285#endif
286
287#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
288#define CONFIG_IDF_TARGET_ESP32 1
289#endif
290
291#if CONFIG_BT_NIMBLE_EXT_ADV || CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV
292# if defined(CONFIG_IDF_TARGET_ESP32)
293# error Extended advertising is not supported on ESP32.
294# endif
295#endif
296#endif
297
298#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !CONFIG_BT_NIMBLE_EXT_ADV
299# error Extended advertising must be enabled to use periodic advertising.
300#endif
301
302/* Must have max instances and data length set if extended advertising is enabled */
303#if CONFIG_BT_NIMBLE_EXT_ADV
304# if !defined(CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES)
305# define CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES 1
306# endif
307# if !defined(CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN)
308# define CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN 251
309# endif
310#endif
311
312/* Must set max number of syncs if periodic advertising is enabled */
313#if CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV && !defined(CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS)
314# define CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS 1
315#endif
316
317/* Cannot use client without scan */
318#if defined(CONFIG_BT_NIMBLE_ROLE_CENTRAL) && !defined(CONFIG_BT_NIMBLE_ROLE_OBSERVER)
319#define CONFIG_BT_NIMBLE_ROLE_OBSERVER
320#endif
321
322/* Cannot use server without advertise */
323#if defined(CONFIG_BT_NIMBLE_ROLE_PERIPHERAL) && !defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER)
324#define CONFIG_BT_NIMBLE_ROLE_BROADCASTER
325#endif
326
327/* Enables the use of Arduino String class for attribute values */
328#if defined __has_include
329# if __has_include (<Arduino.h>)
330# define NIMBLE_CPP_ARDUINO_STRING_AVAILABLE
331# endif
332#endif