Bluetooth: Controller: Add Periodic Advertising ADI support
Add implementation to add ADI in Periodic Advertising PDUs. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
346141d936
commit
6433a6aac1
@ -503,6 +503,13 @@ config BT_CTLR_ADV_PERIODIC
|
||||
bool "LE Periodic Advertising in Advertising State [EXPERIMENTAL]" if BT_LL_SW_SPLIT
|
||||
select EXPERIMENTAL if BT_LL_SW_SPLIT
|
||||
|
||||
config BT_CTLR_ADV_PERIODIC_ADI_SUPPORT
|
||||
bool "Periodic Advertising ADI support"
|
||||
depends on BT_CTLR_ADV_PERIODIC
|
||||
default y
|
||||
help
|
||||
Enable support for adding AdvDataInfo in Periodic Advertising PDUs.
|
||||
|
||||
config BT_CTLR_SYNC_PERIODIC
|
||||
bool "LE Periodic Advertising in Synchronization State" if !BT_LL_SW_SPLIT
|
||||
depends on BT_OBSERVER && BT_CTLR_SYNC_PERIODIC_SUPPORT
|
||||
|
||||
@ -1089,7 +1089,13 @@ uint8_t ull_adv_sync_pdu_set_clear(struct lll_adv_sync *lll_sync,
|
||||
}
|
||||
#endif /* CONFIG_BT_CTLR_DF_ADV_CTE_TX */
|
||||
|
||||
/* No ADI in AUX_SYNC_IND */
|
||||
if (IS_ENABLED(CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT)) {
|
||||
if (ter_hdr_prev.adi) {
|
||||
ter_dptr_prev += sizeof(struct pdu_adv_adi);
|
||||
}
|
||||
ter_hdr.adi = 1U;
|
||||
ter_dptr += sizeof(struct pdu_adv_adi);
|
||||
}
|
||||
|
||||
/* AuxPtr - will be added if AUX_CHAIN_IND is required */
|
||||
if ((hdr_add_fields & ULL_ADV_PDU_HDR_FIELD_AUX_PTR) ||
|
||||
@ -1233,7 +1239,27 @@ uint8_t ull_adv_sync_pdu_set_clear(struct lll_adv_sync *lll_sync,
|
||||
}
|
||||
}
|
||||
|
||||
/* No ADI in AUX_SYNC_IND*/
|
||||
if (IS_ENABLED(CONFIG_BT_CTLR_ADV_PERIODIC_ADI_SUPPORT)) {
|
||||
struct pdu_adv_adi *adi;
|
||||
struct ll_adv_set *adv;
|
||||
uint16_t did;
|
||||
|
||||
if (ter_hdr_prev.adi) {
|
||||
ter_dptr_prev -= sizeof(struct pdu_adv_adi);
|
||||
}
|
||||
|
||||
ter_dptr -= sizeof(struct pdu_adv_adi);
|
||||
adi = (void *)ter_dptr;
|
||||
|
||||
adv = HDR_LLL2ULL(lll_sync->adv);
|
||||
|
||||
adi->sid = adv->sid;
|
||||
|
||||
/* The DID for a specific SID shall be unique.
|
||||
*/
|
||||
did = ull_adv_aux_did_next_unique_get(adv->sid);
|
||||
adi->did = sys_cpu_to_le16(did);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DF_ADV_CTE_TX)
|
||||
if (ter_hdr.cte_info) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user