From 20c3ed12e3c63b6ec04dc508cfb5ecee0b47f435 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Tue, 16 Nov 2021 19:38:35 +0530 Subject: [PATCH] Nimble: Check stack initialization status before executing stack command Previous commit added checks in some functions that can be called without stack initalization. Corrected such instances. --- nimble/host/src/ble_gap.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 0a00e71f3..125ae92a7 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -497,10 +497,6 @@ ble_gap_conn_find(uint16_t handle, struct ble_gap_conn_desc *out_desc) #if NIMBLE_BLE_CONNECT struct ble_hs_conn *conn; - if (!ble_hs_is_enabled()) { - return BLE_HS_EDISABLED; - } - ble_hs_lock(); conn = ble_hs_conn_find(handle); @@ -2380,10 +2376,6 @@ ble_gap_set_event_cb(uint16_t conn_handle, ble_gap_event_fn *cb, void *cb_arg) #if NIMBLE_BLE_CONNECT struct ble_hs_conn *conn; - if (!ble_hs_is_enabled()) { - return BLE_HS_EDISABLED; - } - ble_hs_lock(); conn = ble_hs_conn_find(conn_handle); @@ -2990,10 +2982,6 @@ ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields) uint8_t buf_sz; int rc; - if (!ble_hs_is_enabled()) { - return BLE_HS_EDISABLED; - } - rc = ble_hs_adv_set_fields(rsp_fields, buf, &buf_sz, sizeof buf); if (rc != 0) { return rc;