diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp index f8da0e6f7369b4..c11b57203b6a86 100644 --- a/src/app/clusters/network-commissioning/network-commissioning.cpp +++ b/src/app/clusters/network-commissioning/network-commissioning.cpp @@ -257,14 +257,6 @@ EmberAfNetworkCommissioningError OnEnableNetworkCommandCallbackInternal(app::Com { size_t networkSeq; EmberAfNetworkCommissioningError err = EMBER_ZCL_NETWORK_COMMISSIONING_ERROR_NETWORK_ID_NOT_FOUND; - // TODO(cecille): This is very dangerous - need to check against real netif name, ensure no password. - constexpr char ethernetNetifMagicCode[] = "ETH0"; - if (networkID.size() == sizeof(ethernetNetifMagicCode) && - memcmp(networkID.data(), ethernetNetifMagicCode, networkID.size()) == 0) - { - ChipLogProgress(Zcl, "Wired network enabling requested. Assuming success."); - ExitNow(err = EMBER_ZCL_NETWORK_COMMISSIONING_ERROR_SUCCESS); - } for (networkSeq = 0; networkSeq < kMaxNetworks; networkSeq++) { diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 132d6bb0084a28..7ce404518eaace 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1851,8 +1851,8 @@ CommissioningStage DeviceCommissioner::GetNextCommissioningStage() case CommissioningStage::kDeviceAttestation: return CommissioningStage::kCheckCertificates; case CommissioningStage::kCheckCertificates: - return CommissioningStage::kNetworkEnable; // TODO : for softAP, this needs to be network setup - case CommissioningStage::kNetworkEnable: + // For thread and wifi, this should go to network setup then enable. For on-network we can skip right to finding the + // operational network because the provisioning of certificates will trigger the device to start operational advertising. #if CHIP_DEVICE_CONFIG_ENABLE_MDNS return CommissioningStage::kFindOperational; // TODO : once case is working, need to add stages to find and reconnect // here. @@ -1867,6 +1867,7 @@ CommissioningStage DeviceCommissioner::GetNextCommissioningStage() // Currently unimplemented. case CommissioningStage::kConfigACL: case CommissioningStage::kNetworkSetup: + case CommissioningStage::kNetworkEnable: case CommissioningStage::kScanNetworks: return CommissioningStage::kError; // Neither of these have a next stage so return kError; @@ -1995,18 +1996,8 @@ void DeviceCommissioner::AdvanceCommissioningStage(CHIP_ERROR err) break; case CommissioningStage::kNetworkEnable: { ChipLogProgress(Controller, "Enabling Network"); - // TODO: For ethernet, we actually need a scan stage to get the ethernet netif name. Right now, default to using a magic - // value to enable without checks. - NetworkCommissioningCluster netCom; - // TODO: should get the endpoint information from the descriptor cluster. - netCom.Associate(device, 0); - // TODO: Once network credential sending is implemented, attempting to set wifi credential on an ethernet only device - // will cause an error to be sent back. At that point, we should scan and we shoud see the proper ethernet network ID - // returned in the scan results. For now, we use magic. - char magicNetworkEnableCode[] = "ETH0"; - netCom.EnableNetwork(mSuccess.Cancel(), mFailure.Cancel(), - ByteSpan(reinterpret_cast(&magicNetworkEnableCode), sizeof(magicNetworkEnableCode)), - breadcrumb, kCommandTimeoutMs); + // For on-network, this is a NO-OP becuase we now start operational advertising once credentials are provisioned. + // This is a placeholder for thread and wifi networks once that is implemented. } break; case CommissioningStage::kFindOperational: {