You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2019/05/13 22:25:09 UTC

[mynewt-nimble] branch master updated: nimble/gap: Allow reconfiguring extended adv instance

This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 35cfbbe  nimble/gap: Allow reconfiguring extended adv instance
35cfbbe is described below

commit 35cfbbe74618d630745fa1e99a045d453061bc2c
Author: Mohamed Essayed <mo...@synopsys.com>
AuthorDate: Tue Apr 16 13:14:45 2019 +0200

    nimble/gap: Allow reconfiguring extended adv instance
---
 nimble/host/src/ble_gap.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 5058504..128a17f 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -2510,7 +2510,7 @@ ble_gap_ext_adv_configure(uint8_t instance,
     int rc;
 
     if (instance >= BLE_ADV_INSTANCES) {
-        return EINVAL;
+        return BLE_HS_EINVAL;
     }
 
     rc = ble_gap_ext_adv_params_validate(params);
@@ -2520,10 +2520,9 @@ ble_gap_ext_adv_configure(uint8_t instance,
 
     ble_hs_lock();
 
-    /* TODO should we allow to reconfigure existing instance? */
-    if (ble_gap_slave[instance].configured) {
+    if (ble_gap_adv_active_instance(instance)) {
         ble_hs_unlock();
-        return ENOMEM;
+        return BLE_HS_EBUSY;
     }
 
     rc = ble_gap_ext_adv_params_tx(instance, params, selected_tx_power);