Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_some_ble_bugs_240926_esp32' into 'master'
Browse files Browse the repository at this point in the history
Fixed some BLE bugs 240926 on ESP32

Closes BLERP-1074, BLERP-1073, and BLERP-1160

See merge request espressif/esp-idf!33842
  • Loading branch information
Isl2017 committed Oct 25, 2024
2 parents de3a5d4 + 2b28133 commit 911ddf7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
17 changes: 17 additions & 0 deletions components/bt/controller/esp32/Kconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,23 @@ config BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more.

menu "BLE disconnect when instant passed"
config BTDM_BLE_LLCP_CONN_UPDATE
bool "BLE ACL connection update procedure"
depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM)
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed during connection update procedure.

config BTDM_BLE_LLCP_CHAN_MAP_UPDATE
bool "BLE ACL channel map update procedure"
depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM)
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed in channel map update procedure.
endmenu

config BTDM_RESERVE_DRAM
hex
Expand Down
2 changes: 1 addition & 1 deletion components/bt/controller/lib_esp32
19 changes: 18 additions & 1 deletion components/bt/include/esp32/include/esp_bt.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern "C" {
*
* @note Please do not modify this value
*/
#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240722
#define ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL 0x20240926

/**
* @brief Bluetooth Controller mode
Expand Down Expand Up @@ -178,6 +178,21 @@ the advertising packet will be discarded until the memory is restored. */
#else
#define BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX 0
#endif

#ifdef CONFIG_BTDM_BLE_LLCP_CONN_UPDATE
#define BTDM_BLE_LLCP_CONN_UPDATE (1<<0)
#else
#define BTDM_BLE_LLCP_CONN_UPDATE (0<<0)
#endif

#ifdef CONFIG_BTDM_BLE_LLCP_CHAN_MAP_UPDATE
#define BTDM_BLE_LLCP_CHAN_MAP_UPDATE (1<<1)
#else
#define BTDM_BLE_LLCP_CHAN_MAP_UPDATE (0<<1)
#endif

#define BTDM_BLE_LLCP_DISC_FLAG (BTDM_BLE_LLCP_CONN_UPDATE | BTDM_BLE_LLCP_CHAN_MAP_UPDATE)

/**
* @brief Default Bluetooth Controller configuration
*/
Expand Down Expand Up @@ -206,6 +221,7 @@ the advertising packet will be discarded until the memory is restored. */
.hli = BTDM_CTRL_HLI, \
.dup_list_refresh_period = SCAN_DUPL_CACHE_REFRESH_PERIOD, \
.ble_scan_backoff = BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX, \
.ble_llcp_disc_flag = BTDM_BLE_LLCP_DISC_FLAG, \
.magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \
}

Expand Down Expand Up @@ -258,6 +274,7 @@ typedef struct {
bool hli; /*!< True if using high level interrupt; false otherwise. Configurable in menuconfig */
uint16_t dup_list_refresh_period; /*!< Scan duplicate filtering list refresh period in seconds. Configurable in menuconfig */
bool ble_scan_backoff; /*!< True if BLE scan backoff is enabled; false otherwise. Configurable in menuconfig */
uint8_t ble_llcp_disc_flag; /*!< BLE disconnect flag when instant passed. Configurable in menuconfig */
uint32_t magic; /*!< Magic number */
} esp_bt_controller_config_t;

Expand Down

0 comments on commit 911ddf7

Please sign in to comment.