Skip to content

Commit 83d3a36

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Shell: Add broadcaster address in broadcast scan callback
Add printing of the broadcast source advertising address in the scan callback. Also rename the scan callback to make it more clear that it is for broadcast scanning. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 208f447 commit 83d3a36

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

subsys/bluetooth/shell/audio.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,16 @@ static uint32_t accepted_broadcast_id;
10091009
static struct bt_audio_base received_base;
10101010
static bool sink_syncable;
10111011

1012-
static bool scan_recv(const struct bt_le_scan_recv_info *info,
1013-
struct net_buf_simple *ad,
1014-
uint32_t broadcast_id)
1012+
static bool broadcast_scan_recv(const struct bt_le_scan_recv_info *info,
1013+
struct net_buf_simple *ad,
1014+
uint32_t broadcast_id)
10151015
{
1016-
shell_print(ctx_shell, "Found broadcaster with ID 0x%06X",
1017-
broadcast_id);
1016+
char le_addr[BT_ADDR_LE_STR_LEN];
1017+
1018+
bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr));
1019+
1020+
shell_print(ctx_shell, "Found broadcaster with ID 0x%06X and addr %s",
1021+
broadcast_id, le_addr);
10181022

10191023
if (broadcast_id == accepted_broadcast_id) {
10201024
shell_print(ctx_shell, "PA syncing to broadcaster");
@@ -1135,7 +1139,7 @@ static void pa_sync_lost(struct bt_audio_broadcast_sink *sink)
11351139

11361140
#if defined(CONFIG_BT_AUDIO_BROADCAST_SINK)
11371141
static struct bt_audio_broadcast_sink_cb sink_cbs = {
1138-
.scan_recv = scan_recv,
1142+
.scan_recv = broadcast_scan_recv,
11391143
.pa_synced = pa_synced,
11401144
.base_recv = base_recv,
11411145
.syncable = syncable,

0 commit comments

Comments
 (0)