Skip to content

Commit 1928999

Browse files
authored
[Fabric-Sync] Use aggregator endpoint instead of root endpoint for CCTRL (#35977)
* Use aggregator endpoint instead of root endpoint for CCTRL * Address review comments
1 parent a0eafce commit 1928999

File tree

10 files changed

+229
-172
lines changed

10 files changed

+229
-172
lines changed

examples/fabric-admin/device_manager/DeviceManager.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ using namespace chip::app::Clusters;
3030

3131
namespace {
3232

33+
constexpr EndpointId kAggregatorEndpointId = 1;
3334
constexpr uint16_t kWindowTimeout = 300;
3435
constexpr uint16_t kIteration = 1000;
3536
constexpr uint16_t kSubscribeMinInterval = 0;
@@ -207,7 +208,7 @@ void DeviceManager::SubscribeRemoteFabricBridge()
207208
// Prepare and push the commissioner control subscribe command
208209
commandBuilder.Add("commissionercontrol subscribe-event commissioning-request-result ");
209210
commandBuilder.AddFormat("%d %d %lu %d --is-urgent true --keepSubscriptions true", kSubscribeMinInterval, kSubscribeMaxInterval,
210-
mRemoteBridgeNodeId, kRootEndpointId);
211+
mRemoteBridgeNodeId, kAggregatorEndpointId);
211212
PushCommand(commandBuilder.c_str());
212213
}
213214

@@ -224,7 +225,7 @@ void DeviceManager::ReadSupportedDeviceCategories()
224225

225226
commandBuilder.Add("commissionercontrol read supported-device-categories ");
226227
commandBuilder.AddFormat("%ld ", mRemoteBridgeNodeId);
227-
commandBuilder.AddFormat("%d", kRootEndpointId);
228+
commandBuilder.AddFormat("%d", kAggregatorEndpointId);
228229

229230
PushCommand(commandBuilder.c_str());
230231
}
@@ -259,7 +260,7 @@ void DeviceManager::RequestCommissioningApproval()
259260

260261
StringBuilder<kMaxCommandSize> commandBuilder;
261262
commandBuilder.Add("commissionercontrol request-commissioning-approval ");
262-
commandBuilder.AddFormat("%lu %u %u %lu %d", requestId, vendorId, productId, mRemoteBridgeNodeId, kRootEndpointId);
263+
commandBuilder.AddFormat("%lu %u %u %lu %d", requestId, vendorId, productId, mRemoteBridgeNodeId, kAggregatorEndpointId);
263264

264265
mRequestId = requestId;
265266
PushCommand(commandBuilder.c_str());
@@ -398,7 +399,7 @@ void DeviceManager::SendCommissionNodeRequest(uint64_t requestId, uint16_t respo
398399

399400
StringBuilder<kMaxCommandSize> commandBuilder;
400401
commandBuilder.Add("commissionercontrol commission-node ");
401-
commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kRootEndpointId);
402+
commandBuilder.AddFormat("%lu %u %lu %d", requestId, responseTimeoutSeconds, mRemoteBridgeNodeId, kAggregatorEndpointId);
402403

403404
PushCommand(commandBuilder.c_str());
404405
}

examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter

+15-15
Original file line numberDiff line numberDiff line change
@@ -2059,21 +2059,6 @@ endpoint 0 {
20592059
handle command KeySetReadAllIndices;
20602060
handle command KeySetReadAllIndicesResponse;
20612061
}
2062-
2063-
server cluster CommissionerControl {
2064-
emits event CommissioningRequestResult;
2065-
ram attribute supportedDeviceCategories default = 0;
2066-
callback attribute generatedCommandList;
2067-
callback attribute acceptedCommandList;
2068-
callback attribute eventList;
2069-
callback attribute attributeList;
2070-
ram attribute featureMap default = 0;
2071-
ram attribute clusterRevision default = 1;
2072-
2073-
handle command RequestCommissioningApproval;
2074-
handle command CommissionNode;
2075-
handle command ReverseOpenCommissioningWindow;
2076-
}
20772062
}
20782063
endpoint 1 {
20792064
device type ma_aggregator = 14, version 1;
@@ -2103,6 +2088,21 @@ endpoint 1 {
21032088
callback attribute featureMap;
21042089
callback attribute clusterRevision;
21052090
}
2091+
2092+
server cluster CommissionerControl {
2093+
emits event CommissioningRequestResult;
2094+
ram attribute supportedDeviceCategories default = 0;
2095+
callback attribute generatedCommandList;
2096+
callback attribute acceptedCommandList;
2097+
callback attribute eventList;
2098+
callback attribute attributeList;
2099+
ram attribute featureMap default = 0;
2100+
ram attribute clusterRevision default = 1;
2101+
2102+
handle command RequestCommissioningApproval;
2103+
handle command CommissionNode;
2104+
handle command ReverseOpenCommissioningWindow;
2105+
}
21062106
}
21072107

21082108

0 commit comments

Comments
 (0)