Skip to content
Permalink
Browse files

Bluetooth: Host: Fix advertiser state flags

Set advertisers state flags so that previous advertise params does not
affect the current advertiser state.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
  • Loading branch information...
joerchan authored and carlescufi committed Jul 23, 2019
1 parent 15107b0 commit 4fa08259255663aba3bfd2b354ebdc5e0311f298
Showing with 6 additions and 9 deletions.
  1. +6 −9 subsys/bluetooth/host/hci_core.c
@@ -5516,17 +5516,14 @@ int bt_le_adv_start_internal(const struct bt_le_adv_param *param,
return err;
}

if (!(param->options & BT_LE_ADV_OPT_ONE_TIME)) {
atomic_set_bit(bt_dev.flags, BT_DEV_KEEP_ADVERTISING);
}
atomic_set_bit_to(bt_dev.flags, BT_DEV_KEEP_ADVERTISING,
!(param->options & BT_LE_ADV_OPT_ONE_TIME));

if (param->options & BT_LE_ADV_OPT_USE_NAME) {
atomic_set_bit(bt_dev.flags, BT_DEV_ADVERTISING_NAME);
}
atomic_set_bit_to(bt_dev.flags, BT_DEV_ADVERTISING_NAME,
param->options & BT_LE_ADV_OPT_USE_NAME);

if (param->options & BT_LE_ADV_OPT_CONNECTABLE) {
atomic_set_bit(bt_dev.flags, BT_DEV_ADVERTISING_CONNECTABLE);
}
atomic_set_bit_to(bt_dev.flags, BT_DEV_ADVERTISING_CONNECTABLE,
param->options & BT_LE_ADV_OPT_CONNECTABLE);

return 0;
}

0 comments on commit 4fa0825

Please sign in to comment.
You can’t perform that action at this time.