fix(nimble): Move ble_log_init/deinit to esp_nimble_init/deinit

This commit is contained in:
Rahul Tank
2026-04-15 21:04:15 +05:30
parent 5ac39652ce
commit c852bb076b
+13 -10
View File
@@ -21,6 +21,7 @@
#include <stdbool.h>
#include "os/os.h"
#include "sysinit/sysinit.h"
#include "esp_nimble_cfg.h"
#if CONFIG_BT_NIMBLE_ENABLED
#include "host/ble_hs.h"
@@ -45,10 +46,10 @@
#if !CONFIG_BT_CONTROLLER_ENABLED
#include "nimble/transport.h"
#endif
#include "bt_common.h"
#if (BT_HCI_LOG_INCLUDED == TRUE)
#include "hci_log/bt_hci_log.h"
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
#include "bt_common.h"
#endif
#define NIMBLE_PORT_LOG_TAG "BLE_INIT"
@@ -198,6 +199,12 @@ esp_err_t esp_nimble_init(void)
ble_transport_ll_init();
#if (BT_HCI_LOG_INCLUDED == TRUE)
if (bt_hci_log_init() != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "bt_hci_log_init failed");
}
#endif
return ESP_OK;
}
@@ -214,6 +221,10 @@ esp_err_t esp_nimble_deinit(void)
ble_transport_ll_deinit();
#if (BT_HCI_LOG_INCLUDED == TRUE)
bt_hci_log_deinit();
#endif
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
ble_adv_list_deinit();
#endif
@@ -325,10 +336,6 @@ nimble_port_init(void)
return ret;
}
#if MYNEWT_VAL(BT_HCI_LOG_INCLUDED)
bt_hci_log_init();
#endif // MYNEWT_VAL(BT_HCI_LOG_INCLUDED)
return ESP_OK;
}
@@ -363,10 +370,6 @@ nimble_port_deinit(void)
}
#endif
#if (BT_HCI_LOG_INCLUDED == TRUE)
bt_hci_log_deinit();
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
return ESP_OK;
}