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: Fix gatt advertiser start in bt_mesh_resume #82615

Conversation

KyraLengfeld
Copy link
Collaborator

To signal to the mesh extended advertiser that a proxy advertisement is started, bt_mesh_adv_gatt_send() is called in combination with setting the ADV_FLAG_PROXY flag in adv_ext.c. This ensures that it won't try to start the advertiser again, which would result in the controller rejecting it.

Setting this flag outside adv_ext.c is not viable, and as such calling bt_mesh_adv_gatt_send() should also be limited to the advertising source code.

As it stand now, once we utilize the new commit priority for h_commit calls such a recall of bt_mesh_adv_gatt_send() with following rejection by the controller will happen.

Within the bt_mesh_resume() function we can confidently assume the extended advertiser has already been started. As such we can call bt_mesh_adv_gatt_update() instead of bt_mesh_adv_gatt_send().

This change has been tested with both running relevant bsim tests after rearranging in which order the settings of the subsystems are loaded via h_commit, as well as a modified light switch sample, adding bt_mesh_resume/suspend calls on buttons.

To signal to the mesh extended advertiser that a proxy advertisement is
started, `bt_mesh_adv_gatt_send()` is called in combination with
setting the `ADV_FLAG_PROXY` flag in adv_ext.c. This ensures that it
won't try to start the advertiser again, which would result in the
controller rejecting it.

Setting this flag outside adv_ext.c is not viable, and as such calling
`bt_mesh_adv_gatt_send()` should also be limited to the advertising
source code.

As it stand now, once we utilize the new commit priority for `h_commit`
calls such a recall of `bt_mesh_adv_gatt_send()` with following
rejection by the controller will happen.

Within the `bt_mesh_resume()` function we can confidently assume the
extended advertiser has already been started. As such we can call
`bt_mesh_adv_gatt_update()` instead of `bt_mesh_adv_gatt_send()`.

This change has been tested with both running relevant bsim tests after
rearranging in which order the settings of the subsystems are loaded via
`h_commit`, as well as a modified light switch sample, adding
`bt_mesh_resume/suspend` calls on buttons.

Signed-off-by: Kyra Lengfeld <[email protected]>
@PavelVPV
Copy link
Collaborator

PavelVPV commented Dec 10, 2024

This solves the first issue caught and explained here: #79690 (comment)

@kartben kartben merged commit 519f888 into zephyrproject-rtos:main Dec 10, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants