Skip to content

Commit 1598c89

Browse files
Bluetooth: controller: Add helper to update CTEInfo
This adds simple helper to update CTEInfo. It assumes proper periodic adv PDU as input to simplify code. Signed-off-by: Andrzej Kaczmarek <[email protected]>
1 parent 41a2e2f commit 1598c89

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

subsys/bluetooth/controller/ll_sw/ull_adv_sync.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,28 @@ static uint8_t adv_sync_pdu_ad_data_set(struct pdu_adv *pdu,
271271
return 0;
272272
}
273273

274+
static uint8_t adv_sync_pdu_cte_info_set(struct pdu_adv *pdu,
275+
const struct pdu_cte_info *cte_info)
276+
{
277+
struct pdu_adv_com_ext_adv *com_hdr;
278+
struct pdu_adv_ext_hdr *ext_hdr;
279+
uint8_t *dptr;
280+
281+
com_hdr = &pdu->adv_ext_ind;
282+
ext_hdr = &com_hdr->ext_hdr;
283+
dptr = &com_hdr->ext_hdr_adv_data[com_hdr->ext_hdr_len];
284+
285+
/* Periodic adv PDUs do not have AdvA/TargetA */
286+
LL_ASSERT(!ext_hdr->adv_addr);
287+
LL_ASSERT(!ext_hdr->tgt_addr);
288+
289+
if (ext_hdr->cte_info) {
290+
memcpy(dptr, cte_info, sizeof(*cte_info));
291+
}
292+
293+
return 0;
294+
}
295+
274296
#if defined(CONFIG_BT_CTLR_ADV_PDU_LINK)
275297
static void adv_sync_pdu_duplicate_chain(struct pdu_adv *pdu,
276298
struct pdu_adv *pdu_prev)

0 commit comments

Comments
 (0)