Skip to content

Commit 707604e

Browse files
committed
Bluetooth: Controller: Re-grouping conn updates of same interval
Add implementation to find free connection offsets after a connection of same interval. This is re-group connection of same interval when Connection Parameter Request procedure is performed from different connection intervals. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent dd56a8e commit 707604e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

subsys/bluetooth/controller/ll_sw/ull_sched.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,9 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
434434
uint8_t ticker_id;
435435
uint16_t offset;
436436

437+
bool is_conn_interval = false;
438+
bool is_after_conn_interval = false;
439+
437440
#if defined(CONFIG_BT_CTLR_LOW_LAT)
438441
#if defined(CONFIG_BT_CTLR_XTAL_ADVANCED)
439442
if (conn_curr->ull.ticks_prepare_to_start & XON_BITMASK) {
@@ -564,6 +567,8 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
564567
if (is_select &&
565568
(conn->lll.interval != conn_interval)) {
566569
ticks_slot_abs_curr += ticks_slot_abs;
570+
} else if (is_select) {
571+
is_conn_interval = true;
567572
}
568573

569574
if (conn->lll.role) {
@@ -573,7 +578,8 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
573578
}
574579
}
575580

576-
if (*ticks_to_offset_next < ticks_to_expire_normal) {
581+
if ((!is_select || is_after_conn_interval) &&
582+
(*ticks_to_offset_next < ticks_to_expire_normal)) {
577583
if (ticks_to_expire_prev <
578584
*ticks_to_offset_next) {
579585
ticks_to_expire_prev =
@@ -609,6 +615,10 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
609615
*ticks_to_offset_next = ticks_to_expire_prev;
610616
}
611617

618+
if (is_conn_interval) {
619+
is_after_conn_interval = true;
620+
}
621+
612622
ticks_slot_abs_curr += ticks_slot;
613623

614624
ticks_to_expire_prev = ticks_to_expire_normal;
@@ -625,7 +635,7 @@ static void win_offset_calc(struct ll_conn *conn_curr, uint8_t is_select,
625635
(ticks_to_expire_prev + ticks_slot_abs_prev),
626636
HAL_TICKER_US_TO_TICKS(CONN_INT_UNIT_US));
627637
if (offset >= conn_interval) {
628-
if (!is_select) {
638+
if (!is_select || !is_after_conn_interval) {
629639
break;
630640
}
631641

0 commit comments

Comments
 (0)