mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-28 12:50:01 +00:00
Merge branch 'bugfix/stack_init_check_v-1.2' into 'nimble-1.2.0-idf'
NimBLE: Check stack status before executing stack command See merge request espressif/esp-nimble!105
This commit is contained in:
+189
-14
@@ -451,6 +451,10 @@ int
|
||||
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();
|
||||
|
||||
@@ -474,6 +478,10 @@ ble_gap_conn_find_by_addr(const ble_addr_t *addr,
|
||||
{
|
||||
struct ble_hs_conn *conn;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
conn = ble_hs_conn_find_by_addr(addr);
|
||||
@@ -521,6 +529,10 @@ ble_gap_extract_conn_cb(uint16_t conn_handle,
|
||||
int
|
||||
ble_gap_set_priv_mode(const ble_addr_t *peer_addr, uint8_t priv_mode)
|
||||
{
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
return ble_hs_pvcy_set_mode(peer_addr, priv_mode);
|
||||
}
|
||||
|
||||
@@ -533,6 +545,10 @@ ble_gap_read_le_phy(uint16_t conn_handle, uint8_t *tx_phy, uint8_t *rx_phy)
|
||||
uint8_t rsplen;
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
ble_hs_unlock();
|
||||
@@ -570,6 +586,10 @@ ble_gap_set_prefered_default_le_phy(uint8_t tx_phys_mask, uint8_t rx_phys_mask)
|
||||
uint8_t buf[BLE_HCI_LE_SET_DEFAULT_PHY_LEN];
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_hs_hci_cmd_build_le_set_default_phy(tx_phys_mask, rx_phys_mask,
|
||||
buf, sizeof(buf));
|
||||
if (rc != 0) {
|
||||
@@ -589,6 +609,10 @@ ble_gap_set_prefered_le_phy(uint16_t conn_handle, uint8_t tx_phys_mask,
|
||||
uint8_t buf[BLE_HCI_LE_SET_PHY_LEN];
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
ble_hs_unlock();
|
||||
@@ -1865,6 +1889,10 @@ 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);
|
||||
@@ -1974,6 +2002,10 @@ ble_gap_wl_set(const ble_addr_t *addrs, uint8_t white_list_count)
|
||||
return BLE_HS_ENOTSUP;
|
||||
#endif
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
#if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
|
||||
if (ble_host_rpa_enabled()) {
|
||||
return BLE_HS_ENOTSUP;
|
||||
@@ -2305,6 +2337,10 @@ ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr,
|
||||
|
||||
STATS_INC(ble_gap_stats, adv_start);
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
rc = ble_gap_adv_validate(own_addr_type, direct_addr, adv_params);
|
||||
@@ -2321,11 +2357,6 @@ ble_gap_adv_start(uint8_t own_addr_type, const ble_addr_t *direct_addr,
|
||||
}
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
rc = BLE_HS_EDISABLED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (ble_gap_is_preempted()) {
|
||||
rc = BLE_HS_EPREEMPTED;
|
||||
goto done;
|
||||
@@ -2457,6 +2488,10 @@ ble_gap_adv_set_fields(const struct ble_hs_adv_fields *adv_fields)
|
||||
uint8_t buf_sz;
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_hs_adv_set_fields(adv_fields, buf, &buf_sz, sizeof buf);
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
@@ -2481,6 +2516,10 @@ 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;
|
||||
@@ -2497,6 +2536,10 @@ ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields)
|
||||
int
|
||||
ble_gap_adv_active(void)
|
||||
{
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
return ble_gap_adv_active_instance(0);
|
||||
}
|
||||
|
||||
@@ -2651,6 +2694,10 @@ ble_gap_ext_adv_configure(uint8_t instance,
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_gap_ext_adv_params_validate(params);
|
||||
if (rc) {
|
||||
return rc;
|
||||
@@ -2717,6 +2764,10 @@ ble_gap_ext_adv_set_addr(uint8_t instance, const ble_addr_t *addr)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_ext_adv_set_addr_no_lock(instance, addr->val);
|
||||
ble_hs_unlock();
|
||||
@@ -2737,6 +2788,10 @@ ble_gap_ext_adv_start(uint8_t instance, int duration, int max_events)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
if (!ble_gap_slave[instance].configured) {
|
||||
ble_hs_unlock();
|
||||
@@ -2871,6 +2926,10 @@ ble_gap_ext_adv_stop(uint8_t instance)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_ext_adv_stop_no_lock(instance);
|
||||
ble_hs_unlock();
|
||||
@@ -3018,6 +3077,10 @@ ble_gap_ext_adv_set_data(uint8_t instance, struct os_mbuf *data)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_ext_adv_set_data_validate(instance, data);
|
||||
if (rc != 0) {
|
||||
@@ -3085,6 +3148,10 @@ ble_gap_ext_adv_rsp_set_data(uint8_t instance, struct os_mbuf *data)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_ext_adv_rsp_set_validate(instance, data);
|
||||
if (rc != 0) {
|
||||
@@ -3113,6 +3180,10 @@ ble_gap_ext_adv_remove(uint8_t instance)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
if (!ble_gap_slave[instance].configured) {
|
||||
ble_hs_unlock();
|
||||
@@ -3151,6 +3222,10 @@ ble_gap_ext_adv_clear(void)
|
||||
uint8_t instance;
|
||||
uint16_t opcode;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
for (instance = 0; instance < BLE_ADV_INSTANCES; instance++) {
|
||||
@@ -3254,6 +3329,10 @@ ble_gap_periodic_adv_configure(uint8_t instance,
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_gap_periodic_adv_params_validate(params);
|
||||
if (rc) {
|
||||
return rc;
|
||||
@@ -3300,6 +3379,10 @@ ble_gap_periodic_adv_start(uint8_t instance)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
/* Periodic advertising cannot start unless it is configured before */
|
||||
@@ -3461,6 +3544,10 @@ ble_gap_periodic_adv_set_data(uint8_t instance, struct os_mbuf *data)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
rc = ble_gap_periodic_adv_set_data_validate(instance, data);
|
||||
@@ -3512,6 +3599,10 @@ ble_gap_periodic_adv_stop(uint8_t instance)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_periodic_adv_stop_no_lock(instance);
|
||||
ble_hs_unlock();
|
||||
@@ -3557,6 +3648,10 @@ ble_gap_periodic_adv_create_sync(const ble_addr_t *addr, uint8_t adv_sid,
|
||||
uint16_t opcode;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
/* No sync can be created if another sync is still pending */
|
||||
@@ -3622,6 +3717,10 @@ ble_gap_periodic_adv_create_sync_cancel(void)
|
||||
uint16_t opcode;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
if (ble_gap_sync.op != BLE_GAP_OP_SYNC) {
|
||||
@@ -3655,6 +3754,10 @@ ble_gap_periodic_adv_terminate_sync(uint16_t sync_handle)
|
||||
struct ble_hs_periodic_sync *psync;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
if (ble_gap_sync.op == BLE_GAP_OP_SYNC) {
|
||||
@@ -3707,6 +3810,10 @@ ble_gap_add_dev_to_periodic_adv_list(const ble_addr_t *peer_addr,
|
||||
uint16_t opcode;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
opcode = BLE_HCI_OP(BLE_HCI_OGF_LE,
|
||||
BLE_HCI_OCF_LE_ADD_DEV_TO_PERIODIC_ADV_LIST);
|
||||
|
||||
@@ -3730,6 +3837,10 @@ ble_gap_rem_dev_from_periodic_adv_list(const ble_addr_t *peer_addr, uint8_t adv_
|
||||
uint16_t opcode;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
opcode = BLE_HCI_OP(BLE_HCI_OGF_LE,
|
||||
BLE_HCI_OCF_LE_REM_DEV_FROM_PERIODIC_ADV_LIST);
|
||||
|
||||
@@ -3752,6 +3863,10 @@ ble_gap_clear_periodic_adv_list(void)
|
||||
uint16_t opcode;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
opcode = BLE_HCI_OP(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_CLEAR_PERIODIC_ADV_LIST);
|
||||
|
||||
rc = ble_hs_hci_cmd_tx_empty_ack(opcode, NULL, 0);
|
||||
@@ -3767,6 +3882,10 @@ ble_gap_read_periodic_adv_list_size(uint8_t *per_adv_list_size)
|
||||
uint16_t opcode;
|
||||
int rc = 0;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
opcode = BLE_HCI_OP(BLE_HCI_OGF_LE, BLE_HCI_OCF_LE_RD_PERIODIC_ADV_LIST_SIZE);
|
||||
|
||||
rc = ble_hs_hci_cmd_tx(opcode, NULL, 0, rspbuf, sizeof(rspbuf), &rsplen);
|
||||
@@ -3951,6 +4070,10 @@ ble_gap_disc_cancel(void)
|
||||
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_disc_cancel_no_lock();
|
||||
ble_hs_unlock();
|
||||
@@ -4045,6 +4168,10 @@ ble_gap_ext_disc(uint8_t own_addr_type, uint16_t duration, uint16_t period,
|
||||
|
||||
STATS_INC(ble_gap_stats, discover);
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
rc = ble_gap_disc_ext_validate(own_addr_type);
|
||||
@@ -4155,6 +4282,10 @@ ble_gap_disc(uint8_t own_addr_type, int32_t duration_ms,
|
||||
return BLE_HS_ENOTSUP;
|
||||
#else
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
#if MYNEWT_VAL(BLE_EXT_ADV)
|
||||
struct ble_gap_ext_disc_params p = {0};
|
||||
|
||||
@@ -4247,6 +4378,10 @@ done:
|
||||
int
|
||||
ble_gap_disc_active(void)
|
||||
{
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
/* Assume read is atomic; mutex not necessary. */
|
||||
return ble_gap_master.op == BLE_GAP_OP_M_DISC;
|
||||
}
|
||||
@@ -4447,6 +4582,10 @@ ble_gap_ext_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
|
||||
|
||||
STATS_INC(ble_gap_stats, initiate);
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
if (ble_gap_conn_active()) {
|
||||
@@ -4459,10 +4598,6 @@ ble_gap_ext_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
if (ble_gap_is_preempted()) {
|
||||
rc = BLE_HS_EPREEMPTED;
|
||||
goto done;
|
||||
@@ -4563,6 +4698,10 @@ ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
|
||||
#if !MYNEWT_VAL(BLE_ROLE_CENTRAL)
|
||||
return BLE_HS_ENOTSUP;
|
||||
#endif
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
#if MYNEWT_VAL(BLE_EXT_ADV)
|
||||
return ble_gap_ext_connect(own_addr_type, peer_addr, duration_ms,
|
||||
@@ -4586,11 +4725,6 @@ ble_gap_connect(uint8_t own_addr_type, const ble_addr_t *peer_addr,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
rc = BLE_HS_EDISABLED;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (ble_gap_is_preempted()) {
|
||||
rc = BLE_HS_EPREEMPTED;
|
||||
goto done;
|
||||
@@ -4678,6 +4812,11 @@ done:
|
||||
int
|
||||
ble_gap_conn_active(void)
|
||||
{
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
/* Assume read is atomic; mutex not necessary. */
|
||||
return ble_gap_master.op == BLE_GAP_OP_M_CONN;
|
||||
}
|
||||
@@ -4695,6 +4834,10 @@ ble_gap_terminate(uint16_t conn_handle, uint8_t hci_reason)
|
||||
|
||||
STATS_INC(ble_gap_stats, terminate);
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
@@ -4795,6 +4938,10 @@ ble_gap_conn_cancel(void)
|
||||
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
rc = ble_gap_conn_cancel_no_lock();
|
||||
ble_hs_unlock();
|
||||
@@ -5084,6 +5231,10 @@ ble_gap_update_params(uint16_t conn_handle,
|
||||
memset(&l2cap_params, 0, sizeof l2cap_params);
|
||||
entry = NULL;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
@@ -5170,6 +5321,10 @@ ble_gap_security_initiate(uint16_t conn_handle)
|
||||
|
||||
STATS_INC(ble_gap_stats, security_initiate);
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
if (conn != NULL) {
|
||||
@@ -5228,6 +5383,10 @@ ble_gap_pair_initiate(uint16_t conn_handle)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_sm_pair_initiate(conn_handle);
|
||||
|
||||
return rc;
|
||||
@@ -5248,6 +5407,10 @@ ble_gap_encryption_initiate(uint16_t conn_handle,
|
||||
ble_hs_conn_flags_t conn_flags;
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_hs_atomic_conn_flags(conn_handle, &conn_flags);
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
@@ -5271,6 +5434,10 @@ ble_gap_unpair(const ble_addr_t *peer_addr)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
ble_hs_lock();
|
||||
|
||||
conn = ble_hs_conn_find_by_addr(peer_addr);
|
||||
@@ -5293,6 +5460,10 @@ ble_gap_unpair_oldest_peer(void)
|
||||
int num_peers;
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_store_util_bonded_peers(
|
||||
&oldest_peer_id_addr, &num_peers, 1);
|
||||
if (rc != 0) {
|
||||
@@ -5443,6 +5614,10 @@ ble_gap_conn_rssi(uint16_t conn_handle, int8_t *out_rssi)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (!ble_hs_is_enabled()) {
|
||||
return BLE_HS_EDISABLED;
|
||||
}
|
||||
|
||||
rc = ble_hs_hci_util_read_rssi(conn_handle, out_rssi);
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user