From 1dc1ec6e76b0ab3bf93cc9f1ff7a2a09141e7c61 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 056869fcc..09a362772 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -482,10 +482,6 @@ ble_gap_conn_find(uint16_t handle, struct ble_gap_conn_desc *out_desc) { struct ble_hs_conn *conn; - if (!ble_hs_is_enabled()) { - return BLE_HS_EDISABLED; - } - ble_hs_lock(); conn = ble_hs_conn_find(handle); @@ -2147,10 +2143,6 @@ ble_gap_set_event_cb(uint16_t conn_handle, ble_gap_event_fn *cb, void *cb_arg) { struct ble_hs_conn *conn; - if (!ble_hs_is_enabled()) { - return BLE_HS_EDISABLED; - } - ble_hs_lock(); conn = ble_hs_conn_find(conn_handle); @@ -2754,10 +2746,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;