From f4ff8f223061be66dd4f8baf000d1392c8582880 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Thu, 15 Dec 2022 20:04:27 +0100 Subject: [PATCH] samples: Bluetooth: ISO broadcast receiver pa_interval check move Move the check for the pa_interval to before we start parsing the data for the name, as that is more optimized. Signed-off-by: Emil Gydesen --- .../bluetooth/iso_broadcast_benchmark/src/receiver.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/bluetooth/iso_broadcast_benchmark/src/receiver.c b/samples/bluetooth/iso_broadcast_benchmark/src/receiver.c index 41cad26a3b4..68470c6466f 100644 --- a/samples/bluetooth/iso_broadcast_benchmark/src/receiver.c +++ b/samples/bluetooth/iso_broadcast_benchmark/src/receiver.c @@ -86,6 +86,11 @@ static void scan_recv(const struct bt_le_scan_recv_info *info, return; } + if (info->interval == 0U) { + /* Not broadcast periodic advertising - Ignore */ + return; + } + (void)memset(name, 0, sizeof(name)); bt_data_parse(buf, data_cb, name); @@ -94,11 +99,6 @@ static void scan_recv(const struct bt_le_scan_recv_info *info, return; } - if (info->interval == 0U) { - /* Not broadcast periodic advertising - Ignore */ - return; - } - bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); LOG_INF("Found broadcaster with address %s (RSSI %i)",