From 24e7d9b1cbc16f7b06a9c4327466c1946ae9fc6e Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Tue, 7 May 2024 10:59:42 +0800 Subject: [PATCH 1/3] feat(ble/controller): Display BLE controller init status for ESP32 and ESP32C3/S3 --- components/bt/controller/esp32/bt.c | 5 ++++- components/bt/controller/esp32c3/bt.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/bt/controller/esp32/bt.c b/components/bt/controller/esp32/bt.c index f26dd4bc26..5b9acd3565 100644 --- a/components/bt/controller/esp32/bt.c +++ b/components/bt/controller/esp32/bt.c @@ -1620,7 +1620,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) btdm_cfg_mask = btdm_config_mask_load(); - if (btdm_controller_init(btdm_cfg_mask, cfg) != 0) { + err = btdm_controller_init(btdm_cfg_mask, cfg); + + if (err != 0) { + ESP_LOGE(BTDM_LOG_TAG, "%s %d\n",__func__,err); err = ESP_ERR_NO_MEM; goto error; } diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index e053cfdf40..8cca9a72c1 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -1403,7 +1403,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) periph_module_enable(PERIPH_BT_MODULE); periph_module_reset(PERIPH_BT_MODULE); - if (btdm_controller_init(cfg) != 0) { + err = btdm_controller_init(cfg); + + if (err != 0) { + ESP_LOGE(BT_LOG_TAG, "%s %d\n",__func__,err); err = ESP_ERR_NO_MEM; goto error; } From b270f0abc32697eba5b3d929fb55b6ba2e1a8790 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Tue, 7 May 2024 15:32:11 +0800 Subject: [PATCH 2/3] feat(ble/bluedroid): Add BLE memory allocation failure message --- components/bt/host/bluedroid/hci/packet_fragmenter.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/bt/host/bluedroid/hci/packet_fragmenter.c b/components/bt/host/bluedroid/hci/packet_fragmenter.c index 78b6151e51..d8f2ff918f 100644 --- a/components/bt/host/bluedroid/hci/packet_fragmenter.c +++ b/components/bt/host/bluedroid/hci/packet_fragmenter.c @@ -171,6 +171,12 @@ static void reassemble_and_dispatch(BT_HDR *packet) return; } partial_packet = (BT_HDR *)osi_calloc(full_length + sizeof(BT_HDR)); + + if (partial_packet == NULL) { + HCI_TRACE_WARNING("%s full_length %d no memory.\n", __func__, full_length); + assert(0); + } + partial_packet->event = packet->event; partial_packet->len = full_length; partial_packet->offset = packet->len; From fc9290d8a2fc9e54f7c062d1d98264d0b5940a01 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Tue, 7 May 2024 16:24:27 +0800 Subject: [PATCH 3/3] fix(ble/bluedroid): Fixed BLE spelling error in word --- components/bt/host/bluedroid/Kconfig.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 58859d35f8..2a108d0892 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -85,7 +85,7 @@ config BT_A2DP_ENABLE depends on BT_CLASSIC_ENABLED default n help - Advanced Audio Distrubution Profile + Advanced Audio Distribution Profile config BT_SPP_ENABLED bool "SPP" @@ -140,7 +140,7 @@ config BT_HFP_WBS_ENABLE default y help This enables Wide Band Speech. Should disable it when SCO data path is PCM. - Otherwise there will be no data transmited via GPIOs. + Otherwise there will be no data transmitted via GPIOs. menuconfig BT_HID_ENABLED @@ -1072,7 +1072,7 @@ config BT_ACL_CONNECTIONS is used. config BT_MULTI_CONNECTION_ENBALE - bool "Enable BLE multi-conections" + bool "Enable BLE multi-connections" depends on BT_BLE_ENABLED default y help