Bluetooth shutdown issues
Posted: Wed Sep 06, 2017 6:14 pm
Hello, I have a custom service implemented that provides characteristics to view and update settings on our device. The service will optionally be enabled when the device comes out of deep sleep. I would like to shut down the bluetooth stack and deallocate any resources being used after a successful configuration is received, but I have had trouble getting the esp_bluedroid_disable() function to work.
I am currently doing the following things after a successful configuration has been received:
I am currently doing the following things after a successful configuration has been received:
- Call esp_ble_gatts_stop_service() with the service handle
- Respond to ESP_GATTS_STOP_EVT, calling esp_ble_gatts_delete_service() with the service handle
- Respond to ESP_GATTS_DELETE_EVT, calling esp_ble_gatts_app_unregister() with the gatts interface
- Respond to ESP_GATTS_UNREG_EVT, calling esp_bluedroid_disable()