NimBLE: BLE 5.0 related configuration changes

Added some changes like checking idf_target = BT_SOC_SUPPORT_5_0
and menuconfig option to enable/disable host based privacy.
This commit is contained in:
Chinmay Chhajed 2020-07-31 13:10:18 +00:00
parent cfe8172e12
commit 62225cc47a
3 changed files with 92 additions and 5 deletions

View File

@ -21,6 +21,12 @@ menu "Bluetooth"
depends on BT_ENABLED && IDF_TARGET_ESP32S3
default y
config BT_SOC_SUPPORT_5_0
bool
depends on BT_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3)
default y if BT_ENABLED && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3)
default n
menu "Bluetooth controller(ESP32 Dual Mode Bluetooth)"
visible if BT_CTRL_ESP32

View File

@ -219,7 +219,7 @@ config BT_NIMBLE_SVC_GAP_APPEARANCE
config BT_NIMBLE_ACL_BUF_COUNT
int "ACL Buffer count"
depends on BT_NIMBLE_ENABLED
default 12
default 20
help
The number of ACL data buffers.
@ -234,9 +234,12 @@ config BT_NIMBLE_ACL_BUF_SIZE
config BT_NIMBLE_HCI_EVT_BUF_SIZE
int "HCI Event Buffer size"
depends on BT_NIMBLE_ENABLED
default 257 if BT_NIMBLE_EXT_ADV
default 70
help
This is the size of each HCI event buffer in bytes
This is the size of each HCI event buffer in bytes. In case of
extended advertising, packets can be fragmented. 257 bytes is the
maximum size of a packet.
config BT_NIMBLE_HCI_EVT_HI_BUF_COUNT
int "High Priority HCI Event Buffer count"
@ -271,6 +274,7 @@ config BT_NIMBLE_MSYS1_BLOCK_COUNT
config BT_NIMBLE_HS_FLOW_CTRL
bool "Enable Host Flow control"
depends on BT_NIMBLE_ENABLED
default n if BT_SOC_SUPPORT_5_0
default y
help
Enable Host Flow control
@ -418,3 +422,60 @@ config BT_NIMBLE_HS_STOP_TIMEOUT_MS
depends on BT_NIMBLE_ENABLED
help
BLE Host stop procedure timeout in milliseconds.
config BT_NIMBLE_HOST_BASED_PRIVACY
bool "Enable host based privacy for random address."
default n
depends on BT_NIMBLE_ENABLED && !IDF_TARGET_ESP32
help
Use this option to do host based Random Private Address resolution.
If this option is disabled then controller based privacy is used.
config BT_NIMBLE_EXT_ADV
bool "Enable extended advertising."
default y if BT_SOC_SUPPORT_5_0
default n
depends on BT_NIMBLE_ENABLED && BT_SOC_SUPPORT_5_0
help
Enable this option to do extended advertising. Extended advertising
will be supported from BLE 5.0 onwards.
config BT_NIMBLE_MAX_EXT_ADV_INSTANCES
int "Maximum number of extended advertising instances."
range 0 4
default 1 if BT_NIMBLE_EXT_ADV
default 0
depends on BT_NIMBLE_EXT_ADV
help
Change this option to set maximum number of extended advertising
instances. Minimum there is always one instance of
advertising. Enter how many more advertising instances you
want.
config BT_NIMBLE_MAX_EXT_ADV_DATA_LEN
int "Maximum length of the advertising data."
range 0 1650
default 1650 if BT_NIMBLE_EXT_ADV
default 0
depends on BT_NIMBLE_EXT_ADV
help
Defines size of extended advertising data. Size should not increase
1650.
config BT_NIMBLE_ENABLE_PERIODIC_ADV
bool "Enable periodic advertisement."
default y
depends on BT_NIMBLE_EXT_ADV
help
Enable this option to start periodic advertisement.
config BT_NIMBLE_MAX_PERIODIC_SYNCS
int "Maximum number of periodic advertising syncs."
default 1 if BT_NIMBLE_ENABLE_PERIODIC_ADV
default 0
depends on BT_NIMBLE_ENABLE_PERIODIC_ADV
range 1 8
help
Set this option to set the upper limit for number of periodic sync
connections. This should be less than maximum connections allowed by
controller.

View File

@ -47,11 +47,15 @@
/*** nimble */
#ifndef MYNEWT_VAL_BLE_EXT_ADV
#define MYNEWT_VAL_BLE_EXT_ADV (0)
#define MYNEWT_VAL_BLE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV)
#endif
#ifndef MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE
#define MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE (31)
#ifdef CONFIG_BT_NIMBLE_EXT_ADV
#define MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE (CONFIG_BT_NIMBLE_MAX_EXT_ADV_DATA_LEN)
#else
#define MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE (0)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_MAX_CONNECTIONS
@ -59,12 +63,20 @@
#endif
#ifndef MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES
#ifdef CONFIG_BT_NIMBLE_EXT_ADV
#define MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES (CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES)
#else
#define MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES (0)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_MAX_PERIODIC_SYNCS
#ifdef CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV
#define MYNEWT_VAL_BLE_MAX_PERIODIC_SYNCS (CONFIG_BT_NIMBLE_MAX_PERIODIC_SYNCS)
#else
#define MYNEWT_VAL_BLE_MAX_PERIODIC_SYNCS (0)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_ROLE_BROADCASTER
#ifdef CONFIG_BT_NIMBLE_ROLE_BROADCASTER
@ -276,8 +288,12 @@
#endif
#ifndef MYNEWT_VAL_BLE_PERIODIC_ADV
#ifdef CONFIG_BT_NIMBLE_EXT_ADV
#define MYNEWT_VAL_BLE_PERIODIC_ADV (CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV)
#else
#define MYNEWT_VAL_BLE_PERIODIC_ADV (0)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_PERIODIC_ADV_SYNC_TRANSFER
#define MYNEWT_VAL_BLE_PERIODIC_ADV_SYNC_TRANSFER (0)
@ -575,8 +591,12 @@
#define MYNEWT_VAL_BLE_MONITOR_UART_DEV ("uart0")
#endif
#ifndef MYNEWT_VAL_BLE_HOST_BASED_PRIVACY
#if CONFIG_IDF_TARGET_ESP32
#define MYNEWT_VAL_BLE_HOST_BASED_PRIVACY (1)
#else
#ifndef MYNEWT_VAL_BLE_HOST_BASED_PRIVACY
#define MYNEWT_VAL_BLE_HOST_BASED_PRIVACY (CONFIG_BT_NIMBLE_HOST_BASED_PRIVACY)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_RPA_TIMEOUT