Skip to content

Commit

Permalink
[ICD] Remove static_assert to match test changes (#29819)
Browse files Browse the repository at this point in the history
* Remove static_assert to match test changes

* remove verifyordie for now

* comment out variable that is not used

* Update src/app/icd/ICDManager.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

* Restyled by clang-format

---------

Co-authored-by: Boris Zbarsky <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Jan 19, 2024
1 parent 90f881a commit f3a89a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/app/icd/ICDManagementServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,8 @@ class ICDManagementServer

static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS) <= (CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC * kMillisecondsPerSecond),
"Spec requires the IdleModeInterval be equal or greater to the ActiveModeInterval.");
static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS) >= 300,
"Spec requires the ActiveModeThreshold to be equal or greater to 300ms");
uint32_t mActiveInterval_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL_MS;

static_assert((CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS) >= 300,
"Spec requires the ActiveModeThreshold to be equal or greater to 300ms.");
uint16_t mActiveThreshold_ms = CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD_MS;

uint32_t mICDCounter = 0;
Expand Down
7 changes: 4 additions & 3 deletions src/app/icd/ICDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT
VerifyOrDie(ICDNotifier::GetInstance().Subscribe(this) == CHIP_NO_ERROR);
mSymmetricKeystore = symmetricKeystore;

uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs();

ICDManagementServer::GetInstance().SetSymmetricKeystore(mSymmetricKeystore);

VerifyOrDie(kFastPollingInterval.count() < activeModeInterval);
// Removing the check for now since it is possible for the Fast polling
// to be larger than the ActiveModeInterval for now
// uint32_t activeModeInterval = ICDManagementServer::GetInstance().GetActiveModeIntervalMs();
// VerifyOrDie(kFastPollingInterval.count() < activeModeInterval);

UpdateICDMode();
UpdateOperationState(OperationalState::ActiveMode);
Expand Down

0 comments on commit f3a89a1

Please sign in to comment.