You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/04/22 08:26:17 UTC

[mynewt-nimble] 02/04: nimble/ll: Calculate min auth payload tmo with subrating

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

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

commit 8463e0e832108fad6570ad30a33e8c0041223e8d
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Fri Apr 22 00:36:39 2022 +0200

    nimble/ll: Calculate min auth payload tmo with subrating
    
    This fixes HCI/CCO/BI-39-C.
---
 nimble/controller/src/ble_ll_conn_hci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_conn_hci.c b/nimble/controller/src/ble_ll_conn_hci.c
index 8f5771a6..2ffda58a 100644
--- a/nimble/controller/src/ble_ll_conn_hci.c
+++ b/nimble/controller/src/ble_ll_conn_hci.c
@@ -1867,11 +1867,14 @@ ble_ll_conn_hci_wr_auth_pyld_tmo(const uint8_t *cmdbuf, uint8_t len,
          */
         tmo = le16toh(cmd->tmo);
         min_tmo = (uint32_t)connsm->conn_itvl * BLE_LL_CONN_ITVL_USECS;
+#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ENHANCED_CONN_UPDATE)
+        min_tmo *= connsm->subrate_factor;
+#endif
         min_tmo *= (connsm->periph_latency + 1);
         min_tmo /= 10000;
 
         if (tmo < min_tmo) {
-            rc = BLE_ERR_INV_HCI_CMD_PARMS;
+            rc = BLE_ERR_CMD_DISALLOWED;
         } else {
             connsm->auth_pyld_tmo = tmo;
             if (ble_npl_callout_is_active(&connsm->auth_pyld_timer)) {