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 d447bbc  nimble/ll: Update DID when enabling or disabling periodic 
advertising
d447bbc is described below

commit d447bbc4b44f9dabf3af3088f3f28cb1383812e5
Author: Szymon Janc <[email protected]>
AuthorDate: Fri Jun 14 13:47:40 2019 +0200

    nimble/ll: Update DID when enabling or disabling periodic advertising
    
    The Advertising DID is not required to change when a SyncInfo field is
    added to or removed from an advertising set. However, if it does not
    change, then scanners may fail to synchronize to periodic advertising
    because entries in the Advertising DID cache (see Section 4.3.3) mean
    they ignore the advertisements containing the SyncInfo field. Therefore,
    advertisers should update the Advertising DID when a periodic advertising
    train is enabled. Alternatively, the Host should enable periodic
    advertising before enabling advertising.
---
 nimble/controller/src/ble_ll_adv.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/nimble/controller/src/ble_ll_adv.c 
b/nimble/controller/src/ble_ll_adv.c
index 613df42..eecab15 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -2382,6 +2382,17 @@ ble_ll_adv_sm_start_periodic(struct ble_ll_adv_sm *advsm)
     uint32_t usecs;
     uint32_t ticks;
 
+    /*
+     * The Advertising DID is not required to change when a SyncInfo field is
+     * added to or removed from an advertising set. However, if it does not
+     * change, then scanners may fail to synchronize to periodic advertising
+     * because entries in the Advertising DID cache (see Section 4.3.3) mean
+     * they ignore the advertisements containing the SyncInfo field. Therefore,
+     * advertisers should update the Advertising DID when a periodic 
advertising
+     * train is enabled.
+     */
+    ble_ll_adv_update_did(advsm);
+
     advsm->periodic_adv_active = 1;
 
     /* keep channel map since we cannot change it later on */
@@ -2425,6 +2436,18 @@ ble_ll_adv_sm_stop_periodic(struct ble_ll_adv_sm *advsm)
         return;
     }
 
+    /*
+     * The Advertising DID is not required to change when a SyncInfo field is
+     * added to or removed from an advertising set. However, if it does not
+     * change, then scanners may unnecessary try to synchronize to instance 
that
+     * no longer has periodic advertising enabled  because entries in the
+     * Advertising DID cache (see Section 4.3.3) mean they ignore the
+     * advertisements no longer containing the SyncInfo field. Therefore,
+     * advertisers should update the Advertising DID when a periodic 
advertising
+     * train is disabled.
+     */
+    ble_ll_adv_update_did(advsm);
+
     /* Remove any scheduled advertising items */
     advsm->periodic_adv_active = 0;
     advsm->periodic_sync_active = 0;

Reply via email to