From 9efb23c7150ed8af90e6a9d6ea640a588a2b88f9 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Mon, 11 Nov 2024 12:01:20 +0800 Subject: [PATCH] review changes --- .../CodegenDataModelProvider_Write.cpp | 1 + src/app/data-model-provider/Provider.h | 2 +- src/app/reporting/reporting.cpp | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp index 8ff8f2c66d48a0..b3ed5228bc2828 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp @@ -270,6 +270,7 @@ void CodegenDataModelProvider::Temporary_ReportAttributeChanged(const AttributeP } else { + // If cluster Id is invalid, mark the endpoint dirty using the path. This can happen when enabling/disabling the endpoint. change_listener.MarkDirty(path); } } diff --git a/src/app/data-model-provider/Provider.h b/src/app/data-model-provider/Provider.h index 23c0ea711ebd85..4bc7e7c1cb2f20 100644 --- a/src/app/data-model-provider/Provider.h +++ b/src/app/data-model-provider/Provider.h @@ -111,7 +111,7 @@ class Provider : public ProviderMetadataTree /// should be marked as `dirty` by the data model provider listener so that the reporter can notify the subscriber /// of attribute changes. /// This function should be invoked when attribute managed by attribute access interface is modified but not - /// through am actual Write interaction. + /// through an actual Write interaction. /// For example, if the LastNetworkingStatus attribute changes because the NetworkCommissioning driver detects a /// network connection status change and calls SetLastNetworkingStatusValue(). The data model provider can recognize /// this change by invoking this function at the point of change. diff --git a/src/app/reporting/reporting.cpp b/src/app/reporting/reporting.cpp index d0e07544149d6b..5ce65aa8d7d2d1 100644 --- a/src/app/reporting/reporting.cpp +++ b/src/app/reporting/reporting.cpp @@ -24,6 +24,12 @@ using namespace chip; using namespace chip::app; +#if defined(__GNUC__) || defined(__clang__) +// Disable the deprecated warning only for this file +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + void MatterReportingAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId) { // Attribute writes have asserted this already, but this assert should catch @@ -52,3 +58,6 @@ void MatterReportingAttributeChangeCallback(EndpointId endpoint) InteractionModelEngine::GetInstance()->GetDataModelProvider()->Temporary_ReportAttributeChanged(AttributePathParams(endpoint)); } +#if defined(__GNUC__) || defined(__clang__) +#pragma GCC diagnostic pop +#endif