Skip to content

Commit aa6b202

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 62e7194 commit aa6b202

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
@@ -267,6 +267,28 @@ static uint8_t adv_sync_pdu_ad_data_set(struct pdu_adv *pdu,
267267
return 0;
268268
}
269269

270+
static uint8_t adv_sync_pdu_cte_info_set(struct pdu_adv *pdu,
271+
const struct pdu_cte_info *cte_info)
272+
{
273+
struct pdu_adv_com_ext_adv *com_hdr;
274+
struct pdu_adv_ext_hdr *ext_hdr;
275+
uint8_t *dptr;
276+
277+
com_hdr = &pdu->adv_ext_ind;
278+
ext_hdr = &com_hdr->ext_hdr;
279+
dptr = ext_hdr->data;
280+
281+
/* Periodic adv PDUs do not have AdvA/TargetA */
282+
LL_ASSERT(!ext_hdr->adv_addr);
283+
LL_ASSERT(!ext_hdr->tgt_addr);
284+
285+
if (ext_hdr->cte_info) {
286+
memcpy(dptr, cte_info, sizeof(*cte_info));
287+
}
288+
289+
return 0;
290+
}
291+
270292
static struct pdu_adv *adv_sync_pdu_duplicate_chain(struct pdu_adv *pdu)
271293
{
272294
struct pdu_adv *pdu_dup = NULL;

0 commit comments

Comments
 (0)