diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index 5810bae71d854b..7aa33a5400ddeb 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -293,7 +293,7 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath); * * @retval CHIP_NO_ERROR on success */ -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport); /** diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index b03544f5c5bad5..9acb2cf77f7569 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -62,7 +62,7 @@ EventNumber Engine::CountEvents(ReadHandler * apReadHandler, EventNumber * apIni CHIP_ERROR Engine::RetrieveClusterData(FabricIndex aAccessingFabricIndex, AttributeReportIBs::Builder & aAttributeReportIBs, - const ConcreteAttributePath & aPath) + const ConcreteReadAttributePath & aPath) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -100,6 +100,8 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu SuccessOrExit(err = aReportDataBuilder.GetError()); { + // TODO: Figure out how AttributePathExpandIterator should handle read + // vs write paths. ConcreteAttributePath readPath; // For each path included in the interested path of the read handler... @@ -129,7 +131,8 @@ CHIP_ERROR Engine::BuildSingleReportDataAttributeReportIBs(ReportDataMessage::Bu TLV::TLVWriter attributeBackup; attributeReportIBs.Checkpoint(attributeBackup); - err = RetrieveClusterData(apReadHandler->GetAccessingFabricIndex(), attributeReportIBs, readPath); + ConcreteReadAttributePath pathForRetrieval(readPath); + err = RetrieveClusterData(apReadHandler->GetAccessingFabricIndex(), attributeReportIBs, pathForRetrieval); if (err != CHIP_NO_ERROR) { // We met a error during writing reports, one common case is we are running out of buffer, rollback the diff --git a/src/app/reporting/Engine.h b/src/app/reporting/Engine.h index 38aa29bd61d996..9a74acc5cf5923 100644 --- a/src/app/reporting/Engine.h +++ b/src/app/reporting/Engine.h @@ -97,7 +97,7 @@ class Engine CHIP_ERROR BuildSingleReportDataEventReports(ReportDataMessage::Builder & reportDataBuilder, ReadHandler * apReadHandler, bool * apHasMoreChunks); CHIP_ERROR RetrieveClusterData(FabricIndex aAccessingFabricIndex, AttributeReportIBs::Builder & aAttributeReportIBs, - const ConcreteAttributePath & aClusterInfo); + const ConcreteReadAttributePath & aClusterInfo); EventNumber CountEvents(ReadHandler * apReadHandler, EventNumber * apInitialEvents); /** diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index 086889fc2b1d7f..53e8601594ad50 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -217,7 +217,7 @@ class MockInteractionModelApp : public chip::app::ReadClient::Callback, public c namespace chip { namespace app { -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { AttributeDataIB::Builder attributeData; diff --git a/src/app/tests/integration/chip_im_initiator.cpp b/src/app/tests/integration/chip_im_initiator.cpp index 0d8c70c9f6826a..ef5818b4d27e84 100644 --- a/src/app/tests/integration/chip_im_initiator.cpp +++ b/src/app/tests/integration/chip_im_initiator.cpp @@ -631,7 +631,7 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa gLastCommandResult = TestCommandResult::kSuccess; } -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { AttributeStatusIB::Builder attributeStatus = aAttributeReport.CreateAttributeStatus(); diff --git a/src/app/tests/integration/chip_im_responder.cpp b/src/app/tests/integration/chip_im_responder.cpp index 82183111c7b495..eddf1916a5fd69 100644 --- a/src/app/tests/integration/chip_im_responder.cpp +++ b/src/app/tests/integration/chip_im_responder.cpp @@ -110,7 +110,7 @@ void DispatchSingleClusterResponseCommand(const ConcreteCommandPath & aCommandPa (void) apCommandObj; } -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { AttributeDataIB::Builder attributeData = aAttributeReport.CreateAttributeData(); diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp index 08a0a8ef868ac9..a2d08b902cfdfd 100644 --- a/src/app/util/ember-compatibility-functions.cpp +++ b/src/app/util/ember-compatibility-functions.cpp @@ -210,7 +210,7 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) return emberAfContainsServer(aCommandPath.mEndpointId, aCommandPath.mClusterId); } -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { ChipLogDetail(DataManagement, @@ -234,14 +234,12 @@ CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const Concre AttributeAccessInterface * attrOverride = findAttributeAccessOverride(aPath.mEndpointId, aPath.mClusterId); if (attrOverride != nullptr) { - ConcreteReadAttributePath readPath(aPath); - // TODO: We should probably clone the writer and convert failures here // into status responses, unless our caller already does that. writer = attributeDataIBBuilder.GetWriter(); VerifyOrReturnError(writer != nullptr, CHIP_NO_ERROR); AttributeValueEncoder valueEncoder(writer, aAccessingFabricIndex); - ReturnErrorOnFailure(attrOverride->Read(readPath, valueEncoder)); + ReturnErrorOnFailure(attrOverride->Read(aPath, valueEncoder)); if (valueEncoder.TriedEncode()) { diff --git a/src/controller/tests/data_model/TestCommands.cpp b/src/controller/tests/data_model/TestCommands.cpp index 9eb0523bdb4133..63962fa0b008ab 100644 --- a/src/controller/tests/data_model/TestCommands.cpp +++ b/src/controller/tests/data_model/TestCommands.cpp @@ -135,7 +135,7 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) return (aCommandPath.mEndpointId == kTestEndpointId && aCommandPath.mClusterId == TestCluster::Id); } -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; diff --git a/src/controller/tests/data_model/TestRead.cpp b/src/controller/tests/data_model/TestRead.cpp index aec1d89e7560ef..de7ff36ff47580 100644 --- a/src/controller/tests/data_model/TestRead.cpp +++ b/src/controller/tests/data_model/TestRead.cpp @@ -58,7 +58,7 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) return (aCommandPath.mEndpointId == kTestEndpointId && aCommandPath.mClusterId == TestCluster::Id); } -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { diff --git a/src/controller/tests/data_model/TestWrite.cpp b/src/controller/tests/data_model/TestWrite.cpp index 0b97160f73490b..7782085882c0a5 100644 --- a/src/controller/tests/data_model/TestWrite.cpp +++ b/src/controller/tests/data_model/TestWrite.cpp @@ -59,7 +59,7 @@ bool ServerClusterCommandExists(const ConcreteCommandPath & aCommandPath) return (aCommandPath.mEndpointId == kTestEndpointId && aCommandPath.mClusterId == TestCluster::Id); } -CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteAttributePath & aPath, +CHIP_ERROR ReadSingleClusterData(FabricIndex aAccessingFabricIndex, const ConcreteReadAttributePath & aPath, AttributeReportIB::Builder & aAttributeReport) { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE;