Skip to content

Commit ae3ba59

Browse files
clean up comments
1 parent 48fe93d commit ae3ba59

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/app/icd/server/ICDManager.cpp

+15-14
Original file line numberDiff line numberDiff line change
@@ -250,18 +250,18 @@ bool ICDManager::CheckInMessagesWouldBeSent(const std::function<ShouldCheckInMsg
250250

251251
/**
252252
* ShouldCheckInMsgsBeSentAtActiveModeFunction is used to determine if a Check-In message is required for a given registration.
253-
* Due to how the ICD Check-In use-case interacts with the persistent subscription and subscription timeout resumption,
254-
* having a single implementation of the function renders the implematention very difficult to understand and maintain.
255-
* Because of this, each valid feature combination has its own implementation of the verifier.
253+
* Due to how the ICD Check-In use-case interacts with the persistent subscription and subscription timeout resumption features,
254+
* having a single implementation of the function renders the implementation very difficult to understand and maintain.
255+
* Because of this, each valid feature combination has its own implementation of the function.
256256
*/
257257
#if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS
258258
#if CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
259259
/**
260260
* @brief Implementation for when the persistant subscription and subscription timeout resumption feature are present.
261-
* Verifier checks that there no active or persisted subscriptions for a given fabricIndex or subjectID.
261+
* Function checks that there no active or persisted subscriptions for a given fabricIndex or subjectID.
262262
*
263263
* @param aFabricIndex
264-
* @param subjectID subjectID to check. Can be an opperationnal node id or a CAT
264+
* @param subjectID subjectID to check. Can be an operational node id or a CAT
265265
*
266266
* @return true Returns true if the fabricIndex and subjectId combination does not have an active or a persisted subscription.
267267
* @return false Returns false if the fabricIndex and subjectId combination has an active or persisted subscription.
@@ -273,13 +273,13 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
273273
}
274274
#else
275275
/**
276-
* @brief Implementation for when the persistant subscription is present without the subscription timeout resumption feature.
277-
* Verifier checks that there no active subscriptions. If the boot up subscription resumption has been completed,
278-
* verifier also checks if there are persisted subscriptions.
276+
* @brief Implementation for when the persistant subscription feature is present without the subscription timeout resumption feature.
277+
* Function checks that there no active subscriptions. If the boot up subscription resumption has not been completed,
278+
* function also checks if there are persisted subscriptions.
279279
*
280280
* @note The persistent subscriptions feature tries to resume subscriptions at the highest min interval
281281
* of all the persisted subscriptions. As such, it is possible for the ICD to return to Idle Mode
282-
* until the timer elaspses. We do not when to send Check-In message to clients with persisted subscriptions
282+
* until the timer elaspses. We do not want to send Check-In messages to clients with persisted subscriptions
283283
* until we have tried to resubscribe.
284284
*
285285
* @param aFabricIndex
@@ -289,7 +289,7 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
289289
* If the boot up susbscription has not been completed, there must not be a persisted subscription either.
290290
* @return false Returns false if the fabricIndex and subjectId combination has an active subscription.
291291
* If the boot up susbscription has not been completed,
292-
* if the fabricIndex and subjectId combination has a persisted subscription.
292+
* returns false if the fabricIndex and subjectId combination has a persisted subscription.
293293
*/
294294
bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabricIndex, NodeId subjectID)
295295
{
@@ -305,8 +305,8 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
305305
#endif // CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
306306
#else
307307
/**
308-
* @brief Implementation for when neither the persistant subscription and subscription timeout resumption feature are present.
309-
* Verifier checks that there no active sbuscriptions for a given fabricIndex and subjectId combination.
308+
* @brief Implementation for when neither the persistant subscription and subscription timeout resumption features are present.
309+
* Function checks that there no active sbuscriptions for a given fabricIndex and subjectId combination.
310310
*
311311
* @param aFabricIndex
312312
* @param subjectID subjectID to check. Can be an opperationnal node id or a CAT
@@ -328,6 +328,7 @@ void ICDManager::TriggerCheckInMessages(const std::function<ShouldCheckInMsgsBeS
328328
// If we are already in ActiveMode, Check-In messages have already been sent.
329329
VerifyOrReturn(mOperationalState == OperationalState::IdleMode);
330330

331+
// If we don't have any Check-In messages to send, do nothing
331332
VerifyOrReturn(CheckInMessagesWouldBeSent(verifier));
332333
UpdateOperationState(OperationalState::ActiveMode);
333334
}
@@ -390,15 +391,15 @@ void ICDManager::UpdateOperationState(OperationalState state)
390391
mOperationalState = OperationalState::IdleMode;
391392

392393
#if CHIP_CONFIG_ENABLE_ICD_CIP
393-
std::function<ShouldCheckInMsgsBeSentFunction> verifier =
394+
std::function<ShouldCheckInMsgsBeSentFunction> function =
394395
std::bind(&ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction, this, std::placeholders::_1, std::placeholders::_2);
395396
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
396397

397398
// When the active mode interval is 0, we stay in idleMode until a notification brings the icd into active mode
398399
// unless the device would need to send Check-In messages
399400
if (ICDConfigurationData::GetInstance().GetActiveModeDuration() > kZero
400401
#if CHIP_CONFIG_ENABLE_ICD_CIP
401-
|| CheckInMessagesWouldBeSent(verifier)
402+
|| CheckInMessagesWouldBeSent(function)
402403
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
403404
)
404405
{

0 commit comments

Comments
 (0)