diff --git a/porting/nimble/src/nimble_port.c b/porting/nimble/src/nimble_port.c index 50b3b596a..67f5d98f1 100644 --- a/porting/nimble/src/nimble_port.c +++ b/porting/nimble/src/nimble_port.c @@ -52,6 +52,9 @@ #endif #include "bt_osal.h" #include "bt_prf_task.h" +#if CONFIG_BLE_LOG_ENABLED && !CONFIG_BT_CONTROLLER_ENABLED +#include "ble_log.h" +#endif #define NIMBLE_PORT_LOG_TAG "BLE_INIT" @@ -229,6 +232,12 @@ esp_err_t esp_nimble_init(void) } #endif +#if CONFIG_BLE_LOG_ENABLED && !CONFIG_BT_CONTROLLER_ENABLED + if (!ble_log_init()) { + ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE Log init failed"); + } +#endif + return ESP_OK; } @@ -246,6 +255,10 @@ esp_err_t esp_nimble_deinit(void) ble_npl_deiniting = true; #endif +#if CONFIG_BLE_LOG_ENABLED && !CONFIG_BT_CONTROLLER_ENABLED + ble_log_deinit(); +#endif + ble_transport_ll_deinit(); #if (BT_HCI_LOG_INCLUDED == TRUE)