Skip to content

Commit a69e97d

Browse files
authored
Implement Joint Fabric Node management commands (project-chip#40998)
1 parent d68fb4f commit a69e97d

File tree

3 files changed

+275
-23
lines changed

3 files changed

+275
-23
lines changed

src/app/clusters/joint-fabric-datastore-server/joint-fabric-datastore-server.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <app/AttributeAccessInterface.h>
2525
#include <app/AttributeAccessInterfaceRegistry.h>
2626
#include <app/ConcreteCommandPath.h>
27+
#include <app/InteractionModelEngine.h>
2728
#include <app/reporting/reporting.h>
2829
#include <app/server/Server.h>
2930
#include <app/util/attribute-storage.h>
@@ -298,8 +299,7 @@ bool emberAfJointFabricDatastoreClusterAddKeySetCallback(
298299
app::JointFabricDatastore & jointFabricDatastore = Server::GetInstance().GetJointFabricDatastore();
299300

300301
VerifyOrExit(jointFabricDatastore.IsGroupKeySetEntryPresent(groupKeySet.groupKeySetID) == false,
301-
// TODO: make sure this maps to Protocols::InteractionModel::ClusterStatusCode::ConstraintError
302-
err = CHIP_ERROR_INVALID_ARGUMENT);
302+
err = CHIP_IM_GLOBAL_STATUS(ConstraintError));
303303
SuccessOrExit(err = jointFabricDatastore.AddGroupKeySetEntry(groupKeySet));
304304

305305
exit:
@@ -550,7 +550,10 @@ bool emberAfJointFabricDatastoreClusterRefreshNodeCallback(
550550

551551
app::JointFabricDatastore & jointFabricDatastore = Server::GetInstance().GetJointFabricDatastore();
552552

553-
SuccessOrExit(err = jointFabricDatastore.RefreshNode(nodeId));
553+
ReadOnlyBufferBuilder<DataModel::EndpointEntry> endpointsList;
554+
// TODO: Get Endpoints List from connected device with <nodeId>
555+
556+
SuccessOrExit(err = jointFabricDatastore.RefreshNode(nodeId, endpointsList.TakeBuffer()));
554557

555558
exit:
556559
if (err == CHIP_NO_ERROR)

0 commit comments

Comments
 (0)