diff --git a/src/app/icd/server/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp index 2f5bacc0f30d95..d2755f7a187f06 100644 --- a/src/app/icd/server/ICDManager.cpp +++ b/src/app/icd/server/ICDManager.cpp @@ -668,12 +668,14 @@ CHIP_ERROR ICDManager::HandleEventTrigger(uint64_t eventTrigger) case ICDTestEventTriggerEvent::kRemoveActiveModeReq: SetKeepActiveModeRequirements(KeepActiveFlag::kTestEventTriggerActiveMode, false); break; +#if CHIP_CONFIG_ENABLE_ICD_CIP case ICDTestEventTriggerEvent::kInvalidateHalfCounterValues: err = ICDConfigurationData::GetInstance().GetICDCounter().InvalidateHalfCheckInCouterValues(); break; case ICDTestEventTriggerEvent::kInvalidateAllCounterValues: err = ICDConfigurationData::GetInstance().GetICDCounter().InvalidateAllCheckInCounterValues(); break; +#endif // CHIP_CONFIG_ENABLE_ICD_CIP default: err = CHIP_ERROR_INVALID_ARGUMENT; break; diff --git a/src/protocols/secure_channel/CheckInCounter.cpp b/src/protocols/secure_channel/CheckInCounter.cpp index df74f5aaf07ad4..d3d46a8780c98a 100644 --- a/src/protocols/secure_channel/CheckInCounter.cpp +++ b/src/protocols/secure_channel/CheckInCounter.cpp @@ -31,7 +31,6 @@ CHIP_ERROR CheckInCounter::InvalidateHalfCheckInCouterValues() uint32_t currentCounterValue = GetValue(); // Double current counter value and update underlying counter storage. CheckInCounter is allowed to rollover. - // If current value is 0, set UINT32_MAX / 2 since multiplication will be 0 uint32_t newCounterValue = currentCounterValue + (UINT32_MAX / 2); ReturnErrorOnFailure(SetValue(newCounterValue));