Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Enable/Disable Bluetooth on ESP32

Hello all,

I am trying to Enable/Disable bluetooth functionality on ESP32. Only when the button is pressed in a pattern(say 3 times) the bluetooth have to be initialised.
Otherwise bluetooth has to be disabled, since the bluetooth functionality would drain the battery. I thought of calling mgos_bt_common_init(), in the interrupt handler for the button , but not sure of any api to disable the bluetooth functionality. Appreciate if anyone can throw some points to the solution.

Thanks,
Thomas

Comments

  • rojerrojer Dublin, Ireland

    yeah, init is only supposed to be called once and not supposed to be repeated.
    try using esp_bt_controller_disable(ESP_BT_MODE_BTDM); and esp_bt_controller_enable(ESP_BT_MODE_BTDM);

Sign In or Register to comment.