Bluetooth: Mesh: Fix gatt advertiser start in bt_mesh_resume #82615
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To signal to the mesh extended advertiser that a proxy advertisement is started,
bt_mesh_adv_gatt_send()
is called in combination with setting theADV_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 ofbt_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 callbt_mesh_adv_gatt_update()
instead ofbt_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, addingbt_mesh_resume/suspend
calls on buttons.