esp-nimble-cpp icon indicating copy to clipboard operation
esp-nimble-cpp copied to clipboard

Remove deprecated API in case of ESP-IDF V5.

Open armandas opened this issue 3 years ago • 5 comments

esp_nimble_hci_and_controller_deinit function has been removed from the API in ESP IDF version 5.0. Add a compile guard to prevent build errors.

armandas avatar Sep 13 '22 10:09 armandas

Thanks for this! I believe the initialization code will also require a similar change from my interpretation of the esp-nimble updates.

h2zero avatar Sep 13 '22 14:09 h2zero

@h2zero I couldn't find any references to esp_nimble_hci_and_controller_init in the code. Though I'm happy to make any additional changes, as required.

armandas avatar Sep 13 '22 15:09 armandas

Yes, that function is not used, however direct initialization of the controller/host stack is. It's my understanding that this has been reduced to a single call of nimble_port_init as the controller/host are now initialized there.

I'm not sure what effect this has on the existing code, so I'll need to look into it.

h2zero avatar Sep 13 '22 23:09 h2zero

@h2zero Sorry about the delay. I finally had some time to check this. Indeed, with the original initialization code, I was getting a E (2391) BLE_INIT: controller init failed error and continuous rebooting.

Wrapping that with the same check has fixed the issue and it works as expected.

Could you check the updated changes?

armandas avatar Sep 23 '22 05:09 armandas

Thanyou @armandas !! your fix saved my day!! It works!

walterjj avatar Sep 30 '22 23:09 walterjj

Sorry for the delay on this, I've been extremely busy and completely forgot about it 👎. Thanks for this!

h2zero avatar Nov 04 '22 02:11 h2zero