Skip to content

Commit 37b79ff

Browse files
andrzej-kaczmarekcarlescufi
authored andcommitted
Bluetooth: controller: Fix 1st connection event offset
We need to take RX chain delay and PHY used to send CONNECT_IND into account when calculating 1st connection event offset. Signed-off-by: Andrzej Kaczmarek <[email protected]>
1 parent 2ab25f6 commit 37b79ff

File tree

1 file changed

+4
-2
lines changed
  • subsys/bluetooth/controller/ll_sw/nordic/lll

1 file changed

+4
-2
lines changed

subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ void lll_scan_prepare_connect_req(struct lll_scan *lll, struct pdu_adv *pdu_tx,
144144
pdu_tx->connect_ind.win_size = 1;
145145

146146
conn_interval_us = (uint32_t)lll_conn->interval * CONN_INT_UNIT_US;
147-
conn_offset_us = radio_tmr_end_get() + 502;
147+
conn_offset_us = radio_tmr_end_get() + EVENT_IFS_US +
148+
PKT_AC_US(sizeof(struct pdu_adv_connect_ind), 0,
149+
phy == PHY_LEGACY ? PHY_1M : phy);
148150

149151
/* Add transmitWindowDelay to default calculated connection offset:
150152
* 1.25ms for a legacy PDU, 2.5ms for an LE Uncoded PHY and 3.75ms for
@@ -981,7 +983,7 @@ static inline int isr_rx_pdu(struct lll_scan *lll, struct pdu_adv *pdu_adv_rx,
981983
ftr->param = lll;
982984
ftr->ticks_anchor = radio_tmr_start_get();
983985
ftr->radio_end_us = conn_space_us -
984-
radio_tx_chain_delay_get(0, 0);
986+
radio_rx_chain_delay_get(PHY_1M, 0);
985987

986988
#if defined(CONFIG_BT_CTLR_PRIVACY)
987989
ftr->rl_idx = irkmatch_ok ? rl_idx : FILTER_IDX_NONE;

0 commit comments

Comments
 (0)