Skip to content

Commit 1a640e4

Browse files
niag-Oticonnashif
authored andcommitted
Bluetooth: controller: Included transport latency in LE_Big_Established
Included missing transport_latency_BIG information in HCI LE_Big_established message. Signed-off-by: Nirosharn Amarasinghe <[email protected]>
1 parent e2ec54b commit 1a640e4

File tree

1 file changed

+28
-2
lines changed
  • subsys/bluetooth/controller/hci

1 file changed

+28
-2
lines changed

subsys/bluetooth/controller/hci/hci.c

+28-2
Original file line numberDiff line numberDiff line change
@@ -7847,8 +7847,11 @@ static void le_big_sync_established(struct pdu_data *pdu,
78477847
{
78487848
struct bt_hci_evt_le_big_sync_established *sep;
78497849
struct ll_sync_iso_set *sync_iso;
7850+
uint32_t transport_latency_big;
78507851
struct node_rx_sync_iso *se;
78517852
struct lll_sync_iso *lll;
7853+
uint32_t iso_interval_us;
7854+
uint32_t big_sync_delay;
78527855
size_t evt_size;
78537856
void *node;
78547857

@@ -7877,9 +7880,32 @@ static void le_big_sync_established(struct pdu_data *pdu,
78777880
return;
78787881
}
78797882

7880-
/* FIXME: Fill latency */
7881-
sys_put_le24(0, sep->latency);
7883+
/* BT Core v5.4 - Vol 6, Part B, Section 4.4.6.4:
7884+
* BIG_Sync_Delay = (Num_BIS – 1) × BIS_Spacing + (NSE – 1) × Sub_Interval + MPT.
7885+
*
7886+
* BT Core v5.4 - Vol 6, Part G, Section 3.2.1: (Framed)
7887+
* Transport_Latenct_BIG = BIG_Sync_Delay + PTO × (NSE / BN – IRC) * ISO_Interval +
7888+
* ISO_Interval + SDU_Interval
7889+
*
7890+
* BT Core v5.4 - Vol 6, Part G, Section 3.2.2: (Unframed)
7891+
* Transport_Latenct_BIG = BIG_Sync_Delay + (PTO × (NSE / BN – IRC) + 1) * ISO_Interval -
7892+
* SDU_Interval
7893+
*/
7894+
iso_interval_us = lll->iso_interval * ISO_INT_UNIT_US;
7895+
big_sync_delay = ull_big_sync_delay(lll);
7896+
if (lll->framing) {
7897+
/* Framed */
7898+
transport_latency_big = big_sync_delay +
7899+
lll->pto * (lll->nse / lll->bn - lll->irc) *
7900+
iso_interval_us + iso_interval_us + lll->sdu_interval;
7901+
} else {
7902+
/* Unframed */
7903+
transport_latency_big = big_sync_delay +
7904+
(lll->pto * (lll->nse / lll->bn - lll->irc) + 1) *
7905+
iso_interval_us - lll->sdu_interval;
7906+
}
78827907

7908+
sys_put_le24(transport_latency_big, sep->latency);
78837909
sep->nse = lll->nse;
78847910
sep->bn = lll->bn;
78857911
sep->pto = lll->pto;

0 commit comments

Comments
 (0)