mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
fix(nimble): De-register host cb in stack deinit
This commit is contained in:
@@ -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)
|
void bt_record_hci_data(uint8_t *data, uint16_t len)
|
||||||
{
|
{
|
||||||
#if (BT_HCI_LOG_INCLUDED == TRUE)
|
#if (BT_HCI_LOG_INCLUDED == TRUE)
|
||||||
@@ -407,11 +413,23 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
|
|||||||
return 0;
|
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 = {
|
static const esp_vhci_host_callback_t vhci_host_cb = {
|
||||||
.notify_host_send_available = controller_rcv_pkt_ready,
|
.notify_host_send_available = controller_rcv_pkt_ready,
|
||||||
.notify_host_recv = host_rcv_pkt,
|
.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)
|
static void ble_buf_free(void)
|
||||||
{
|
{
|
||||||
os_msys_buf_free();
|
os_msys_buf_free();
|
||||||
@@ -520,6 +538,11 @@ esp_err_t esp_nimble_hci_deinit(void)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = esp_vhci_host_register_callback(&dummy_vhci_host_cb);
|
||||||
|
if (ret != ESP_OK) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ble_buf_free();
|
ble_buf_free();
|
||||||
|
|
||||||
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
|
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
|
||||||
|
Reference in New Issue
Block a user