Skip to content

Commit

Permalink
Added reporting attribute change callback in the group server where a…
Browse files Browse the repository at this point in the history
…ctions are modifying the group table (#30055)
  • Loading branch information
lpbeliveau-silabs committed Oct 27, 2023
1 parent e3a2767 commit 638eb93
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/att-storage.h>
#include <app/reporting/reporting.h>
#include <app/util/af.h>
#include <app/util/config.h>
#include <credentials/GroupDataProvider.h>
Expand Down Expand Up @@ -90,6 +91,8 @@ static Status GroupAdd(FabricIndex fabricIndex, EndpointId endpointId, GroupId g
}
if (CHIP_NO_ERROR == err)
{
MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id,
GroupKeyManagement::Attributes::GroupTable::Id);
return Status::Success;
}

Expand All @@ -109,6 +112,8 @@ static EmberAfStatus GroupRemove(FabricIndex fabricIndex, EndpointId endpointId,
CHIP_ERROR err = provider->RemoveEndpoint(fabricIndex, groupId, endpointId);
if (CHIP_NO_ERROR == err)
{
MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id,
GroupKeyManagement::Attributes::GroupTable::Id);
return EMBER_ZCL_STATUS_SUCCESS;
}

Expand Down Expand Up @@ -322,7 +327,7 @@ bool emberAfGroupsClusterRemoveAllGroupsCallback(app::CommandHandler * commandOb

provider->RemoveEndpoint(fabricIndex, commandPath.mEndpointId);
status = Status::Success;

MatterReportingAttributeChangeCallback(kRootEndpointId, GroupKeyManagement::Id, GroupKeyManagement::Attributes::GroupTable::Id);
exit:
commandObj->AddStatus(commandPath, status);
if (Status::Success != status)
Expand Down

0 comments on commit 638eb93

Please sign in to comment.