Skip to content

Commit

Permalink
Use aggregator endpoint instead of root endpoint for CCTRL
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Oct 9, 2024
1 parent 0a2e58d commit 837e6b8
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 170 deletions.
9 changes: 5 additions & 4 deletions examples/fabric-admin/device_manager/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ using namespace chip::app::Clusters;

namespace {

constexpr EndpointId kAggregatorEndpointId = 1;
constexpr uint16_t kWindowTimeout = 300;
constexpr uint16_t kIteration = 1000;
constexpr uint16_t kSubscribeMinInterval = 0;
Expand Down Expand Up @@ -207,7 +208,7 @@ void DeviceManager::SubscribeRemoteFabricBridge()
// Prepare and push the commissioner control subscribe command
commandBuilder.Add("commissionercontrol subscribe-event commissioning-request-result ");
commandBuilder.AddFormat("%d %d %lu %d --is-urgent true --keepSubscriptions true", kSubscribeMinInterval, kSubscribeMaxInterval,
mRemoteBridgeNodeId, kRootEndpointId);
mRemoteBridgeNodeId, kAggregatorEndpointId);
PushCommand(commandBuilder.c_str());
}

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

commandBuilder.Add("commissionercontrol read supported-device-categories ");
commandBuilder.AddFormat("%ld ", mRemoteBridgeNodeId);
commandBuilder.AddFormat("%d", kRootEndpointId);
commandBuilder.AddFormat("%d", kAggregatorEndpointId);

PushCommand(commandBuilder.c_str());
}
Expand Down Expand Up @@ -259,7 +260,7 @@ void DeviceManager::RequestCommissioningApproval()

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

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

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

PushCommand(commandBuilder.c_str());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2059,21 +2059,6 @@ endpoint 0 {
handle command KeySetReadAllIndices;
handle command KeySetReadAllIndicesResponse;
}

server cluster CommissionerControl {
emits event CommissioningRequestResult;
ram attribute supportedDeviceCategories default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command RequestCommissioningApproval;
handle command CommissionNode;
handle command ReverseOpenCommissioningWindow;
}
}
endpoint 1 {
device type ma_aggregator = 14, version 1;
Expand Down Expand Up @@ -2103,6 +2088,21 @@ endpoint 1 {
callback attribute featureMap;
callback attribute clusterRevision;
}

server cluster CommissionerControl {
emits event CommissioningRequestResult;
ram attribute supportedDeviceCategories default = 0;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command RequestCommissioningApproval;
handle command CommissionNode;
handle command ReverseOpenCommissioningWindow;
}
}


Loading

0 comments on commit 837e6b8

Please sign in to comment.