From 969f93f82c585a1695fdd9545d58c58f94debd28 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Mon, 18 Nov 2024 10:38:36 +0800 Subject: [PATCH] review changes --- .../CodegenDataModelProvider_Write.cpp | 6 ++++-- src/app/util/mock/attribute-storage.cpp | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp index b3ed5228bc2828..aa5d8f77d845d8 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp @@ -270,8 +270,10 @@ 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); + // When the path has wildcard cluster Id, call the emberAfEndpointChanged to mark attributes on the given endpoint + // as having changing, but do NOT increase/alter any cluster data versions, as this happens when a bridged endpoint is + // added or removed from a bridge and the cluster data is not changed during the process. + emberAfEndpointChanged(path.mEndpointId, &change_listener); } } diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index 57f3d1e5216264..8b3f8a648ccbc5 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -343,6 +343,11 @@ void emberAfAttributeChanged(EndpointId endpoint, ClusterId clusterId, Attribute listener->MarkDirty(AttributePathParams(endpoint, clusterId, attributeId)); } +void emberAfEndpointChanged(EndpointId endpoint, AttributesChangedListener *listener) +{ + listener->MarkDirty(AttributePathParams(endpoint)); +} + unsigned emberAfMetadataStructureGeneration() { return metadataStructureGeneration;