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/08/05 08:33:31 UTC

[mynewt-nimble] branch master updated (3bb185da -> 346a3205)

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

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


    from 3bb185da nimble/phy/nrf: Wait for CCM to finish decryption
     new 0f8cfaa4 nimble/ll/css: Fix window offset for 1st connection event
     new 346a3205 nimble/ll: Fix assert on connection event end

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nimble/controller/src/ble_ll_conn.c  | 14 --------------
 nimble/controller/src/ble_ll_sched.c | 12 ++++++++++--
 2 files changed, 10 insertions(+), 16 deletions(-)


[mynewt-nimble] 01/02: nimble/ll/css: Fix window offset for 1st connection event

Posted by an...@apache.org.
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 0f8cfaa4c2c68f10e7369ac7e733627e74e3fc3c
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Aug 2 16:03:02 2022 +0200

    nimble/ll/css: Fix window offset for 1st connection event
    
    Depending on timing, connection anchor point calculated for current
    period and requested slot might have already passed at the time
    advertising PDU is received and this causes window offset to be
    calculated incorrectly. In such case we just move connection to next
    period and recalculate anchor point again.
---
 nimble/controller/src/ble_ll_sched.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index 036a3518..5456e8e2 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -516,9 +516,17 @@ ble_ll_sched_conn_central_new(struct ble_ll_conn_sm *connsm,
             max_delay = 0;
         }
 
-        ble_ll_sched_css_set_conn_anchor(connsm);
+        /* It's possible that calculated anchor point in current period has
+         * already passed, so just move to next period and recalculate.
+         */
+        connsm->css_period_idx--;
+        do {
+            connsm->css_period_idx++;
+            ble_ll_sched_css_set_conn_anchor(connsm);
+            sch->start_time =
+                    connsm->anchor_point - g_ble_ll_sched_offset_ticks;
+        } while (LL_TMR_LT(sch->start_time, orig_start_time));
 
-        sch->start_time = connsm->anchor_point - g_ble_ll_sched_offset_ticks;
         sch->end_time = connsm->anchor_point;
         sch->remainder = connsm->anchor_point_usecs;
 


[mynewt-nimble] 02/02: nimble/ll: Fix assert on connection event end

Posted by an...@apache.org.
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 346a32053ed1f787c7beb8f605ace450996694bd
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Tue Aug 2 16:07:12 2022 +0200

    nimble/ll: Fix assert on connection event end
    
    This was missing in 16f1e4d7, i.e. since we now close connection event
    in that case, we should also allow to move to next conn event
    gracefully.
---
 nimble/controller/src/ble_ll_conn.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index ec758bff..564c6cf8 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -2817,20 +2817,6 @@ ble_ll_conn_event_end(struct ble_npl_event *ev)
     /* Better be a connection state machine! */
     connsm = (struct ble_ll_conn_sm *)ble_npl_event_get_arg(ev);
     BLE_LL_ASSERT(connsm);
-    if (connsm->conn_state == BLE_LL_CONN_STATE_IDLE) {
-        /* That should not happen. If it does it means connection
-         * is already closed.
-         * Make sure LL state machine is in idle
-         */
-        STATS_INC(ble_ll_conn_stats, sched_end_in_idle);
-        BLE_LL_ASSERT(0);
-
-        /* Just in case */
-        ble_ll_state_set(BLE_LL_STATE_STANDBY);
-
-        ble_ll_scan_chk_resume();
-        return;
-    }
 
     /* Log event end */
     ble_ll_trace_u32x2(BLE_LL_TRACE_ID_CONN_EV_END, connsm->conn_handle,