You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2026/10/28 20:25:05 UTC

(mynewt-nimble) 02/07: nimble/ll: Retry connection parameters request after collision

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

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

commit 0339f0b44dbe1cbe823ec26fee4a340bfa1314a2
Author: Gerard Marull-Paretas <ge...@teslabs.com>
AuthorDate: Tue Oct 13 21:18:50 2026 +0200

    nimble/ll: Retry connection parameters request after collision
    
    When a central rejects the connection parameters request with
    Different Transaction Collision, it has its own procedure with instant
    in progress. If that instant is known to the peripheral, keep the
    request pending and send it again once the instant has passed instead
    of failing it back to the host.
    
    This happens when both procedures cross on air, which is likely with a
    high peripheral latency since the peripheral may not hear the central's
    request until it transmits its own.
---
 nimble/controller/src/ble_ll_ctrl.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/nimble/controller/src/ble_ll_ctrl.c b/nimble/controller/src/ble_ll_ctrl.c
index 61c04e9ab..7590d6ca3 100644
--- a/nimble/controller/src/ble_ll_ctrl.c
+++ b/nimble/controller/src/ble_ll_ctrl.c
@@ -2065,6 +2065,17 @@ ble_ll_ctrl_rx_reject_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
         #endif
         #if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
             case BLE_LL_CONN_ROLE_PERIPHERAL:
+                /*
+                 * The central rejected the request because of its own
+                 * procedure with instant, retry once that instant has passed.
+                 */
+                if ((ble_error == BLE_ERR_DIFF_TRANS_COLL) &&
+                    ble_ll_ctrl_instant_pending(connsm)) {
+                    ble_npl_callout_stop(&connsm->ctrl_proc_rsp_timer);
+                    connsm->cur_ctrl_proc = BLE_LL_CTRL_PROC_IDLE;
+                    break;
+                }
+
                 ble_ll_ctrl_proc_stop(connsm, BLE_LL_CTRL_PROC_CONN_PARAM_REQ);
                 ble_ll_hci_ev_conn_update(connsm, ble_error);
                 break;