Bluetooth: Mesh: Store Krp phase after krp value changed
Store krp phase persistently when this value has been changed. Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
This commit is contained in:
parent
48e791a625
commit
0023d3f364
2 changed files with 12 additions and 0 deletions
|
@ -2836,6 +2836,11 @@ static void krp_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx,
|
|||
phase == BT_MESH_KR_PHASE_2) {
|
||||
sub->kr_phase = BT_MESH_KR_PHASE_2;
|
||||
sub->kr_flag = 1;
|
||||
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
||||
BT_DBG("Storing krp phase persistently");
|
||||
bt_mesh_store_subnet(sub);
|
||||
}
|
||||
|
||||
bt_mesh_net_beacon_update(sub);
|
||||
} else if ((sub->kr_phase == BT_MESH_KR_PHASE_1 ||
|
||||
sub->kr_phase == BT_MESH_KR_PHASE_2) &&
|
||||
|
@ -2845,6 +2850,7 @@ static void krp_set(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx,
|
|||
IS_ENABLED(CONFIG_BT_MESH_FRIEND)) {
|
||||
friend_cred_refresh(ctx->net_idx);
|
||||
}
|
||||
|
||||
sub->kr_phase = BT_MESH_KR_NORMAL;
|
||||
sub->kr_flag = 0;
|
||||
bt_mesh_net_beacon_update(sub);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue