Skip to content

Commit

Permalink
Removed check on unused parameter in CalculateNextReportTiemout for S…
Browse files Browse the repository at this point in the history
…ync Scheduler
  • Loading branch information
lpbeliveau-silabs committed Nov 24, 2023
1 parent 1373772 commit 735ecf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
5 changes: 4 additions & 1 deletion src/app/reporting/ReportScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ class ReportScheduler : public ReadHandler::Observer, public ICDStateObserver
}

/// @brief Check if a ReadHandler is reportable without considering the timing
bool IsReadHandlerReportable(ReadHandler * aReadHandler) const { return aReadHandler->ShouldStartReporting(); }
bool IsReadHandlerReportable(ReadHandler * aReadHandler) const
{
return (nullptr != aReadHandler) ? aReadHandler->ShouldStartReporting() : false;
}
/// @brief Sets the ForceDirty flag of a ReadHandler
void HandlerForceDirtyState(ReadHandler * aReadHandler) { aReadHandler->ForceDirtyState(); }

Expand Down
13 changes: 1 addition & 12 deletions src/app/reporting/SynchronizedReportSchedulerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ CHIP_ERROR SynchronizedReportSchedulerImpl::FindNextMinInterval(const Timestamp
CHIP_ERROR SynchronizedReportSchedulerImpl::CalculateNextReportTimeout(Timeout & timeout, ReadHandlerNode * aNode,
const Timestamp & now)
{
VerifyOrReturnError(nullptr != FindReadHandlerNode(aNode->GetReadHandler()), CHIP_ERROR_INVALID_ARGUMENT);
ReturnErrorOnFailure(FindNextMaxInterval(now));
ReturnErrorOnFailure(FindNextMinInterval(now));
bool reportableNow = false;
Expand Down Expand Up @@ -205,18 +204,8 @@ void SynchronizedReportSchedulerImpl::TimerFired()
// If there are no handlers registers, no need to schedule the next report
if (mNodesPool.Allocated() && firedEarly)
{
ReadHandlerNode * firstNode = nullptr;

// If we fired the timer early, we need to restart the timer
mNodesPool.ForEachActiveObject([&firstNode](ReadHandlerNode * node) {
firstNode = node;
return Loop::Break;
});

VerifyOrReturn(firstNode); // Verify we have a valid node

Timeout timeout = Milliseconds32(0);
ReturnOnFailure(CalculateNextReportTimeout(timeout, firstNode, now));
ReturnOnFailure(CalculateNextReportTimeout(timeout, nullptr, now));
ScheduleReport(timeout, nullptr, now);
}
else
Expand Down

0 comments on commit 735ecf6

Please sign in to comment.