Skip to content

Commit 4aad6d0

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: Controller: Fix Extended Legacy Direct Advertising report
Fix Extended Legacy Direct Advertising report to have the correct Target Address. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent 07ff037 commit 4aad6d0

File tree

1 file changed

+8
-16
lines changed
  • subsys/bluetooth/controller/hci

1 file changed

+8
-16
lines changed

subsys/bluetooth/controller/hci/hci.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5619,9 +5619,6 @@ static void le_ext_adv_legacy_report(struct pdu_data *pdu_data,
56195619
#if defined(CONFIG_BT_CTLR_PRIVACY)
56205620
uint8_t rl_idx;
56215621
#endif /* CONFIG_BT_CTLR_PRIVACY */
5622-
#if defined(CONFIG_BT_CTLR_EXT_SCAN_FP)
5623-
uint8_t direct_report;
5624-
#endif /* CONFIG_BT_CTLR_EXT_SCAN_FP */
56255622

56265623
if (!(event_mask & BT_EVT_MASK_LE_META_EVENT) ||
56275624
!(le_event_mask & BT_EVT_MASK_LE_EXT_ADVERTISING_REPORT)) {
@@ -5635,10 +5632,6 @@ static void le_ext_adv_legacy_report(struct pdu_data *pdu_data,
56355632
rl_idx = node_rx->hdr.rx_ftr.rl_idx;
56365633
#endif /* CONFIG_BT_CTLR_PRIVACY */
56375634

5638-
#if defined(CONFIG_BT_CTLR_EXT_SCAN_FP)
5639-
direct_report = node_rx->hdr.rx_ftr.direct;
5640-
#endif /* CONFIG_BT_CTLR_EXT_SCAN_FP */
5641-
56425635
#if defined(CONFIG_BT_CTLR_PRIVACY)
56435636
if (adv->tx_addr) {
56445637
/* Update current RPA */
@@ -5691,15 +5684,14 @@ static void le_ext_adv_legacy_report(struct pdu_data *pdu_data,
56915684
adv_info->rssi = rssi;
56925685
adv_info->interval = 0U;
56935686

5694-
adv_info->direct_addr.type = adv->rx_addr;
5695-
#if defined(CONFIG_BT_CTLR_EXT_SCAN_FP)
5696-
if (direct_report) {
5697-
memcpy(&adv_info->direct_addr.a.val[0],
5698-
&adv->direct_ind.tgt_addr[0], sizeof(bt_addr_t));
5699-
} else
5700-
#endif /* CONFIG_BT_CTLR_EXT_SCAN_FP */
5701-
{
5702-
memset(&adv_info->direct_addr.a.val[0], 0, sizeof(bt_addr_t));
5687+
if (adv->type == PDU_ADV_TYPE_DIRECT_IND) {
5688+
adv_info->direct_addr.type = adv->rx_addr;
5689+
bt_addr_copy(&adv_info->direct_addr.a,
5690+
(void *)adv->direct_ind.tgt_addr);
5691+
} else {
5692+
adv_info->direct_addr.type = 0U;
5693+
(void)memset(adv_info->direct_addr.a.val, 0U,
5694+
sizeof(adv_info->direct_addr.a.val));
57035695
}
57045696

57055697
adv_info->length = data_len;

0 commit comments

Comments
 (0)