You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by gi...@git.apache.org on 2017/10/05 10:16:10 UTC

[GitHub] sjanc commented on a change in pull request #601: nimble/ll: Fix AUX_ADV_IND packets handling during advertising

sjanc commented on a change in pull request #601: nimble/ll: Fix AUX_ADV_IND packets handling during advertising
URL: https://github.com/apache/mynewt-core/pull/601#discussion_r142898579
 
 

 ##########
 File path: net/nimble/controller/src/ble_ll_adv.c
 ##########
 @@ -1310,20 +1308,40 @@ ble_ll_set_adv_secondary_start_time(struct ble_ll_adv_sm *advsm)
 {
     static const uint8_t bits[8] = {0, 1, 1, 2, 1, 2, 2, 3};
     struct ble_ll_sched_item *sched = &advsm->adv_sch;
-    uint32_t ext_duration;
+    uint32_t adv_pdu_dur;
+    uint32_t adv_event_dur;
     uint8_t chans;
 
     assert(advsm->adv_chanmask <= BLE_HCI_ADV_CHANMASK_DEF);
 
     chans = bits[advsm->adv_chanmask];
 
-    ext_duration = (int32_t)(sched->end_time - sched->start_time);
-    ext_duration *= chans;
-    ext_duration += os_cputime_usecs_to_ticks(BLE_LL_IFS) * (chans -1);
+    /*
+     * We want to schedule auxiliary packet as soon as possible after the end
+     * of advertising event, but no sooner than T_MAFS. The interval between
+     * advertising packets is 250 usecs (8.19 ticks) on LE Coded and a bit less
+     * on 1M, but it can vary a bit due to scheduling which we can't really
+     * control. Since we round ticks up for both interval and T_MAFS, we still
+     * have some margin here. The worst thing that can happen is that we skip
+     * last advertising packet which is not a bit problem so leave it as-is, no
+     * need to make code more complicated.
+     */
 
 Review comment:
   we could have stats for this
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services