diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index e7c308dc89a..e6ae3f6f3ed 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -878,6 +878,15 @@ config BT_MESH_FRIEND_SEG_RX many elements we can simultaneously be receiving segmented messages from when the messages are going into the Friend queue. +config BT_MESH_FRIEND_ADV_LATENCY + int "Latency for enabling advertising" + default 0 + help + Latency in milliseconds that it takes to start friend advertising + after requesting it. Used to tune the receive delay window to make + Friend poll events more efficient by compensating for the time the + non-ideal latency otherwise would add to the delay. + endif # BT_MESH_FRIEND config BT_MESH_CFG_CLI diff --git a/subsys/bluetooth/mesh/friend.c b/subsys/bluetooth/mesh/friend.c index d9cc4279307..2d532ccb759 100644 --- a/subsys/bluetooth/mesh/friend.c +++ b/subsys/bluetooth/mesh/friend.c @@ -1034,7 +1034,7 @@ init_friend: frnd->lpn = rx->ctx.addr; frnd->num_elem = msg->num_elem; frnd->subnet = rx->sub; - frnd->recv_delay = msg->recv_delay; + frnd->recv_delay = msg->recv_delay - CONFIG_BT_MESH_FRIEND_ADV_LATENCY; frnd->poll_to = poll_to * 100U; frnd->lpn_counter = sys_be16_to_cpu(msg->lpn_counter); frnd->clear.frnd = sys_be16_to_cpu(msg->prev_addr);