Bluetooth: Mesh: Allow sending SNB and PRB in parallel

Private Beacons and Secure Network Beacons are not mutually exclusive by
spec. This means both beacons can be sent simultaneously. For both
beacons spec defines their own observation intervals and related
parameters, which means we need to monitor both beacons types
separately.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
This commit is contained in:
Pavel Vasilyev 2023-03-28 13:55:58 +02:00 committed by Carles Cufí
commit c36fdf251f
6 changed files with 174 additions and 90 deletions

View file

@ -382,7 +382,7 @@ static void identity_enabled(struct bt_mesh_subnet *sub)
static void node_id_start(struct bt_mesh_subnet *sub)
{
#if defined(CONFIG_BT_MESH_PRIV_BEACONS)
sub->priv_beacon.node_id = false;
sub->priv_beacon_ctx.node_id = false;
#endif
identity_enabled(sub);
@ -391,7 +391,7 @@ static void node_id_start(struct bt_mesh_subnet *sub)
static void private_node_id_start(struct bt_mesh_subnet *sub)
{
#if defined(CONFIG_BT_MESH_PRIV_BEACONS)
sub->priv_beacon.node_id = true;
sub->priv_beacon_ctx.node_id = true;
#endif
identity_enabled(sub);
@ -752,7 +752,7 @@ static int gatt_proxy_advertise(struct bt_mesh_subnet *sub)
LOG_DBG("Node ID active for %u ms, %d ms remaining",
active, remaining);
#if defined(CONFIG_BT_MESH_PRIV_BEACONS)
priv_node_id = sub->priv_beacon.node_id;
priv_node_id = sub->priv_beacon_ctx.node_id;
#endif
if (priv_node_id) {
err = priv_node_id_adv(sub, remaining);