Bluetooth shutdown issues

fleaplus
Posts: 1
Joined: Wed Sep 06, 2017 3:46 pm

Bluetooth shutdown issues

Postby fleaplus » 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:
  • 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()
esp_bluedroid_disable() never returns or errors. I set the trace on the gatt library to 6 as suggested in a few other posts but didn't get any additional debugging output. I haven't seen in any examples the process of disabling bluetooth, so I am not sure if I am missing a step. I did find that calling esp_bluedroid_disable() immediately after esp_bluedroid_enable() did succeed. I took a look at the SDK code but it doesn't seem like an unimplemented function or such. Any help is appreciated!

quanvuee
Posts: 5
Joined: Tue Dec 05, 2017 4:53 am

Re: Bluetooth shutdown issues

Postby quanvuee » Tue Dec 05, 2017 4:58 am

I have same issue.
When I call esp_bluedroid_disable(), i have no idea what happen. It not return and code affter this don't run.
How can I disable BLE?

Who is online

Users browsing this forum: Gaston1980, Majestic-12 [Bot] and 246 guests