You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/01/21 13:22:22 UTC

[GitHub] [mynewt-nimble] sjanc opened a new pull request #735: nimble/ll: Fix HCI checks for periodic advertising

sjanc opened a new pull request #735: nimble/ll: Fix HCI checks for periodic advertising
URL: https://github.com/apache/mynewt-nimble/pull/735
 
 
   Core Specification 5.2 clarified HCI behavior for periodic advertising
   with regards to reconfiguring advertising instance and checking
   data length against periodic advertising interval.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-nimble] sjanc merged pull request #735: nimble/ll: Fix HCI checks for periodic advertising

Posted by GitBox <gi...@apache.org>.
sjanc merged pull request #735: nimble/ll: Fix HCI checks for periodic advertising
URL: https://github.com/apache/mynewt-nimble/pull/735
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

[GitHub] [mynewt-nimble] andrzej-kaczmarek commented on a change in pull request #735: nimble/ll: Fix HCI checks for periodic advertising

Posted by GitBox <gi...@apache.org>.
andrzej-kaczmarek commented on a change in pull request #735: nimble/ll: Fix HCI checks for periodic advertising
URL: https://github.com/apache/mynewt-nimble/pull/735#discussion_r370358262
 
 

 ##########
 File path: nimble/controller/src/ble_ll_adv.c
 ##########
 @@ -3605,7 +3598,35 @@ ble_ll_adv_clear_all(void)
 
     return BLE_ERR_SUCCESS;
 }
+
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV)
+static bool
+ble_ll_adv_periodic_check_data_itvl(struct ble_ll_adv_sm *advsm,
+                                    uint16_t payload_len, uint16_t itvl)
+{
+    uint32_t max_usecs = 0;
+    uint32_t chain_usecs;
+    uint32_t itvl_usecs;
+
+    /* this is max PDU + MAFS + MAFS_DELAY, this needs to be summed up for each
+     * chain PDU
+     */
+    chain_usecs = ble_ll_pdu_tx_time_get(BLE_PHY_MAX_PDU_LEN, advsm->sec_phy) +
+                  ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS +
+                                MYNEWT_VAL(BLE_LL_SCHED_AUX_CHAIN_MAFS_DELAY));
+
+    while (payload_len > BLE_PHY_MAX_PDU_LEN) {
+        max_usecs += chain_usecs;
+        payload_len -= BLE_PHY_MAX_PDU_LEN;
+    }
+
+    max_usecs += ble_ll_pdu_tx_time_get(payload_len, advsm->sec_phy);
+
+    itvl_usecs = (uint32_t)itvl * BLE_LL_ADV_PERIODIC_ITVL;
+
+    return max_usecs < itvl_usecs;
 
 Review comment:
   `max_usecs` is not calculated properly. `payload_len` is just length of data, but the actual payload of each PDU includes also ext adv header so there's more data to send thus it will take more usecs.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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