samples: Bluetooth: broadcaster_multiple: Refactor for reuse

Refactor the sample so that multiple advertising setup can
be reused in other sample if required. Bluetooth enable can
be in the sample that reuses the advertising setup.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2024-10-25 10:27:41 +02:00 committed by David Leach
commit bb4c44153b
3 changed files with 18 additions and 7 deletions

View file

@ -51,6 +51,14 @@ static void test_adv_main(void)
extern int broadcaster_multiple(void);
int err;
err = bt_enable(NULL);
if (err) {
FAIL("Bluetooth init failed\n");
bs_trace_silent_exit(err);
return;
}
err = broadcaster_multiple();
if (err) {
FAIL("Adv tests failed\n");