Skip to content

Commit 9e7b9c0

Browse files
PavelVPVrlubos
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: Check avail conn before restarting pb...
-gatt srv adv When a provisioner connects to the device, gatt_connected callback is called in pb_gatt_srv.c, then pb-gatt advertising is stopped and adv_sent callback is triggered in adv_ext.c. adv_sent callback reschedules advertising and eventually calls bt_mesh_adv_gatt_send. Since the device is not provisioned yet, it tries to start pb-gatt advertising again. If number of available connections is reached, this results in "Advertising failed" error in adv_ext.c. Signed-off-by: Pavel Vasilyev <[email protected]> (cherry picked from commit f2ea6f2)
1 parent bdfba22 commit 9e7b9c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/bluetooth/mesh/pb_gatt_srv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ int bt_mesh_pb_gatt_srv_adv_start(void)
270270
{
271271
BT_DBG("");
272272

273-
if (!service_registered || bt_mesh_is_provisioned()) {
273+
if (!service_registered || bt_mesh_is_provisioned() ||
274+
bt_mesh_proxy_conn_count_get() == CONFIG_BT_MAX_CONN) {
274275
return -ENOTSUP;
275276
}
276277

0 commit comments

Comments
 (0)