When using the PB-ADV bearer there is a ~10 second delay after the Link is closed and the mesh stack starts working again.
This is related to my previous report https://devzone.nordicsemi.com/f/nordic-q-a/43992/10-second-delay-after-pb-gatt-completed-until-first-mesh-proxy-service-advertisement and https://devzone.nordicsemi.com/f/nordic-q-a/46583/scanner-is-disabled-after-provision-completes-with-pb-gatt-enabled-with-10-second-delay-workaround
I'm currently using the workaround suggested in the the above posts. However, while it works great for PB-GATT, it doesn't work for PB-ADV and the delay is still there.
Doing the initial workaround with scanner_disable()/scanner_enable() in nrf_mesh_disable()/nrf_mesh_enable() does actually improve the situation.
Here is a log from a node that is running a patched SDK For Mesh v3.1.0. Note the time between line 4 (Link opened) and line 15 (Provision Complete event) is ~10 seconds. I would expect that the Complete Event to happen quickly after the Link Closed Event. I've added a few more log lines to better spot where the delay is, i.e. it's waiting for the NRF_MESH_EVT_DISABLED event.
<t: 21882>, prov_bearer_adv.c , 400, PB-ADV: context at 0x20002CF0 added to bearer <t: 21894>, mesh_app_utils.c , 65, Device UUID (raw): A6880470478AB741B644550AC49916F7 <t: 21898>, mesh_app_utils.c , 70, Device UUID : 700488A6-8A47-41B7-B644-550AC49916F7 <t: 1411152>, prov_bearer_adv.c , 849, PB-ADV: Link opened. <t: 1413242>, prov_bearer_adv.c , 798, Received ACK for [ppdu1] <t: 1419801>, prov_bearer_adv.c , 798, Received ACK for [ppdu3] <t: 1426426>, prov_bearer_adv.c , 798, Received ACK for [ppdu5] <t: 1428584>, prov_bearer_adv.c , 798, Received ACK for [ppdu6] <t: 1432182>, prov_bearer_adv.c , 798, Received ACK for [ppdu8] <t: 1432936>, mesh_provisionee.c , 177, gatt_database_reset <t: 1432940>, prov_bearer_adv.c , 904, PB-ADV: Link closed. <t: 1740535>, mesh_provisionee.c , 94, mesh_evt_handler <t: 1740541>, mesh_provisionee.c , 158, sd_state_evt_handler DISABLED <t: 1740550>, mesh_provisionee.c , 113, sd_state_evt_handler ENABLED <t: 1741092>, main.c , 66, Successfully provisioned <t: 1741102>, main.c , 76, Node Address: 0x002C
Thanks.