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

This commit is contained in:
Rahul Tank
2024-09-16 14:19:45 +05:30
parent 632513c067
commit 43226b84d1
4 changed files with 23 additions and 0 deletions
@@ -14,6 +14,13 @@
#include "esp_hci_transport.h"
#include "esp_hci_internal.h"
static int
ble_transport_dummy_host_recv_cb(hci_trans_pkt_ind_t type, uint8_t *data, uint16_t len)
{
/* Dummy function */
return 0;
}
static int
ble_transport_host_recv_cb(hci_trans_pkt_ind_t type, uint8_t *data, uint16_t len)
{
@@ -45,6 +52,12 @@ ble_transport_ll_init(void)
hci_transport_host_callback_register(ble_transport_host_recv_cb);
}
void
ble_transport_ll_deinit(void)
{
hci_transport_host_callback_register(ble_transport_dummy_host_recv_cb);
}
void *
ble_transport_alloc_cmd(void)
{
@@ -31,3 +31,9 @@ ble_transport_ll_init(void)
}
void
ble_transport_ll_deinit(void)
{
}
@@ -31,6 +31,8 @@ extern "C" {
extern void ble_transport_ll_init(void);
extern void ble_transport_hs_init(void);
extern void ble_transport_ll_deinit(void);
/* APIs to be implemented by HS/LL side of transports */
extern int ble_transport_to_ll_cmd_impl(void *buf);
extern int ble_transport_to_ll_acl_impl(struct os_mbuf *om);
+2
View File
@@ -156,6 +156,8 @@ esp_err_t esp_nimble_deinit(void)
#if !SOC_ESP_NIMBLE_CONTROLLER || !CONFIG_BT_CONTROLLER_ENABLED
npl_freertos_funcs_deinit();
#endif
ble_transport_ll_deinit();
return ESP_OK;
}