From d5c3a38bec44e6f86d644eedb5ead69974099bb4 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 16 Mar 2022 23:21:02 -0700 Subject: [PATCH] Reset mAddNocCommandHasBeenInvoked and mUpdateNocCommandHasBeenInvoked in ArmFailSafe --- src/include/platform/FailSafeContext.h | 6 +----- src/platform/FailSafeContext.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/include/platform/FailSafeContext.h b/src/include/platform/FailSafeContext.h index aa00d8e9f7ce34..5e9682889a3af2 100644 --- a/src/include/platform/FailSafeContext.h +++ b/src/include/platform/FailSafeContext.h @@ -71,11 +71,7 @@ class FailSafeContext mFabricIndex = nocFabricIndex; } - inline FabricIndex GetFabricIndex() - { - VerifyOrDie(mFailSafeArmed); - return mFabricIndex; - } + inline FabricIndex GetFabricIndex() { return mFabricIndex; } private: // ===== Private members reserved for use by this class only. diff --git a/src/platform/FailSafeContext.cpp b/src/platform/FailSafeContext.cpp index 5373b1b4941e35..f4984b90a55d79 100644 --- a/src/platform/FailSafeContext.cpp +++ b/src/platform/FailSafeContext.cpp @@ -54,8 +54,10 @@ void FailSafeContext::CommissioningFailedTimerComplete() CHIP_ERROR FailSafeContext::ArmFailSafe(FabricIndex accessingFabricIndex, System::Clock::Timeout expiryLength) { - mFailSafeArmed = true; - mFabricIndex = accessingFabricIndex; + mFailSafeArmed = true; + mAddNocCommandHasBeenInvoked = false; + mUpdateNocCommandHasBeenInvoked = false; + mFabricIndex = accessingFabricIndex; DeviceLayer::SystemLayer().StartTimer(expiryLength, HandleArmFailSafe, this); return CHIP_NO_ERROR; }