Skip to content

Commit

Permalink
Fix logic in SetReportingIntervals
Browse files Browse the repository at this point in the history
  • Loading branch information
yunhanw-google committed Jun 7, 2022
1 parent aff91d0 commit 03c9f05
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/ReadHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ class ReadHandler : public Messaging::ExchangeDelegate
CHIP_ERROR SetReportingIntervals(uint16_t aMaxInterval)
{
VerifyOrReturnError(IsIdle(), CHIP_ERROR_INCORRECT_STATE);
mMaxIntervalCeilingSeconds = aMaxInterval;
VerifyOrReturnError(mMinIntervalFloorSeconds <= mMaxIntervalCeilingSeconds, CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrReturnError(mMaxIntervalCeilingSeconds <=
VerifyOrReturnError(mMinIntervalFloorSeconds <= aMaxInterval, CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrReturnError(aMaxInterval <=
std::max(kSubscriptionMaxIntervalPublisherLimit, mMaxIntervalCeilingSeconds),
CHIP_ERROR_INVALID_ARGUMENT);
mMaxIntervalCeilingSeconds = aMaxInterval;
return CHIP_NO_ERROR;
}

Expand Down

0 comments on commit 03c9f05

Please sign in to comment.