Skip to content

Commit

Permalink
[nrf fromtree] net: openthread: fix otPlatBleEnable
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 1bd8e4459ae161588c5310600dca991bf8d4dbec)
  • Loading branch information
maciejbaczmanski authored and rlubos committed Jan 31, 2025
1 parent 471e0a9 commit a2eaddb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/openthread/platform/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a2eaddb

Please sign in to comment.