Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_ble_scan_assert' into 'master'
Browse files Browse the repository at this point in the history
fix(bt/controller): Update bt lib for ESP32(5838b68)

Closes IDFGH-6912, BLERP-628, BLERP-400, IDFCI-2016, BLERP-629, BLERP-634, IDFGH-12506, and FCS-1421

See merge request espressif/esp-idf!29686
  • Loading branch information
Isl2017 committed Apr 8, 2024
2 parents 3a1b568 + 9c6869f commit e3839a3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion components/bt/controller/esp32/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ config BTDM_CTRL_PINNED_TO_CORE
choice BTDM_CTRL_HCI_MODE_CHOICE
prompt "HCI mode"
help
Speicify HCI mode as VHCI or UART(H4)
Specify HCI mode as VHCI or UART(H4)

config BTDM_CTRL_HCI_MODE_VHCI
bool "VHCI"
Expand Down Expand Up @@ -398,6 +398,14 @@ config BTDM_CTRL_FULL_SCAN_SUPPORTED
The full scan function is mainly used to provide BLE scan performance.
This is required for scenes with high scan performance requirements, such as BLE Mesh scenes.

config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
bool "Disable active scan backoff"
default n
help
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.

config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32
12 changes: 10 additions & 2 deletions components/bt/include/esp32/include/esp_bt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -50,7 +50,7 @@ extern "C" {

#endif //CONFIG_BT_ENABLED

#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20221207
#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240315

/**
* @brief Bluetooth mode for controller enable/disable
Expand Down Expand Up @@ -167,6 +167,12 @@ the adv packet will be discarded until the memory is restored. */
#define BTDM_CONTROLLER_SCO_DATA_PATH_HCI 0 // SCO data is routed to HCI
#define BTDM_CONTROLLER_SCO_DATA_PATH_PCM 1 // SCO data path is PCM

#ifdef CONFIG_BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
#define BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX CONFIG_BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
#else
#define BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX 0
#endif

#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
.controller_task_stack_size = ESP_TASK_BT_CONTROLLER_STACK, \
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
Expand All @@ -190,6 +196,7 @@ the adv packet will be discarded until the memory is restored. */
.pcm_polar = CONFIG_BTDM_CTRL_PCM_POLAR_EFF, \
.hli = BTDM_CTRL_HLI, \
.dup_list_refresh_period = SCAN_DUPL_CACHE_REFRESH_PERIOD, \
.ble_scan_backoff = BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \
.magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \
}

Expand Down Expand Up @@ -233,6 +240,7 @@ typedef struct {
uint8_t pcm_polar; /*!< PCM polar trig (falling clk edge & rising clk edge) */
bool hli; /*!< Using high level interrupt or not */
uint16_t dup_list_refresh_period; /*!< Duplicate scan list refresh period */
bool ble_scan_backoff; /*!< BLE scan backoff */
uint32_t magic; /*!< Magic number */
} esp_bt_controller_config_t;

Expand Down

0 comments on commit e3839a3

Please sign in to comment.