Samples: iso_connected_benchmark: Use BT_LE_ADV_OPT_ONE_TIME

It is not intentional to continue advertising once a connection has been
established for two reasons:
 1. We do not configure enough connection contexts for this
 2. We don't want to generate controller scheduling conflicts that can
    possibly reduce performance.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
This commit is contained in:
Rubin Gerritsen 2023-06-09 09:59:34 +02:00 committed by Anas Nashif
commit faecdff7a2

View file

@ -1012,7 +1012,12 @@ static int run_peripheral(void)
} }
LOG_INF("Starting advertising"); LOG_INF("Starting advertising");
err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, NULL, 0, NULL, 0); err = bt_le_adv_start(
BT_LE_ADV_PARAM(BT_LE_ADV_OPT_ONE_TIME | BT_LE_ADV_OPT_CONNECTABLE |
BT_LE_ADV_OPT_USE_NAME |
BT_LE_ADV_OPT_FORCE_NAME_IN_AD,
BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, NULL),
NULL, 0, NULL, 0);
if (err != 0) { if (err != 0) {
LOG_ERR("Advertising failed to start: %d", err); LOG_ERR("Advertising failed to start: %d", err);
return err; return err;