Bluetooth: Mesh: Fix creating initial beacon data
There was a chance that initial beacons for subnets would be sent with uninitialized data. Make sure we initialize the beacon data each time when we create a new subnet. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
f48dda0f0f
commit
6e2a3863ac
2 changed files with 6 additions and 0 deletions
|
@ -1936,6 +1936,9 @@ static void net_key_add(struct bt_mesh_model *model,
|
|||
|
||||
sub->net_idx = idx;
|
||||
|
||||
/* Make sure we have valid beacon data to be sent */
|
||||
bt_mesh_net_beacon_update(sub);
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_MESH_GATT_PROXY)) {
|
||||
sub->node_id = BT_MESH_NODE_IDENTITY_STOPPED;
|
||||
bt_mesh_proxy_beacon_send(sub);
|
||||
|
|
|
@ -477,6 +477,9 @@ int bt_mesh_net_create(u16_t idx, u8_t flags, const u8_t key[16],
|
|||
/* Set initial IV Update procedure state time-stamp */
|
||||
bt_mesh.last_update = k_uptime_get();
|
||||
|
||||
/* Make sure we have valid beacon data to be sent */
|
||||
bt_mesh_net_beacon_update(sub);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue