mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-05 17:47:53 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user