Skip to content

Commit ec840bc

Browse files
committed
Remove NotifyAllAttributesChanged
1 parent d51a00c commit ec840bc

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

src/app/server-cluster/DefaultServerCluster.cpp

-9
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,6 @@ void DefaultServerCluster::NotifyAttributeChanged(AttributeId attributeId)
106106
mContext->interactionContext->dataModelChangeListener->MarkDirty({ path.mEndpointId, path.mClusterId, attributeId });
107107
}
108108

109-
void DefaultServerCluster::NotifyAllAttributesChanged()
110-
{
111-
IncreaseDataVersion();
112-
113-
VerifyOrReturn(mContext != nullptr);
114-
const ConcreteClusterPath path = GetPath();
115-
mContext->interactionContext->dataModelChangeListener->MarkDirty({ path.mEndpointId, path.mClusterId });
116-
}
117-
118109
BitFlags<ClusterQualityFlags> DefaultServerCluster::GetClusterFlags() const
119110
{
120111
return {};

src/app/server-cluster/DefaultServerCluster.h

-6
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ class DefaultServerCluster : public ServerClusterInterface
9595
/// notify that the attribute has changed.
9696
void NotifyAttributeChanged(AttributeId attributeId);
9797

98-
/// A "bulk update" notification, that notifies a wildcard attribute change.
99-
///
100-
/// Increases cluster data version and if a cluster context is available, it will notify
101-
/// that the cluster has changed.
102-
void NotifyAllAttributesChanged();
103-
10498
private:
10599
DataVersion mDataVersion; // will be random-initialized as per spec
106100
};

src/app/server-cluster/tests/TestDefaultServerCluster.cpp

-26
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class FakeDefaultServerCluster : public DefaultServerCluster
6767

6868
void TestIncreaseDataVersion() { IncreaseDataVersion(); }
6969
void TestNotifyAttributeChanged(AttributeId attributeId) { NotifyAttributeChanged(attributeId); }
70-
void TestNotifyAllAttributesChanged() { NotifyAllAttributesChanged(); }
7170

7271
private:
7372
ConcreteClusterPath mPath;
@@ -200,28 +199,3 @@ TEST(TestDefaultServerCluster, NotifyAttributeChanged)
200199
ASSERT_EQ(context.ChangeListener().DirtyList().size(), 1u);
201200
ASSERT_EQ(context.ChangeListener().DirtyList()[0], AttributePathParams(kEndpointId, kClusterId, 234));
202201
}
203-
204-
TEST(TestDefaultServerCluster, NotifyAllAttributesChanged)
205-
{
206-
constexpr EndpointId kEndpointId = 321;
207-
constexpr ClusterId kClusterId = 1122;
208-
FakeDefaultServerCluster cluster({ kEndpointId, kClusterId });
209-
210-
// When no ServerClusterContext is set, only the data version should change.
211-
DataVersion oldVersion = cluster.GetDataVersion();
212-
213-
cluster.TestNotifyAllAttributesChanged();
214-
ASSERT_NE(cluster.GetDataVersion(), oldVersion);
215-
216-
// Create a ServerClusterContext and verify that attribute change notifications are processed.
217-
TestServerClusterContext context;
218-
ASSERT_EQ(cluster.Startup(context.Get()), CHIP_NO_ERROR);
219-
220-
oldVersion = cluster.GetDataVersion();
221-
cluster.TestNotifyAllAttributesChanged();
222-
ASSERT_NE(cluster.GetDataVersion(), oldVersion);
223-
224-
// When all attributes are changed, a wildcard should be used in the list.
225-
ASSERT_EQ(context.ChangeListener().DirtyList().size(), 1u);
226-
ASSERT_EQ(context.ChangeListener().DirtyList()[0], AttributePathParams(kEndpointId, kClusterId));
227-
}

0 commit comments

Comments
 (0)