Bluetooth: Host: Add Periodic Advertising ADI support
Add Periodic Advertising ADI support. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
6433a6aac1
commit
cff3703e3d
2 changed files with 21 additions and 13 deletions
|
@ -1276,17 +1276,20 @@ enum {
|
||||||
*/
|
*/
|
||||||
BT_LE_PER_ADV_SYNC_OPT_REPORTING_INITIALLY_DISABLED = BIT(1),
|
BT_LE_PER_ADV_SYNC_OPT_REPORTING_INITIALLY_DISABLED = BIT(1),
|
||||||
|
|
||||||
|
/** Filter duplicate Periodic Advertising reports */
|
||||||
|
BT_LE_PER_ADV_SYNC_OPT_FILTER_DUPLICATE = BIT(2),
|
||||||
|
|
||||||
/** Sync with Angle of Arrival (AoA) constant tone extension */
|
/** Sync with Angle of Arrival (AoA) constant tone extension */
|
||||||
BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOA = BIT(2),
|
BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOA = BIT(3),
|
||||||
|
|
||||||
/** Sync with Angle of Departure (AoD) 1 us constant tone extension */
|
/** Sync with Angle of Departure (AoD) 1 us constant tone extension */
|
||||||
BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOD_1US = BIT(3),
|
BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOD_1US = BIT(4),
|
||||||
|
|
||||||
/** Sync with Angle of Departure (AoD) 2 us constant tone extension */
|
/** Sync with Angle of Departure (AoD) 2 us constant tone extension */
|
||||||
BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOD_2US = BIT(4),
|
BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOD_2US = BIT(5),
|
||||||
|
|
||||||
/** Do not sync to packets without a constant tone extension */
|
/** Do not sync to packets without a constant tone extension */
|
||||||
BT_LE_PER_ADV_SYNC_OPT_SYNC_ONLY_CONST_TONE_EXT = BIT(5),
|
BT_LE_PER_ADV_SYNC_OPT_SYNC_ONLY_CONST_TONE_EXT = BIT(6),
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bt_le_per_adv_sync_param {
|
struct bt_le_per_adv_sync_param {
|
||||||
|
|
|
@ -1186,6 +1186,20 @@ int bt_le_per_adv_sync_create(const struct bt_le_per_adv_sync_param *param,
|
||||||
cp->options |= BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_USE_LIST;
|
cp->options |= BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_USE_LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (param->options &
|
||||||
|
BT_LE_PER_ADV_SYNC_OPT_REPORTING_INITIALLY_DISABLED) {
|
||||||
|
cp->options |=
|
||||||
|
BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_REPORTS_DISABLED;
|
||||||
|
|
||||||
|
atomic_set_bit(per_adv_sync->flags,
|
||||||
|
BT_PER_ADV_SYNC_RECV_DISABLED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param->options & BT_LE_PER_ADV_SYNC_OPT_FILTER_DUPLICATE) {
|
||||||
|
cp->options |=
|
||||||
|
BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_FILTER_DUPLICATE;
|
||||||
|
}
|
||||||
|
|
||||||
if (param->options & BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOA) {
|
if (param->options & BT_LE_PER_ADV_SYNC_OPT_DONT_SYNC_AOA) {
|
||||||
cp->cte_type |= BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_AOA;
|
cp->cte_type |= BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_NO_AOA;
|
||||||
}
|
}
|
||||||
|
@ -1204,15 +1218,6 @@ int bt_le_per_adv_sync_create(const struct bt_le_per_adv_sync_param *param,
|
||||||
cp->cte_type |= BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_ONLY_CTE;
|
cp->cte_type |= BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_ONLY_CTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param->options &
|
|
||||||
BT_LE_PER_ADV_SYNC_OPT_REPORTING_INITIALLY_DISABLED) {
|
|
||||||
cp->options |=
|
|
||||||
BT_HCI_LE_PER_ADV_CREATE_SYNC_FP_REPORTS_DISABLED;
|
|
||||||
|
|
||||||
atomic_set_bit(per_adv_sync->flags,
|
|
||||||
BT_PER_ADV_SYNC_RECV_DISABLED);
|
|
||||||
}
|
|
||||||
|
|
||||||
cp->sid = param->sid;
|
cp->sid = param->sid;
|
||||||
cp->skip = sys_cpu_to_le16(param->skip);
|
cp->skip = sys_cpu_to_le16(param->skip);
|
||||||
cp->sync_timeout = sys_cpu_to_le16(param->timeout);
|
cp->sync_timeout = sys_cpu_to_le16(param->timeout);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue