Merge branch 'bugfix/add_dummy_cb_during_deinit_v5.0' into 'release/v5.0'

fix(nimble): De-register host cb in stack deinit (v5.0)

See merge request espressif/esp-idf!33376
This commit is contained in:
Rahul Tank 2024-09-16 18:08:05 +08:00
commit 21aa38dcee

View File

@ -338,6 +338,12 @@ static void controller_rcv_pkt_ready(void)
}
}
static void dummy_controller_rcv_pkt_ready(void)
{
/* Dummy function */
return;
}
void bt_record_hci_data(uint8_t *data, uint16_t len)
{
#if (BT_HCI_LOG_INCLUDED == TRUE)
@ -407,11 +413,23 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
return 0;
}
static int dummy_host_rcv_pkt(uint8_t *data, uint16_t len)
{
/* Dummy function */
return 0;
}
static const esp_vhci_host_callback_t vhci_host_cb = {
.notify_host_send_available = controller_rcv_pkt_ready,
.notify_host_recv = host_rcv_pkt,
};
static const esp_vhci_host_callback_t dummy_vhci_host_cb = {
.notify_host_send_available = dummy_controller_rcv_pkt_ready,
.notify_host_recv = dummy_host_rcv_pkt,
};
static void ble_buf_free(void)
{
os_msys_buf_free();
@ -520,6 +538,11 @@ esp_err_t esp_nimble_hci_deinit(void)
return ret;
}
ret = esp_vhci_host_register_callback(&dummy_vhci_host_cb);
if (ret != ESP_OK) {
return ret;
}
ble_buf_free();
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)