Skip to content

Commit

Permalink
fix(nimble): Fixed deinit sequence in blufi
Browse files Browse the repository at this point in the history
  • Loading branch information
rahult-github committed Sep 24, 2024
1 parent 1f68652 commit 887c116
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,10 @@ uint8_t esp_blufi_init(void)
void esp_blufi_deinit(void)
{
blufi_env.enabled = false;
btc_msg_t msg;
esp_blufi_cb_param_t param;
btc_msg_t msg;
memset (&msg, 0x0, sizeof (msg));
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;
Expand Down
11 changes: 6 additions & 5 deletions examples/bluetooth/blufi/main/blufi_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,19 @@ esp_err_t esp_blufi_host_deinit(void)
{
esp_err_t ret = ESP_OK;

ret = nimble_port_stop();

if (ret == 0) {
esp_nimble_deinit();
}

ret = esp_blufi_profile_deinit();
if(ret != ESP_OK) {
return ret;
}

esp_blufi_btc_deinit();

ret = nimble_port_stop();
if (ret == 0) {
esp_nimble_deinit();
}

return ret;
}

Expand Down

0 comments on commit 887c116

Please sign in to comment.