@@ -257,8 +257,8 @@ bool ICDManager::CheckInMessagesWouldBeSent(const std::function<ShouldCheckInMsg
257
257
#if CHIP_CONFIG_PERSIST_SUBSCRIPTIONS
258
258
#if CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
259
259
/* *
260
- * @brief Implementation for when the persistant subscription and subscription timeout resumption feature are present.
261
- * Function checks that there no active or persisted subscriptions for a given fabricIndex or subjectID.
260
+ * @brief Implementation for when the persistent subscription and subscription timeout resumption feature are present.
261
+ * Function checks that there are no active or persisted subscriptions for a given fabricIndex or subjectID.
262
262
*
263
263
* @param aFabricIndex
264
264
* @param subjectID subjectID to check. Can be an operational node id or a CAT
@@ -273,8 +273,8 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
273
273
}
274
274
#else
275
275
/* *
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,
276
+ * @brief Implementation for when the persistent subscription feature is present without the subscription timeout resumption
277
+ * feature. Function checks that there are no active subscriptions. If the boot up subscription resumption has not been completed,
278
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
@@ -286,26 +286,24 @@ bool ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction(FabricIndex aFabric
286
286
* @param subjectID subjectID to check. Can be an opperationnal node id or a CAT
287
287
*
288
288
* @return true Returns true if the fabricIndex and subjectId combination does not have an active subscription.
289
- * If the boot up susbscription has not been completed, there must not be a persisted subscription either.
289
+ * If the boot up subscription resumption 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
- * If the boot up susbscription has not been completed,
291
+ * If the boot up subscription resumption has not been completed,
292
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
{
296
- bool wouldSendCheckIn = !(mSubInfoProvider ->SubjectHasActiveSubscription (aFabricIndex, subjectID));
297
-
298
- if (!mIsBootUpResumeSubscriptionExecuted )
299
- {
300
- wouldSendCheckIn = wouldSendCheckIn && !mSubInfoProvider ->SubjectHasPersistedSubscription (aFabricIndex, subjectID);
296
+ bool mightHaveSubscription = mSubInfoProvider ->SubjectHasActiveSubscription (aFabricIndex, subjectID);
297
+ if (!mightHaveSubscription && !mIsBootUpResumeSubscriptionExecuted ) {
298
+ mightHaveSubscription = mSubInfoProvider ->SubjectHasPersistedSubscription (aFabricIndex, subjectID);
301
299
}
302
-
303
- return wouldSendCheckIn ;
300
+
301
+ return !mightHaveSubscription ;
304
302
}
305
303
#endif // CHIP_CONFIG_SUBSCRIPTION_TIMEOUT_RESUMPTION
306
304
#else
307
305
/* *
308
- * @brief Implementation for when neither the persistant subscription and subscription timeout resumption features are present.
306
+ * @brief Implementation for when neither the persistent subscription nor the subscription timeout resumption features are present.
309
307
* Function checks that there no active sbuscriptions for a given fabricIndex and subjectId combination.
310
308
*
311
309
* @param aFabricIndex
@@ -391,7 +389,7 @@ void ICDManager::UpdateOperationState(OperationalState state)
391
389
mOperationalState = OperationalState::IdleMode;
392
390
393
391
#if CHIP_CONFIG_ENABLE_ICD_CIP
394
- std::function<ShouldCheckInMsgsBeSentFunction> function =
392
+ std::function<ShouldCheckInMsgsBeSentFunction> sendCheckInMessagesOnActiveMode =
395
393
std::bind (&ICDManager::ShouldCheckInMsgsBeSentAtActiveModeFunction, this , std::placeholders::_1, std::placeholders::_2);
396
394
#endif // CHIP_CONFIG_ENABLE_ICD_CIP
397
395
0 commit comments