Skip to content

Commit

Permalink
Group encryption/decryption enabled: Bugs fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcasallas-silabs committed Feb 2, 2022
1 parent 282ac0e commit 2541903
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/clusters/groups-server/groups-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,11 @@ static EmberAfStatus GroupAdd(FabricIndex fabricIndex, EndpointId endpointId, Gr
GroupDataProvider * provider = GetGroupDataProvider();
VerifyOrReturnError(nullptr != provider, EMBER_ZCL_STATUS_NOT_FOUND);

provider->SetGroupInfo(fabricIndex, GroupDataProvider::GroupInfo(groupId, groupName));
CHIP_ERROR err = provider->AddEndpoint(fabricIndex, groupId, endpointId);
CHIP_ERROR err = provider->SetGroupInfo(fabricIndex, GroupDataProvider::GroupInfo(groupId, groupName));
if (CHIP_NO_ERROR == err)
{
err = provider->AddEndpoint(fabricIndex, groupId, endpointId);
}
if (CHIP_NO_ERROR == err)
{
return EMBER_ZCL_STATUS_SUCCESS;
Expand Down
2 changes: 2 additions & 0 deletions src/credentials/GroupDataProviderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,9 +1102,11 @@ CHIP_ERROR GroupDataProviderImpl::AddEndpoint(chip::FabricIndex fabric_index, ch
if (!group.Find(mStorage, fabric, group_id))
{
// New group
VerifyOrReturnError(fabric.group_count < mMaxGroupsPerFabric, CHIP_ERROR_INVALID_LIST_LENGTH);
ReturnErrorOnFailure(EndpointData(fabric_index, group_id, endpoint_id).Save(mStorage));
// Save the new group into the fabric
group.group_id = group_id;
group.name[0] = 0;
group.first_endpoint = endpoint_id;
group.endpoint_count = 1;
group.next = fabric.first_group;
Expand Down

0 comments on commit 2541903

Please sign in to comment.