Skip to content

Commit

Permalink
Fix empty report feedback loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs committed Oct 3, 2024
1 parent f2dd444 commit 2cfb338
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/reporting/ReportScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class ReportScheduler : public ReadHandler::Observer, public ICDStateObserver
IsEngineRunScheduled()));
}

bool CanStartReporting() const { return mReadHandler->CanStartReporting(); }
bool IsChunkedReport() const { return mReadHandler->IsChunkedReport(); }
bool IsEngineRunScheduled() const { return mFlags.Has(ReadHandlerNodeFlags::EngineRunScheduled); }
void SetEngineRunScheduled(bool aEngineRunScheduled)
Expand Down Expand Up @@ -231,6 +232,7 @@ class ReportScheduler : public ReadHandler::Observer, public ICDStateObserver
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST

protected:
friend class chip::app::TestReadInteraction;
friend class chip::app::reporting::TestReportScheduler;

/// @brief Find the ReadHandlerNode for a given ReadHandler pointer
Expand Down
2 changes: 1 addition & 1 deletion src/app/reporting/SynchronizedReportSchedulerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void SynchronizedReportSchedulerImpl::TimerFired()
VerifyOrReturn(mNodesPool.Allocated());

mNodesPool.ForEachActiveObject([now, &firedEarly](ReadHandlerNode * node) {
if (node->GetMinTimestamp() <= now)
if (node->GetMinTimestamp() <= now && node->CanStartReporting())
{
// Since this handler can now report whenever it wants to, mark it as allowed to report if any other handler is
// reporting using the CanBeSynced flag.
Expand Down

0 comments on commit 2cfb338

Please sign in to comment.