Bluetooth: Mesh: Fix node identity interleave multiple subnets

Reduce advertising duration to `max_timeout` when advertising node
identity for multiple subnets. This will let the node to interleave
subnets for NODE_ID_TIMEOUT.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Pavel Vasilyev 2022-09-21 09:55:34 +02:00 committed by Carles Cufí
commit 20a3a83c9f

View file

@ -590,7 +590,7 @@ static int gatt_proxy_advertise(struct bt_mesh_subnet *sub)
uint32_t active = k_uptime_get_32() - sub->node_id_start;
if (active < NODE_ID_TIMEOUT) {
remaining = NODE_ID_TIMEOUT - active;
remaining = MIN(remaining, NODE_ID_TIMEOUT - active);
BT_DBG("Node ID active for %u ms, %d ms remaining",
active, remaining);
err = node_id_adv(sub, remaining);