fix(blufi): Fix BLUFI NimBLE deinit race due to disconnect callbacks

This commit is contained in:
Rahul Tank
2026-05-09 20:59:55 +05:30
parent 938ce4f4d1
commit 56fa9afcda
2 changed files with 9 additions and 0 deletions

View File

@@ -316,6 +316,11 @@ static void btc_thread_handler(void *arg)
static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
{
if (btc_thread == NULL) {
BTC_TRACE_WARNING("%s btc_thread is NULL\n", __func__);
return BT_STATUS_NOT_READY;
}
if (osi_thread_post(btc_thread, btc_thread_handler, msg, 0, timeout) == false) {
return BT_STATUS_BUSY;
}

View File

@@ -502,6 +502,10 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
blufi_env.aggr_buf = NULL;
}
if (!blufi_env.enabled) {
return 0;
}
btc_msg_t msg;
esp_blufi_cb_param_t param;