Skip to content

Commit

Permalink
Fix MinInterval handling in ReadClient.
Browse files Browse the repository at this point in the history
We had codepaths on which we did not store MinInterval for an outgoing
subscribe request, and would later report the wrong MinInterval.
  • Loading branch information
bzbarsky-apple committed Jun 22, 2022
1 parent d1a4bb7 commit d841a01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/ReadClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,14 +865,15 @@ CHIP_ERROR ReadClient::SendSubscribeRequest(const ReadPrepareParams & aReadPrepa
{
VerifyOrReturnError(aReadPrepareParams.mMinIntervalFloorSeconds <= aReadPrepareParams.mMaxIntervalCeilingSeconds,
CHIP_ERROR_INVALID_ARGUMENT);
mMinIntervalFloorSeconds = aReadPrepareParams.mMinIntervalFloorSeconds;
return SendSubscribeRequestImpl(aReadPrepareParams);
}

CHIP_ERROR ReadClient::SendSubscribeRequestImpl(const ReadPrepareParams & aReadPrepareParams)
{
VerifyOrReturnError(ClientState::Idle == mState, CHIP_ERROR_INCORRECT_STATE);

mMinIntervalFloorSeconds = aReadPrepareParams.mMinIntervalFloorSeconds;

// Todo: Remove the below, Update span in ReadPrepareParams
Span<AttributePathParams> attributePaths(aReadPrepareParams.mpAttributePathParamsList,
aReadPrepareParams.mAttributePathParamsListSize);
Expand Down

0 comments on commit d841a01

Please sign in to comment.