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

commit b83d270a89fcb51c092bd63d4dbbd59d632a5470
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 16 11:57:58 2019 +0200

    nimble/host: Fix scan duration on legacy API with ext adv enabled
    
    Make sure duration parameter is adjusted to legacy behaviour before
    passing it to ble_gap_ext_disc.
---
 nimble/host/src/ble_gap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 9a0f003..822f498 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -4030,6 +4030,12 @@ ble_gap_disc(uint8_t own_addr_type, int32_t duration_ms,
     p.passive = disc_params->passive;
     p.window = disc_params->window;
 
+    if (duration_ms == BLE_HS_FOREVER) {
+        duration_ms = 0;
+    } else if (duration_ms == 0) {
+        duration_ms = BLE_GAP_DISC_DUR_DFLT;
+    }
+
     return ble_gap_ext_disc(own_addr_type, duration_ms/10, 0,
                           disc_params->filter_duplicates,
                           disc_params->filter_policy, disc_params->limited,

Reply via email to