espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.37k stars 7.21k forks source link

Not able to re-enable the bluetooth (IDFGH-6045) #7729

Closed arjaanda closed 10 months ago

arjaanda commented 2 years ago

Hello,

In my project I need to disable Bluetooth momentarily and re-enable it.

I am using esp_bt_controller_disable API to disable the bluetooth which seems to work. But when use esp_bt_controller_enable API to re-enable it I do not see bluetooth enabled.

How can I solve this or achieve my use case?

Best Regards, Arjun

chegewara commented 2 years ago
    esp_bluedroid_disable();
    esp_bluedroid_deinit();
    esp_bt_controller_disable();
    esp_bt_controller_deinit();

and remember to not release bluetooth memory.

xiewenxiang commented 2 years ago

gatt_server_service_table.zip Here is a sample code, I don't know if it is helpful to you.

Alvin1Zhang commented 2 years ago

@arjaanda Thanks for reporting, would you please help share if any updates for the issue? Thanks.

esp-zhp commented 10 months ago

Thank you for reporting the issue. We have addressed the issue in the latest branch, and the fix is included in the following commits: 91bd2c85412fad0d6bf6b7dd9061364fbb038af3 and 1ddcca6dcdf2a42fe64470721e4518d7e2d87f02.