Bluetooth: Deprecate adv auto-resume
The host-based adv auto-resume function has both a problematic implementation and disagreement in the community around how it should behave. See the issue linked resolved below for details. This patch makes the deprecation visible to the user. The user will be better served by a auto-resume tailored their applications use case, based on more primitive host API like `conn_cb.recycled`, which has obvious behavior that is unlikely to change. Resolves: https://github.com/zephyrproject-rtos/zephyr/issues/72567 Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
This commit is contained in:
parent
d7ab4f25e1
commit
8cfad44852
96 changed files with 396 additions and 275 deletions
|
@ -341,7 +341,7 @@ static void test_main(void)
|
|||
|
||||
printk("Bluetooth initialized\n");
|
||||
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_ONE_TIME, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
if (err != 0) {
|
||||
FAIL("Advertising failed to start (err %d)\n", err);
|
||||
return;
|
||||
|
|
|
@ -101,7 +101,7 @@ static void test_main_common(bool connect_eatt)
|
|||
|
||||
printk("Bluetooth initialized\n");
|
||||
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_ONE_TIME, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
if (err != 0) {
|
||||
FAIL("Advertising failed to start (err %d)\n", err);
|
||||
|
||||
|
|
|
@ -58,18 +58,8 @@ BT_GATT_SERVICE_DEFINE(dummy_svc, BT_GATT_PRIMARY_SERVICE(&dummy_service),
|
|||
static void create_adv(struct bt_le_ext_adv **adv)
|
||||
{
|
||||
int err;
|
||||
struct bt_le_adv_param params;
|
||||
|
||||
memset(¶ms, 0, sizeof(struct bt_le_adv_param));
|
||||
|
||||
params.options |= BT_LE_ADV_OPT_CONNECTABLE;
|
||||
|
||||
params.id = BT_ID_DEFAULT;
|
||||
params.sid = 0;
|
||||
params.interval_min = BT_GAP_ADV_FAST_INT_MIN_2;
|
||||
params.interval_max = BT_GAP_ADV_FAST_INT_MAX_2;
|
||||
|
||||
err = bt_le_ext_adv_create(¶ms, NULL, adv);
|
||||
err = bt_le_ext_adv_create(BT_LE_ADV_CONN_FAST_1, NULL, adv);
|
||||
if (err) {
|
||||
FAIL("Failed to create advertiser (%d)\n", err);
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ static void test_main(void)
|
|||
|
||||
printk("Bluetooth initialized\n");
|
||||
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_ONE_TIME, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
if (err != 0) {
|
||||
FAIL("Advertising failed to start (err %d)\n", err);
|
||||
return;
|
||||
|
|
|
@ -183,7 +183,7 @@ static void setup(void)
|
|||
|
||||
printk("Bluetooth initialized\n");
|
||||
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_ONE_TIME, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
if (err != 0) {
|
||||
FAIL("Advertising failed to start (err %d)\n", err);
|
||||
return;
|
||||
|
|
|
@ -145,7 +145,7 @@ static void test_main(void)
|
|||
|
||||
printk("Bluetooth initialized\n");
|
||||
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_ONE_TIME, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
err = bt_le_adv_start(BT_LE_ADV_CONN_FAST_1, ad, ARRAY_SIZE(ad), NULL, 0);
|
||||
if (err != 0) {
|
||||
FAIL("Advertising failed to start (err %d)\n", err);
|
||||
return;
|
||||
|
|
|
@ -129,7 +129,7 @@ void create_adv(struct bt_le_ext_adv **adv)
|
|||
int err;
|
||||
struct bt_le_adv_param params = {};
|
||||
|
||||
params.options |= BT_LE_ADV_OPT_CONNECTABLE;
|
||||
params.options |= BT_LE_ADV_OPT_CONN;
|
||||
params.options |= BT_LE_ADV_OPT_EXT_ADV;
|
||||
|
||||
params.id = BT_ID_DEFAULT;
|
||||
|
|
|
@ -121,8 +121,7 @@ void advertise_connectable(void)
|
|||
|
||||
param.interval_min = 0x0020;
|
||||
param.interval_max = 0x4000;
|
||||
param.options |= BT_LE_ADV_OPT_ONE_TIME;
|
||||
param.options |= BT_LE_ADV_OPT_CONNECTABLE;
|
||||
param.options |= BT_LE_ADV_OPT_CONN;
|
||||
|
||||
err = bt_le_adv_start(¶m, NULL, 0, NULL, 0);
|
||||
__ASSERT(err == 0, "Advertising failed to start (err %d)\n", err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue