Skip to content

Commit bab4b2a

Browse files
BalaklakaPavelVPV
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: Fix proxy advertiser handling with GATT server enabled
When the GATT server is enabled the proxy advertiser server need to be stopped. This solved a bug where the Mesh Proxy Service is not restared. This fix is done to fix several failing PTS test that was failing when CONFIG_BT_MESH_ADV_EXT_GATT_SEPARATE was enabled. Calling the stop_proxy_adv was left out in a prevouis commit when doing code cleanup. Signed-off-by: Ingar Kulbrandstad <[email protected]> (cherry picked from commit a65a164) Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent 30cc1aa commit bab4b2a

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

subsys/bluetooth/mesh/adv_ext.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,17 @@ static void start_proxy_sol_or_proxy_adv(struct bt_mesh_ext_adv *ext_adv)
342342
}
343343
}
344344

345-
if (IS_ENABLED(CONFIG_BT_MESH_GATT_SERVER) &&
346-
!atomic_test_and_set_bit(ext_adv->flags, ADV_FLAG_PROXY)) {
347-
if (bt_mesh_adv_gatt_send()) {
348-
atomic_clear_bit(ext_adv->flags, ADV_FLAG_PROXY);
345+
if (IS_ENABLED(CONFIG_BT_MESH_GATT_SERVER)) {
346+
if (stop_proxy_adv(ext_adv)) {
349347
return;
350348
}
349+
350+
if (!atomic_test_and_set_bit(ext_adv->flags, ADV_FLAG_PROXY)) {
351+
if (bt_mesh_adv_gatt_send()) {
352+
atomic_clear_bit(ext_adv->flags, ADV_FLAG_PROXY);
353+
return;
354+
}
355+
}
351356
}
352357
}
353358

0 commit comments

Comments
 (0)