mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-28 21:00:03 +00:00
mesh: Store Krp phase after krp value changed
Store krp phase persistently when this value has been changed. this is port of 6a4aefb66917d2a9fac0b00e0cef4bb976447144
This commit is contained in:
committed by
Łukasz Rymanowski
parent
ca59f8d8f6
commit
2bcd23d6d9
@@ -2918,6 +2918,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) &&
|
||||
|
||||
@@ -518,6 +518,11 @@ bool bt_mesh_kr_update(struct bt_mesh_subnet *sub, u8_t new_kr, bool new_key)
|
||||
if (sub->kr_phase == BT_MESH_KR_PHASE_1) {
|
||||
BT_DBG("Phase 1 -> Phase 2");
|
||||
sub->kr_phase = BT_MESH_KR_PHASE_2;
|
||||
if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
|
||||
BT_DBG("Storing krp phase persistently");
|
||||
bt_mesh_store_subnet(sub);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user