Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Mesh: Remove extra rescheduling and ADV_FLAG_SCHEDULED flag in the extended advertiser #68558

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions subsys/bluetooth/mesh/adv_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ enum {
ADV_FLAG_PROXY,
/** The proxy has been start, but maybe pending. */
ADV_FLAG_PROXY_START,
/** The send-call has been scheduled. */
ADV_FLAG_SCHEDULED,
/** The send-call has been pending. */
ADV_FLAG_SCHEDULE_PENDING,
/** Custom adv params have been set, we need to update the parameters on
Expand Down Expand Up @@ -267,14 +265,8 @@ static void send_pending_adv(struct k_work *work)

ext_adv->adv = NULL;
}

(void)schedule_send(ext_adv);
alxelax marked this conversation as resolved.
Show resolved Hide resolved

return;
}

atomic_clear_bit(ext_adv->flags, ADV_FLAG_SCHEDULED);

while ((adv = bt_mesh_adv_get_by_tag(ext_adv->tags, K_NO_WAIT))) {
/* busy == 0 means this was canceled */
if (!adv->ctx.busy) {
Expand Down Expand Up @@ -325,7 +317,7 @@ static bool schedule_send(struct bt_mesh_ext_adv *ext_adv)
if (atomic_test_bit(ext_adv->flags, ADV_FLAG_ACTIVE)) {
atomic_set_bit(ext_adv->flags, ADV_FLAG_SCHEDULE_PENDING);
return false;
} else if (atomic_test_and_set_bit(ext_adv->flags, ADV_FLAG_SCHEDULED)) {
} else if (k_work_is_pending(&ext_adv->work)) {
return false;
LingaoM marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
Loading