Skip to content

Commit 41e040a

Browse files
joerchanfabiobaltieri
authored andcommitted
samples: direction_finding_connectionless_tx: Use identity address
Use Identiy address in direction_finding_connectionless_tx sample. Without this option the advertiser is advertising using an NRPA since it is a non-connectable advertiser. The function bt_le_ext_adv_oob_get_local cannot be used to get the NRPA address of the non-connectable advertiser when privacy is disabled. Check the return address of bt_le_ext_adv_oob_get_local. Signed-off-by: Joakim Andersson <[email protected]>
1 parent b8b6b0b commit 41e040a

File tree

1 file changed

+9
-1
lines changed
  • samples/bluetooth/direction_finding_connectionless_tx/src

1 file changed

+9
-1
lines changed

samples/bluetooth/direction_finding_connectionless_tx/src/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static struct bt_le_ext_adv *adv_set;
3131

3232
static struct bt_le_adv_param param =
3333
BT_LE_ADV_PARAM_INIT(BT_LE_ADV_OPT_EXT_ADV |
34+
BT_LE_ADV_OPT_USE_IDENTITY |
3435
BT_LE_ADV_OPT_USE_NAME,
3536
BT_GAP_ADV_FAST_INT_MIN_2,
3637
BT_GAP_ADV_FAST_INT_MAX_2,
@@ -136,7 +137,14 @@ void main(void)
136137
}
137138
printk("success\n");
138139

139-
bt_le_ext_adv_oob_get_local(adv_set, &oob_local);
140+
printk("Get extended advertising address...");
141+
err = bt_le_ext_adv_oob_get_local(adv_set, &oob_local);
142+
if (err) {
143+
printk("failed (err %d)\n", err);
144+
return;
145+
}
146+
printk("success\n");
147+
140148
bt_addr_le_to_str(&oob_local.addr, addr_s, sizeof(addr_s));
141149

142150
printk("Started extended advertising as %s\n", addr_s);

0 commit comments

Comments
 (0)