Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
  • Loading branch information
mkardous-silabs and bzbarsky-apple authored Apr 19, 2024
1 parent 78003be commit f1c6f1f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/icd/server/ICDManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void ICDManager::UpdateOperationState(OperationalState state)
DeviceLayer::SystemLayer().StartTimer(activeModeDuration, OnActiveModeDone, this);

Milliseconds32 activeModeJitterInterval = Milliseconds32(ICD_ACTIVE_TIME_JITTER_MS);
// TODO(#33074): Edge case when we transition to IdleMode with this conditio being true
// TODO(#33074): Edge case when we transition to IdleMode with this condition being true
// (activeModeDuration == kZero && !mKeepActiveFlags.HasAny())
activeModeJitterInterval =
(activeModeDuration >= activeModeJitterInterval) ? activeModeDuration - activeModeJitterInterval : kZero;
Expand Down
10 changes: 5 additions & 5 deletions src/app/icd/server/ICDManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
* @param[in] feature FeatureMap bit to verify
*
* @return true: if the FeatureMap bit is enabled in the ICDM cluster attribute.
* false: ff the FeatureMap bit is not enabled in the ICDM cluster attribute.
* false: if the FeatureMap bit is not enabled in the ICDM cluster attribute.
* if we failed to read the FeatureMap attribute.
*/
bool SupportsFeature(Clusters::IcdManagement::Feature feature);
Expand Down Expand Up @@ -186,21 +186,21 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
/**
* @brief UpdateICDMode checks in which ICDMode (SIT or LIT) the ICD can go to and updates the mode if necessary.
* For a SIT ICD, the function does nothing.
* For a LIT ICD, the function checks if the ICD has a registration in the ICDMonitoringTable to determine in which
* For a LIT ICD, the function checks if the ICD has a registration in the ICDMonitoringTable to determine which
* ICDMode the ICD must be in.
*/
void UpdateICDMode();

/**
* @brief UpdateOperationState updates the OperationState of the ICD to the requested one.
* IdleMode -> IdleMode : No actions are necessary, do nothing.
* IdleMode -> ActiveMode : Transition the device to ActiveMode, start the ActiveMode timer and triggers all necessary
* IdleMode -> ActiveMode : Transition the device to ActiveMode, start the ActiveMode timer and trigger all necessary
* operations. These operations could be : Send Check-In messages
* Send subscription reports
* Process user actions
* ActiveMode -> ActiveMode : Increase remaining ActiveMode timer to one ActiveModeThreshold.
* If ActiveModeThreshold is 0, do nothing.
* ActiveMode -> IdleMode : Transition ICD to IdleMode and starts the IdleMode timer.
* ActiveMode -> IdleMode : Transition ICD to IdleMode and start the IdleMode timer.
*
* @param state requested OperationalState for the ICD to transition to
*/
Expand All @@ -209,7 +209,7 @@ class ICDManager : public ICDListener, public TestEventTriggerHandler
/**
* @brief Set or Remove a keep ActiveMode requirement for the given flag
* If state is true and the ICD is in IdleMode, transition the ICD to ActiveMode
* If state is false and the ICD is in ActiveMode, verifies if we can transition the ICD to IdleMode.
* If state is false and the ICD is in ActiveMode, check whether we can transition the ICD to IdleMode.
* If we can, transition the ICD to IdleMode.
*
* @param flag KeepActiveFlag to remove or add
Expand Down
4 changes: 2 additions & 2 deletions src/app/icd/server/ICDStateObserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ namespace chip {
namespace app {

/**
* @brief Public API used my the ICDManager to expose when different events occurs.
* ICDManager::RegisterObserver can be used to register as an Observer to be notified when these events occurs.
* @brief Public API used by the ICDManager to expose when different events occur.
* ICDManager::RegisterObserver can be used to register as an Observer to be notified when these events occur.
* These functions are called synchronously.
*/
class ICDStateObserver
Expand Down

0 comments on commit f1c6f1f

Please sign in to comment.