From a2eaddb4bcbb177a68f1feb6b43170ce31ea995f Mon Sep 17 00:00:00 2001 From: Maciej Baczmanski Date: Mon, 27 Jan 2025 08:44:09 +0100 Subject: [PATCH] [nrf fromtree] net: openthread: fix `otPlatBleEnable` If BLE has already been enabled, `bt_enable` returns immediately and does not call passed callback function. In this case, call `bt_conn_cb_register` to ensure that callbacks are registered correctly. Signed-off-by: Maciej Baczmanski (cherry picked from commit 1bd8e4459ae161588c5310600dca991bf8d4dbec) --- modules/openthread/platform/ble.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openthread/platform/ble.c b/modules/openthread/platform/ble.c index c831b402c56..1ccb07c2ec3 100644 --- a/modules/openthread/platform/ble.c +++ b/modules/openthread/platform/ble.c @@ -476,7 +476,7 @@ otError otPlatBleEnable(otInstance *aInstance) LOG_WRN("BLE enable failed with error code %d", err); return OT_ERROR_FAILED; } else if (err == -EALREADY) { - err = k_sem_take(&ot_plat_ble_init_semaphore, K_MSEC(500)); + bt_conn_cb_register(&conn_callbacks); return OT_ERROR_NONE; }