Skip to content

Commit

Permalink
improve get last report data path api in cluster cache (#23431)
Browse files Browse the repository at this point in the history
-- Return not found error if the last report data path is not concrete cluster path
-- Add doxygen
  • Loading branch information
yunhanw-google authored and pull[bot] committed Jun 19, 2023
1 parent bbf25d8 commit 52a3dbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/ClusterStateCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,12 @@ CHIP_ERROR ClusterStateCache::OnUpdateDataVersionFilterList(DataVersionFilterIBs

CHIP_ERROR ClusterStateCache::GetLastReportDataPath(ConcreteClusterPath & aPath)
{
aPath = mLastReportDataPath;
return CHIP_NO_ERROR;
if (mLastReportDataPath.IsValidConcreteClusterPath())
{
aPath = mLastReportDataPath;
return CHIP_NO_ERROR;
}
return CHIP_ERROR_INCORRECT_STATE;
}
} // namespace app
} // namespace chip
4 changes: 4 additions & 0 deletions src/app/ClusterStateCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ class ClusterStateCache : protected ReadClient::Callback
mEventStatusCache.clear();
}

/*
* Get the last concrete report data path, if path is not concrete cluster path, return CHIP_ERROR_NOT_FOUND
*
*/
CHIP_ERROR GetLastReportDataPath(ConcreteClusterPath & aPath);

private:
Expand Down

0 comments on commit 52a3dbf

Please sign in to comment.