tests: bsim: bluetooth: mesh: Suspend advertiser from the start callback

Now, when the deadlock is removed from `bt_mesh_adv_disable` function,
the advertiser can be disabled from the `bt_mesh_send_cb`
callbacks.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Pavel Vasilyev 2024-02-01 11:01:38 +01:00 committed by Alberto Escolar
parent 4c9ee14572
commit d6ce3e88b6
1 changed files with 1 additions and 8 deletions

View File

@ -598,13 +598,6 @@ static void adv_resume(void)
ASSERT_OK_MSG(bt_mesh_adv_enable(), "Failed to enable advertiser");
}
static void adv_disable_work_handler(struct k_work *work)
{
adv_suspend();
}
static K_WORK_DEFINE(adv_disable_work, adv_disable_work_handler);
struct adv_suspend_ctx {
bool suspend;
int instance_idx;
@ -644,7 +637,7 @@ static void adv_send_start(uint16_t duration, int err, void *cb_data)
if (adv_data->suspend) {
if (adv_data->instance_idx == 0) {
ASSERT_EQUAL(err, 0);
k_work_submit(&adv_disable_work);
adv_suspend();
} else {
/* For the advs that were pushed to the mesh advertiser by calling
* `bt_mesh_adv_send` function but not sent to the host, the start callback