Skip to content

Commit

Permalink
Add TODO for attribute used & rename stage to IcdIdentification
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing committed Sep 26, 2023
1 parent a4674cc commit a2e6e9c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/controller/AutoCommissioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ CommissioningStage AutoCommissioner::GetNextCommissioningStageInternal(Commissio
case CommissioningStage::kFindOperational:
if (mParams.GetIcdRegistrationStrategy() != IcdRegistrationStrategy::kIgnore)
{
return CommissioningStage::kIcdDiscovery;
return CommissioningStage::kIcdIdentification;
}
return CommissioningStage::kSendComplete;
case CommissioningStage::kIcdDiscovery:
case CommissioningStage::kIcdIdentification:
// TODO(#29385): Register to the ICD.
return CommissioningStage::kSendComplete;
case CommissioningStage::kSendComplete:
Expand Down Expand Up @@ -712,7 +712,7 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio
case CommissioningStage::kFindOperational:
mOperationalDeviceProxy = report.Get<OperationalNodeFoundData>().operationalProxy;
break;
case CommissioningStage::kIcdDiscovery: {
case CommissioningStage::kIcdIdentification: {
IcdInfo icdInfo = report.Get<IcdInfo>();
if (icdInfo.isIcd)
{
Expand Down
7 changes: 4 additions & 3 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@ void DeviceCommissioner::OnDone(app::ReadClient *)
case CommissioningStage::kCheckForMatchingFabric:
ParseFabrics();
break;
case CommissioningStage::kIcdDiscovery:
case CommissioningStage::kIcdIdentification:
ParseIcdInfo();
break;
default:
Expand Down Expand Up @@ -2184,6 +2184,7 @@ void DeviceCommissioner::ParseIcdInfo()
IcdInfo info;
IcdManagement::Attributes::FeatureMap::TypeInfo::DecodableType featureMap;

// TODO(#29382): We probably want to read "ActiveMode" attribute (to be implemented) for ICD.
err = mAttributeCache->Get<IcdManagement::Attributes::FeatureMap::TypeInfo>(kRootEndpointId, featureMap);
if (err == CHIP_NO_ERROR)
{
Expand Down Expand Up @@ -2822,9 +2823,9 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio
);
}
break;
case CommissioningStage::kIcdDiscovery: {
case CommissioningStage::kIcdIdentification: {
app::AttributePathParams readPaths[1];
// Read all the feature maps for all the networking clusters on any endpoint to determine what is supported
// TODO(#29382): We probably want to read "ActiveMode" attribute (to be implemented) for ICD.
readPaths[0] =
app::AttributePathParams(app::Clusters::IcdManagement::Id, app::Clusters::IcdManagement::Attributes::FeatureMap::Id);
SendCommissioningReadRequest(proxy, timeout, readPaths, 1);
Expand Down
4 changes: 2 additions & 2 deletions src/controller/CommissioningDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ const char * StageToString(CommissioningStage stage)
return "FindOperational";
break;

case kIcdDiscovery:
return "ICDDiscovery";
case kIcdIdentification:
return "ICDIdentification";
break;

case kSendComplete:
Expand Down
2 changes: 1 addition & 1 deletion src/controller/CommissioningDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ enum CommissioningStage : uint8_t
kThreadNetworkEnable, ///< Send ConnectNetwork (0x31:6) command to the device for the Thread network
kFindOperational, ///< Perform operational discovery and establish a CASE session with the device
/// Optional steps for ICD
kIcdDiscovery, ///< Check whether the device is an ICD
kIcdIdentification, ///< Check whether the device is an ICD
/// TODO(#29384): Finish ICD registration implementation in commissioner
/// End of optional steps for ICD
kSendComplete, ///< Send CommissioningComplete (0x30:4) command to the device
Expand Down

0 comments on commit a2e6e9c

Please sign in to comment.