Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions tests/bsim/bluetooth/ll/conn/src/test_connect2.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,20 @@ static int start_advertising(void)
int err;

err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
if (err) {
printk("Advertising failed to start (err %d)\n", err);
}

return err;
}

static void recycled(void)
{
start_advertising();
int err;

err = start_advertising();
if (err) {
FAIL("Advertising failed to restart (err %d)\n", err);
} else {
printk("Advertising successfully restarted\n");
}
}

static struct bt_conn_cb conn_callbacks = {
Expand All @@ -152,7 +156,9 @@ static void bt_ready(void)
printk("Peripheral Bluetooth initialized\n");

err = start_advertising();
if (!err) {
if (err) {
FAIL("Advertising failed to start (err %d)\n", err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wont this cause log string duplication with the printk() that start_advertising() has internally for the error case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I will remove the printk there, as we need FAIL that sets bst_result for bsim verdict.

} else {
printk("Advertising successfully started\n");
}
}
Expand Down