From 1728b49d7f7777d900bdf4d9a7d788525f3bb55d Mon Sep 17 00:00:00 2001 From: zwj Date: Fri, 14 Apr 2023 16:17:10 +0800 Subject: [PATCH 1/5] Fixed disconnection due to consecutive CRC errors in first 6 intervals --- components/bt/controller/lib_esp32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index 8ce6d27e09..df2d212f9c 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit 8ce6d27e0981c09e1c5a982976f182d0a37662f6 +Subproject commit df2d212f9cd566e6d86e6e6fcb0d02d6ea3b044a From 6d592585199515494ecfd6c32d6d146240fab21f Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Wed, 26 Apr 2023 11:20:09 +0800 Subject: [PATCH 2/5] Fixed BLE disconnection failure on ESP32 --- components/bt/controller/lib_esp32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index df2d212f9c..26b2361bf7 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit df2d212f9cd566e6d86e6e6fcb0d02d6ea3b044a +Subproject commit 26b2361bf7569eb46b68eebdf9f634ef4ed17660 From 8bb9b95b541772eea4f70a1611ab371da619c5a6 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Wed, 17 May 2023 12:18:33 +0800 Subject: [PATCH 3/5] esp_hid: fixed ble hid battery level setting --- components/esp_hid/src/ble_hidd.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/esp_hid/src/ble_hidd.c b/components/esp_hid/src/ble_hidd.c index fbca942a20..f5f1259da1 100644 --- a/components/esp_hid/src/ble_hidd.c +++ b/components/esp_hid/src/ble_hidd.c @@ -832,12 +832,14 @@ static esp_err_t esp_ble_hidd_dev_battery_set(void *devp, uint8_t level) return ESP_OK; } - ret = esp_ble_gatts_send_indicate(dev->bat_svc.gatt_if, dev->conn_id, dev->bat_level_handle, 1, &dev->bat_level, dev->bat_ccc.indicate_enable); - if (ret) { - ESP_LOGE(TAG, "esp_ble_gatts_send_indicate failed: %d", ret); - return ESP_FAIL; + if (dev->bat_ccc.notify_enable) { + ret = esp_ble_gatts_send_indicate(dev->bat_svc.gatt_if, dev->conn_id, dev->bat_level_handle, 1, &dev->bat_level, false); + if (ret) { + ESP_LOGE(TAG, "esp_ble_gatts_send_notify failed: %d", ret); + return ESP_FAIL; + } } - WAIT_CB(dev); + return ESP_OK; } From 35a14bf383da8f8069d5de57800a8d8c6091daec Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Thu, 1 Jun 2023 17:37:20 +0800 Subject: [PATCH 4/5] bluedroid: fixed default extended connection params --- .../bt/host/bluedroid/stack/l2cap/l2c_ble.c | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c index 80415d04ae..e485f70e49 100644 --- a/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c +++ b/components/bt/host/bluedroid/stack/l2cap/l2c_ble.c @@ -35,11 +35,35 @@ #if (BLE_INCLUDED == TRUE) #if (BLE_50_FEATURE_SUPPORT == TRUE) -const tHCI_ExtConnParams ext_conn_params = { +#define EXT_CONN_INT_DEF_1M MAX(((MAX_ACL_CONNECTIONS + 1) * 4), 12) +#define EXT_CONN_INT_DEF_2M MAX(((MAX_ACL_CONNECTIONS + 1) * 2), 12) +#define EXT_CONN_INT_DEF_CODED (320) // 306-> 362Kbps + +const static tHCI_ExtConnParams ext_conn_params_1m_phy = { .scan_interval = 0x40, .scan_window = 0x40, - .conn_interval_min = 320, // 306-> 362Kbps - .conn_interval_max = 320, + .conn_interval_min = EXT_CONN_INT_DEF_1M, + .conn_interval_max = EXT_CONN_INT_DEF_1M, + .conn_latency = 0, + .sup_timeout = 600, + .min_ce_len = 0, + .max_ce_len = 0, +}; +const static tHCI_ExtConnParams ext_conn_params_2m_phy = { + .scan_interval = 0x40, + .scan_window = 0x40, + .conn_interval_min = EXT_CONN_INT_DEF_2M, + .conn_interval_max = EXT_CONN_INT_DEF_2M, + .conn_latency = 0, + .sup_timeout = 600, + .min_ce_len = 0, + .max_ce_len = 0, +}; +const static tHCI_ExtConnParams ext_conn_params_coded_phy = { + .scan_interval = 0x40, + .scan_window = 0x40, + .conn_interval_min = EXT_CONN_INT_DEF_CODED, + .conn_interval_max = EXT_CONN_INT_DEF_CODED, .conn_latency = 0, .sup_timeout = 600, .min_ce_len = 0, @@ -929,9 +953,9 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb) if (p_dev_rec->ext_conn_params.phy_mask == BLE_PHY_NO_PREF) { L2CAP_TRACE_WARNING("No extend connection parameters set, use default parameters"); aux_conn.init_phy_mask = BLE_PHY_PREF_MASK; - memcpy(&aux_conn.params[0], &ext_conn_params, sizeof(tHCI_ExtConnParams)); - memcpy(&aux_conn.params[1], &ext_conn_params, sizeof(tHCI_ExtConnParams)); - memcpy(&aux_conn.params[2], &ext_conn_params, sizeof(tHCI_ExtConnParams)); + memcpy(&aux_conn.params[0], &ext_conn_params_1m_phy, sizeof(tHCI_ExtConnParams)); + memcpy(&aux_conn.params[1], &ext_conn_params_2m_phy, sizeof(tHCI_ExtConnParams)); + memcpy(&aux_conn.params[2], &ext_conn_params_coded_phy, sizeof(tHCI_ExtConnParams)); } else { aux_conn.init_phy_mask = p_dev_rec->ext_conn_params.phy_mask; memcpy(&aux_conn.params[0], &p_dev_rec->ext_conn_params.phy_1m_conn_params, sizeof(tHCI_ExtConnParams)); From b8e4f091f612d9d118d9d0c8e0742b1811a22325 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Sun, 11 Jun 2023 11:42:36 +0800 Subject: [PATCH 5/5] Update bt-lib for esp32 1 Fixed disconnection delay on peripheral when slave latency is not zero 2 Fixed LLCP info init for central and peripheral 3 Fixed sent cmd status evt twice when process disconnect cmd --- components/bt/controller/lib_esp32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/lib_esp32 b/components/bt/controller/lib_esp32 index 26b2361bf7..7c757d49c4 160000 --- a/components/bt/controller/lib_esp32 +++ b/components/bt/controller/lib_esp32 @@ -1 +1 @@ -Subproject commit 26b2361bf7569eb46b68eebdf9f634ef4ed17660 +Subproject commit 7c757d49c407e31c50d17c0d917c65c95fe3b6cc