bluetooth: host: remove useless internal flag BT_ADV_PERSIST
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].
Options and parameters for this behavior have been removed,
and the internal bit flag BT_ADV_PERSIST is now always false.
The behavior it used to configure (to keep advertising after a
connection has been established as long as there are connections
available) has also been removed.
[1] Bluetooth: Deprecate adv auto-resume #73395
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
diff --git a/subsys/bluetooth/host/adv.c b/subsys/bluetooth/host/adv.c
index 0b79ffc..bdf74f4 100644
--- a/subsys/bluetooth/host/adv.c
+++ b/subsys/bluetooth/host/adv.c
@@ -1005,8 +1005,6 @@
bt_conn_unref(conn);
}
- atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false);
-
atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN);
atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable);
@@ -1170,9 +1168,6 @@
}
}
- /* Flag only used by bt_le_adv_start API. */
- atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false);
-
atomic_set_bit_to(adv->flags, BT_ADV_CONNECTABLE, param->options & BT_LE_ADV_OPT_CONN);
atomic_set_bit_to(adv->flags, BT_ADV_SCANNABLE, scannable);
@@ -1259,9 +1254,6 @@
bt_conn_unref(conn);
}
- /* Flag always set to false by le_ext_adv_param_set */
- atomic_set_bit_to(adv->flags, BT_ADV_PERSIST, false);
-
return 0;
}
@@ -1318,11 +1310,6 @@
(void)bt_le_lim_adv_cancel_timeout(adv);
- /* Make sure advertising is not re-enabled later even if it's not
- * currently enabled (i.e. BT_DEV_ADVERTISING is not set).
- */
- atomic_clear_bit(adv->flags, BT_ADV_PERSIST);
-
if (!atomic_test_bit(adv->flags, BT_ADV_ENABLED)) {
/* Legacy advertiser exists, but is not currently advertising.
* This happens when keep advertising behavior is active but
@@ -1562,8 +1549,6 @@
(void)bt_le_lim_adv_cancel_timeout(adv);
- atomic_clear_bit(adv->flags, BT_ADV_PERSIST);
-
if (!atomic_test_bit(adv->flags, BT_ADV_ENABLED)) {
return 0;
}
diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c
index 2ba274c..274c202 100644
--- a/subsys/bluetooth/host/hci_core.c
+++ b/subsys/bluetooth/host/hci_core.c
@@ -1499,13 +1499,10 @@
if (IS_ENABLED(CONFIG_BT_EXT_ADV) &&
!BT_DEV_FEAT_LE_EXT_ADV(bt_dev.le.features)) {
- struct bt_le_ext_adv *adv = bt_le_adv_lookup_legacy();
/* No advertising set terminated event, must be a
* legacy advertiser set.
*/
- if (!atomic_test_bit(adv->flags, BT_ADV_PERSIST)) {
- bt_le_adv_delete_legacy();
- }
+ bt_le_adv_delete_legacy();
}
}
diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h
index 315db2d..3d1c87c 100644
--- a/subsys/bluetooth/host/hci_core.h
+++ b/subsys/bluetooth/host/hci_core.h
@@ -140,10 +140,6 @@
* the identity address instead.
*/
BT_ADV_USE_IDENTITY,
- /* Advertiser has been configured to keep advertising after a connection
- * has been established as long as there are connections available.
- */
- BT_ADV_PERSIST,
/* Advertiser has been temporarily disabled. */
BT_ADV_PAUSED,
/* Periodic Advertising has been enabled in the controller. */