From a2e6e9cab9cf756e8869e4484765f45dbd3d711e Mon Sep 17 00:00:00 2001 From: Song Guo Date: Tue, 26 Sep 2023 09:51:04 +0800 Subject: [PATCH] Add TODO for attribute used & rename stage to IcdIdentification --- src/controller/AutoCommissioner.cpp | 6 +++--- src/controller/CHIPDeviceController.cpp | 7 ++++--- src/controller/CommissioningDelegate.cpp | 4 ++-- src/controller/CommissioningDelegate.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index f34a2d055f26c3..11f10c3c554520 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -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: @@ -712,7 +712,7 @@ CHIP_ERROR AutoCommissioner::CommissioningStepFinished(CHIP_ERROR err, Commissio case CommissioningStage::kFindOperational: mOperationalDeviceProxy = report.Get().operationalProxy; break; - case CommissioningStage::kIcdDiscovery: { + case CommissioningStage::kIcdIdentification: { IcdInfo icdInfo = report.Get(); if (icdInfo.isIcd) { diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 3f158b4fbd5725..9fb52994f411b4 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1880,7 +1880,7 @@ void DeviceCommissioner::OnDone(app::ReadClient *) case CommissioningStage::kCheckForMatchingFabric: ParseFabrics(); break; - case CommissioningStage::kIcdDiscovery: + case CommissioningStage::kIcdIdentification: ParseIcdInfo(); break; default: @@ -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(kRootEndpointId, featureMap); if (err == CHIP_NO_ERROR) { @@ -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); diff --git a/src/controller/CommissioningDelegate.cpp b/src/controller/CommissioningDelegate.cpp index d549a1c595e7e3..5aadd3a6e0795a 100644 --- a/src/controller/CommissioningDelegate.cpp +++ b/src/controller/CommissioningDelegate.cpp @@ -137,8 +137,8 @@ const char * StageToString(CommissioningStage stage) return "FindOperational"; break; - case kIcdDiscovery: - return "ICDDiscovery"; + case kIcdIdentification: + return "ICDIdentification"; break; case kSendComplete: diff --git a/src/controller/CommissioningDelegate.h b/src/controller/CommissioningDelegate.h index 8759d062c3eb28..64badbac524e26 100644 --- a/src/controller/CommissioningDelegate.h +++ b/src/controller/CommissioningDelegate.h @@ -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