Bluetooth: Host: reset adv_pool in bt_disable
Reset the adv_pool in disable so that advertising can be started after re-enabling without issue. Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
This commit is contained in:
parent
0e010e8744
commit
c80b6d8223
|
@ -270,6 +270,15 @@ void bt_le_ext_adv_foreach(void (*func)(struct bt_le_ext_adv *adv, void *data),
|
|||
#endif /* defined(CONFIG_BT_EXT_ADV) */
|
||||
}
|
||||
|
||||
void bt_adv_reset_adv_pool(void)
|
||||
{
|
||||
#if defined(CONFIG_BT_EXT_ADV)
|
||||
(void)memset(&adv_pool, 0, sizeof(adv_pool));
|
||||
#endif /* defined(CONFIG_BT_EXT_ADV) */
|
||||
|
||||
(void)memset(&bt_dev.adv, 0, sizeof(bt_dev.adv));
|
||||
}
|
||||
|
||||
static struct bt_le_ext_adv *adv_get_legacy(void)
|
||||
{
|
||||
#if defined(CONFIG_BT_EXT_ADV)
|
||||
|
|
|
@ -20,3 +20,4 @@ int bt_le_adv_set_enable_ext(struct bt_le_ext_adv *adv,
|
|||
const struct bt_le_ext_adv_start_param *param);
|
||||
int bt_le_adv_set_enable_legacy(struct bt_le_ext_adv *adv, bool enable);
|
||||
int bt_le_lim_adv_cancel_timeout(struct bt_le_ext_adv *adv);
|
||||
void bt_adv_reset_adv_pool(void);
|
||||
|
|
|
@ -3800,6 +3800,10 @@ int bt_disable(void)
|
|||
|
||||
bt_monitor_send(BT_MONITOR_CLOSE_INDEX, NULL, 0);
|
||||
|
||||
#if defined(CONFIG_BT_EXT_ADV) || defined(CONFIG_BT_BROADCASTER)
|
||||
bt_adv_reset_adv_pool();
|
||||
#endif /* CONFIG_BT_EXT_ADV || CONFIG_BT_BROADCASTER */
|
||||
|
||||
#if defined(CONFIG_BT_PER_ADV_SYNC)
|
||||
bt_periodic_sync_disable();
|
||||
#endif /* CONFIG_BT_PER_ADV_SYNC */
|
||||
|
|
Loading…
Reference in a new issue