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>
This commit is contained in:
parent
15107b0340
commit
4fa0825925
1 changed files with 6 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue