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.
This commit is contained in:
Rahul Tank
2022-02-22 13:53:29 +05:30
parent ff9ebc925b
commit 39f78690da
-12
View File
@@ -487,10 +487,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);
@@ -2216,10 +2212,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);
@@ -2826,10 +2818,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;