@@ -108,7 +108,7 @@ void ICDManager::Shutdown()
108
108
109
109
#if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS && !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
110
110
mIsBootUpResumeSubscriptionExecuted = false ;
111
- #endif // !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
111
+ #endif // CHIP_CONFIG_PERSIST_SUBSCRIPTIONS && !CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
112
112
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
113
113
}
114
114
@@ -208,7 +208,7 @@ void ICDManager::SendCheckInMsgs()
208
208
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
209
209
}
210
210
211
- bool ICDManager::CheckInMessagesWouldBeSent (const std::function<ShouldCheckInMsgsBeSentFunction> shouldCheckInMsgsBeSentFunction & )
211
+ bool ICDManager::CheckInMessagesWouldBeSent (const std::function<ShouldCheckInMsgsBeSentFunction> & shouldCheckInMsgsBeSentFunction )
212
212
{
213
213
VerifyOrReturnValue (shouldCheckInMsgsBeSentFunction, false );
214
214
@@ -250,18 +250,18 @@ bool ICDManager::CheckInMessagesWouldBeSent(const std::function<ShouldCheckInMsg
250
250
251
251
/* *
252
252
* 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 .
256
256
*/
257
257
#if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS
258
258
#if CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
259
259
/* *
260
260
* @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.
262
262
*
263
263
* @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
265
265
*
266
266
* @return true Returns true if the fabricIndex and subjectId combination does not have an active or a persisted subscription.
267
267
* @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
273
273
}
274
274
#else
275
275
/* *
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
277
+ * feature. 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.
279
279
*
280
280
* @note The persistent subscriptions feature tries to resume subscriptions at the highest min interval
281
281
* 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
283
283
* until we have tried to resubscribe.
284
284
*
285
285
* @param aFabricIndex
@@ -289,7 +289,7 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
289
289
* If the boot up susbscription has not been completed, there must not be a persisted subscription either.
290
290
* @return false Returns false if the fabricIndex and subjectId combination has an active subscription.
291
291
* 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.
293
293
*/
294
294
bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction (FabricIndex aFabricIndex, NodeId subjectID)
295
295
{
@@ -305,8 +305,8 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
305
305
#endif // CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
306
306
#else
307
307
/* *
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.
310
310
*
311
311
* @param aFabricIndex
312
312
* @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
328
328
// If we are already in ActiveMode, Check-In messages have already been sent.
329
329
VerifyOrReturn (mOperationalState == OperationalState::IdleMode);
330
330
331
+ // If we don't have any Check-In messages to send, do nothing
331
332
VerifyOrReturn (CheckInMessagesWouldBeSent (verifier));
332
333
UpdateOperationState (OperationalState::ActiveMode);
333
334
}
@@ -390,15 +391,15 @@ void ICDManager::UpdateOperationState(OperationalState state)
390
391
mOperationalState = OperationalState::IdleMode;
391
392
392
393
#if CHIP_CONFIG_ENABLE_ICD_CIP
393
- std::function<ShouldCheckInMsgsBeSentFunction> verifier =
394
+ std::function<ShouldCheckInMsgsBeSentFunction> function =
394
395
std::bind (&ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction, this , std::placeholders::_1, std::placeholders::_2);
395
396
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
396
397
397
398
// When the active mode interval is 0, we stay in idleMode until a notification brings the icd into active mode
398
399
// unless the device would need to send Check-In messages
399
400
if (ICDConfigurationData::GetInstance ().GetActiveModeDuration () > kZero
400
401
#if CHIP_CONFIG_ENABLE_ICD_CIP
401
- || CheckInMessagesWouldBeSent (verifier )
402
+ || CheckInMessagesWouldBeSent (function )
402
403
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
403
404
)
404
405
{
0 commit comments