|
31 | 31 | #include <app/InteractionModelEngine.h>
|
32 | 32 | #include <app/RequiredPrivilege.h>
|
33 | 33 | #include <app/reporting/Engine.h>
|
| 34 | +#include <app/reporting/Read.h> |
34 | 35 | #include <app/util/MatterCallbacks.h>
|
35 | 36 | #include <app/util/ember-compatibility-functions.h>
|
36 | 37 |
|
@@ -79,25 +80,6 @@ bool Engine::IsClusterDataVersionMatch(const SingleLinkedListNode<DataVersionFil
|
79 | 80 | return existPathMatch && !existVersionMismatch;
|
80 | 81 | }
|
81 | 82 |
|
82 |
| -CHIP_ERROR |
83 |
| -Engine::RetrieveClusterData(const SubjectDescriptor & aSubjectDescriptor, bool aIsFabricFiltered, |
84 |
| - AttributeReportIBs::Builder & aAttributeReportIBs, const ConcreteReadAttributePath & aPath, |
85 |
| - AttributeEncodeState * aEncoderState) |
86 |
| -{ |
87 |
| - ChipLogDetail(DataManagement, "<RE:Run> Cluster %" PRIx32 ", Attribute %" PRIx32 " is dirty", aPath.mClusterId, |
88 |
| - aPath.mAttributeId); |
89 |
| - |
90 |
| - DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, |
91 |
| - DataModelCallbacks::OperationOrder::Pre, aPath); |
92 |
| - |
93 |
| - ReturnErrorOnFailure(ReadSingleClusterData(aSubjectDescriptor, aIsFabricFiltered, aPath, aAttributeReportIBs, aEncoderState)); |
94 |
| - |
95 |
| - DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Read, |
96 |
| - DataModelCallbacks::OperationOrder::Post, aPath); |
97 |
| - |
98 |
| - return CHIP_NO_ERROR; |
99 |
| -} |
100 |
| - |
101 | 83 | static bool IsOutOfWriterSpaceError(CHIP_ERROR err)
|
102 | 84 | {
|
103 | 85 | return err == CHIP_ERROR_NO_MEMORY || err == CHIP_ERROR_BUFFER_TOO_SMALL;
|
@@ -200,8 +182,8 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu
|
200 | 182 | ConcreteReadAttributePath pathForRetrieval(readPath);
|
201 | 183 | // Load the saved state from previous encoding session for chunking of one single attribute (list chunking).
|
202 | 184 | AttributeEncodeState encodeState = apReadHandler->GetAttributeEncodeState();
|
203 |
| - err = RetrieveClusterData(apReadHandler->GetSubjectDescriptor(), apReadHandler->IsFabricFiltered(), attributeReportIBs, |
204 |
| - pathForRetrieval, &encodeState); |
| 185 | + err = Impl::RetrieveClusterData(mpImEngine->GetDataModel(), apReadHandler->GetSubjectDescriptor(), |
| 186 | + apReadHandler->IsFabricFiltered(), attributeReportIBs, pathForRetrieval, &encodeState); |
205 | 187 | if (err != CHIP_NO_ERROR)
|
206 | 188 | {
|
207 | 189 | // If error is not an "out of writer space" error, rollback and encode status.
|
|
0 commit comments