How to turn on/off the BLE and WiFI radios

Aussie Susan
Posts: 4
Joined: Thu Aug 22, 2019 3:48 am

How to turn on/off the BLE and WiFI radios

Postby Aussie Susan » Tue Oct 08, 2019 1:47 am

I want to use both BLE and WiFi. Ideally I'd like to use both simultaneously but others have reported issues with this.
In my circumstance I have no problem with switching between BLE and WiFi.
In the various topics I've read about this there is often the comment to turn the radio on and off for the particular stack. However, when I read the documentation, I'm not sure which are the specific API calls that do this.
I'd like to keep as much of the various stack set-ups as possible and simply turn the radio on and off as required.
Therefore: can someone please tell me the specific API calls that I need to make for each operation?
Susan

kugelblitz
Posts: 6
Joined: Tue Feb 26, 2019 6:36 am

Re: How to turn on/off the BLE and WiFI radios

Postby kugelblitz » Tue Oct 08, 2019 8:56 am

I am also looking for this. I have tried various combinations of bluedroid_enable, bluedroid_disable, bt_controller_enable, and bt_controller_disable but once it is disabled I can't figure out how to reenable functionality. I have also tried to initialize everything using the init functions and then enable/set callbacks later but this also causes problems (at least in my case for SPP)

chegewara
Posts: 815
Joined: Wed Jun 14, 2017 9:00 pm

Re: How to turn on/off the BLE and WiFI radios

Postby chegewara » Sat Oct 12, 2019 5:39 pm

This is BLE deinit procedure:

Code: Select all

    esp_bluedroid_disable();
    esp_bluedroid_deinit();
    esp_bt_controller_disable();
    esp_bt_controller_deinit();
    
As long as BLE memory is not released you can init BLE again.

To stop wifi you can use:

Code: Select all

esp_wifi_stop();

Who is online

Users browsing this forum: Baidu [Spider], ESP_Angus, MSN [Bot] and 14 guests