diff --git a/examples/chip-tool/commands/discover/Commands.h b/examples/chip-tool/commands/discover/Commands.h index fecc142713ca61..f033e8d4341967 100644 --- a/examples/chip-tool/commands/discover/Commands.h +++ b/examples/chip-tool/commands/discover/Commands.h @@ -21,7 +21,6 @@ #include "DiscoverCommand.h" #include "DiscoverCommissionablesCommand.h" #include "DiscoverCommissionersCommand.h" -#include #include class Resolve : public DiscoverCommand, public chip::AddressResolve::NodeListener @@ -65,42 +64,12 @@ class Resolve : public DiscoverCommand, public chip::AddressResolve::NodeListene chip::AddressResolve::NodeLookupHandle mNodeLookupHandle; }; -class Update : public DiscoverCommand -{ -public: - Update(CredentialIssuerCommands * credsIssuerConfig) : DiscoverCommand("update", credsIssuerConfig) {} - - /////////// DiscoverCommand Interface ///////// - CHIP_ERROR RunCommand(NodeId remoteId, uint64_t fabricId) override - { - ChipLogProgress(chipTool, "Mdns: Updating NodeId: %" PRIx64 " Compressed FabricId: %" PRIx64 " ...", remoteId, - CurrentCommissioner().GetCompressedFabricId()); - return CurrentCommissioner().UpdateDevice(remoteId); - } - - /////////// DeviceAddressUpdateDelegate Interface ///////// - void OnAddressUpdateComplete(NodeId nodeId, CHIP_ERROR error) override - { - if (CHIP_NO_ERROR == error) - { - ChipLogProgress(chipTool, "Device address updated successfully"); - } - else - { - ChipLogError(chipTool, "Failed to update the device address: %s", chip::ErrorStr(error)); - } - - SetCommandExitStatus(error); - } -}; - void registerCommandsDiscover(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { const char * clusterName = "Discover"; commands_list clusterCommands = { make_unique(credsIssuerConfig), - make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), make_unique(credsIssuerConfig), }; diff --git a/examples/chip-tool/commands/discover/DiscoverCommand.cpp b/examples/chip-tool/commands/discover/DiscoverCommand.cpp index 1cf6f87a4b8427..54bfc3d2235755 100644 --- a/examples/chip-tool/commands/discover/DiscoverCommand.cpp +++ b/examples/chip-tool/commands/discover/DiscoverCommand.cpp @@ -20,6 +20,5 @@ CHIP_ERROR DiscoverCommand::RunCommand() { - CurrentCommissioner().RegisterDeviceAddressUpdateDelegate(this); return RunCommand(mNodeId, mFabricId); } diff --git a/examples/chip-tool/commands/discover/DiscoverCommand.h b/examples/chip-tool/commands/discover/DiscoverCommand.h index dd713d9ccf3e57..fb0dc6bfd6d395 100644 --- a/examples/chip-tool/commands/discover/DiscoverCommand.h +++ b/examples/chip-tool/commands/discover/DiscoverCommand.h @@ -21,7 +21,7 @@ #include "../../config/PersistentStorage.h" #include "../common/CHIPCommand.h" -class DiscoverCommand : public CHIPCommand, public chip::Controller::DeviceAddressUpdateDelegate +class DiscoverCommand : public CHIPCommand { public: DiscoverCommand(const char * commandName, CredentialIssuerCommands * credsIssuerConfig) : @@ -31,9 +31,6 @@ class DiscoverCommand : public CHIPCommand, public chip::Controller::DeviceAddre AddArgument("fabricid", 0, UINT64_MAX, &mFabricId); } - /////////// DeviceAddressUpdateDelegate Interface ///////// - void OnAddressUpdateComplete(NodeId nodeId, CHIP_ERROR error) override{}; - /////////// CHIPCommand Interface ///////// CHIP_ERROR RunCommand() override; chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(30); } diff --git a/src/controller/BUILD.gn b/src/controller/BUILD.gn index 84702a7f0fddb3..111b1573962082 100644 --- a/src/controller/BUILD.gn +++ b/src/controller/BUILD.gn @@ -46,7 +46,6 @@ static_library("controller") { "CommissioneeDeviceProxy.h", "CommissionerDiscoveryController.cpp", "CommissionerDiscoveryController.h", - "DeviceAddressUpdateDelegate.h", "DeviceDiscoveryDelegate.h", "EmptyDataModelHandler.cpp", "ExampleOperationalCredentialsIssuer.cpp", diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index a35956975dc52a..35dedf31815586 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -264,8 +264,7 @@ CHIP_ERROR DeviceController::Shutdown() mSystemState = nullptr; mDNSResolver.Shutdown(); - mDeviceAddressUpdateDelegate = nullptr; - mDeviceDiscoveryDelegate = nullptr; + mDeviceDiscoveryDelegate = nullptr; chip::Platform::Delete(mCASESessionManager); mCASESessionManager = nullptr; @@ -565,10 +564,6 @@ void DeviceController::OnOperationalNodeResolved(const chip::Dnssd::ResolvedNode VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnOperationalNodeResolved was called in incorrect state")); mCASESessionManager->OnOperationalNodeResolved(nodeData); - if (mDeviceAddressUpdateDelegate != nullptr) - { - mDeviceAddressUpdateDelegate->OnAddressUpdateComplete(nodeData.mPeerId.GetNodeId(), CHIP_NO_ERROR); - } } void DeviceController::OnOperationalNodeResolutionFailed(const chip::PeerId & peer, CHIP_ERROR error) @@ -577,11 +572,6 @@ void DeviceController::OnOperationalNodeResolutionFailed(const chip::PeerId & pe VerifyOrReturn(mState == State::Initialized, ChipLogError(Controller, "OnOperationalNodeResolutionFailed was called in incorrect state")); mCASESessionManager->OnOperationalNodeResolutionFailed(peer, error); - - if (mDeviceAddressUpdateDelegate != nullptr) - { - mDeviceAddressUpdateDelegate->OnAddressUpdateComplete(peer.GetNodeId(), error); - } } ControllerDeviceInitParams DeviceController::GetControllerDeviceInitParams() diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index 467cd8e66df117..f70c24a7f56050 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -70,7 +70,6 @@ #if CONFIG_NETWORK_LAYER_BLE #include #endif -#include #include #include #include @@ -307,7 +306,6 @@ class DLL_EXPORT DeviceController : public SessionRecoveryDelegate, Callback::Callback * callback, bool readVIDPIDAttributes = false); - void RegisterDeviceAddressUpdateDelegate(DeviceAddressUpdateDelegate * delegate) { mDeviceAddressUpdateDelegate = delegate; } void RegisterDeviceDiscoveryDelegate(DeviceDiscoveryDelegate * delegate) { mDeviceDiscoveryDelegate = delegate; } /** @@ -358,8 +356,7 @@ class DLL_EXPORT DeviceController : public SessionRecoveryDelegate, FabricId mFabricId = kUndefinedFabricId; FabricInfo * mFabricInfo = nullptr; - PersistentStorageDelegate * mStorageDelegate = nullptr; - DeviceAddressUpdateDelegate * mDeviceAddressUpdateDelegate = nullptr; + PersistentStorageDelegate * mStorageDelegate = nullptr; // TODO(cecille): Make this configuarable. static constexpr int kMaxCommissionableNodes = 10; Dnssd::DiscoveredNodeData mCommissionableNodes[kMaxCommissionableNodes]; diff --git a/src/controller/DeviceAddressUpdateDelegate.h b/src/controller/DeviceAddressUpdateDelegate.h deleted file mode 100644 index ee7dbf9976eb62..00000000000000 --- a/src/controller/DeviceAddressUpdateDelegate.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -namespace chip { -namespace Controller { - -/// Callbacks for CHIP device address resolution -class DLL_EXPORT DeviceAddressUpdateDelegate -{ -public: - virtual ~DeviceAddressUpdateDelegate() {} - virtual void OnAddressUpdateComplete(NodeId nodeId, CHIP_ERROR error) = 0; -}; - -} // namespace Controller -} // namespace chip