Skip to content

Commit ca220e4

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: Fix tertiary PDU and extended header length
Fix the tertiary PDU and extended header length value after the refactoring in the commit c8475b9 ("Bluetooth: controller: ULL: enable TX of CTE with per. adv. PDU"). Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent d8283b6 commit ca220e4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

subsys/bluetooth/controller/ll_sw/ull_adv_sync.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags)
9494
struct pdu_adv *ter_pdu;
9595
struct lll_adv *lll;
9696
uint8_t *ter_dptr;
97+
uint8_t ter_len;
9798
int err;
9899

99100
sync = sync_acquire();
@@ -139,16 +140,19 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags)
139140
ter_pdu->tx_addr = 0U;
140141
ter_pdu->rx_addr = 0U;
141142

142-
ter_pdu->len = offsetof(struct pdu_adv_com_ext_adv,
143-
ext_hdr_adv_data);
144-
145143
ter_com_hdr = (void *)&ter_pdu->adv_ext_ind;
146144
ter_hdr = (void *)ter_com_hdr->ext_hdr_adv_data;
147145
ter_dptr = ter_hdr->data;
148146
*(uint8_t *)ter_hdr = 0U;
149147

150148
/* Non-connectable and Non-scannable adv mode */
151149
ter_com_hdr->adv_mode = 0U;
150+
151+
/* Calc tertiary PDU len */
152+
ter_len = ull_adv_aux_hdr_len_calc(ter_com_hdr, &ter_dptr);
153+
ull_adv_aux_hdr_len_fill(ter_com_hdr, ter_len);
154+
155+
ter_pdu->len = ter_len;
152156
} else {
153157
sync = (void *)HDR_LLL2EVT(lll_sync);
154158
}

0 commit comments

Comments
 (0)