From cf4833ae94f3919a37696ab16160fae1531dc00a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 23 Feb 2022 09:55:03 -0500 Subject: [PATCH] Mark that address resolve is only implementing operational node discovery --- .../AddressResolve_DefaultImpl.cpp | 15 +++------------ .../address_resolve/AddressResolve_DefaultImpl.h | 9 ++++----- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp b/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp index 9601187bf50626..68ce7f31d2774f 100644 --- a/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp +++ b/src/lib/address_resolve/AddressResolve_DefaultImpl.cpp @@ -178,11 +178,11 @@ CHIP_ERROR Resolver::LookupNode(const NodeLookupRequest & request, Impl::NodeLoo CHIP_ERROR Resolver::Init(System::Layer * systemLayer) { mSystemLayer = systemLayer; - Dnssd::Resolver::Instance().SetResolverDelegate(this); + Dnssd::Resolver::Instance().SetOperationalDelegate(this); return CHIP_NO_ERROR; } -void Resolver::OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeData) +void Resolver::OnOperationalNodeResolved(const Dnssd::ResolvedNodeData & nodeData) { auto it = mActiveLookups.begin(); while (it != mActiveLookups.end()) @@ -230,7 +230,7 @@ void Resolver::HandleTimer() ReArmTimer(); } -void Resolver::OnNodeIdResolutionFailed(const PeerId & peerId, CHIP_ERROR error) +void Resolver::OnOperationalNodeResolutionFailed(const PeerId & peerId, CHIP_ERROR error) { auto it = mActiveLookups.begin(); while (it != mActiveLookups.end()) @@ -288,15 +288,6 @@ void Resolver::ReArmTimer() } } -void Resolver::OnNodeDiscoveryComplete(const Dnssd::DiscoveredNodeData & nodeData) -{ - // This is for Commissionable discovery and such lookup is not performed by - // the address resolver. - // - // Getting this callback likely means that linkages of delegates is not done correctly. - ChipLogError(Discovery, "UNEXPECTED/UNIMPLEMENTED commissionable discovery callback"); -} - } // namespace Impl Resolver & Resolver::Instance() diff --git a/src/lib/address_resolve/AddressResolve_DefaultImpl.h b/src/lib/address_resolve/AddressResolve_DefaultImpl.h index 4d35d12e669d82..bff83ebbb82609 100644 --- a/src/lib/address_resolve/AddressResolve_DefaultImpl.h +++ b/src/lib/address_resolve/AddressResolve_DefaultImpl.h @@ -71,7 +71,7 @@ class NodeLookupHandle : public NodeLookupHandleBase unsigned mBestAddressScore = 0; }; -class Resolver : public ::chip::AddressResolve::Resolver, public Dnssd::ResolverDelegate +class Resolver : public ::chip::AddressResolve::Resolver, public Dnssd::OperationalResolveDelegate { public: virtual ~Resolver() = default; @@ -81,11 +81,10 @@ class Resolver : public ::chip::AddressResolve::Resolver, public Dnssd::Resolver CHIP_ERROR Init(System::Layer * systemLayer) override; CHIP_ERROR LookupNode(const NodeLookupRequest & request, Impl::NodeLookupHandle & handle) override; - // Dnssd::ResolverDelegate + // Dnssd::OperationalResolveDelegate - void OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeData) override; - void OnNodeIdResolutionFailed(const PeerId & peerId, CHIP_ERROR error) override; - void OnNodeDiscoveryComplete(const Dnssd::DiscoveredNodeData & nodeData) override; + void OnOperationalNodeResolved(const Dnssd::ResolvedNodeData & nodeData) override; + void OnOperationalNodeResolutionFailed(const PeerId & peerId, CHIP_ERROR error) override; private: static void OnResolveTimer(System::Layer * layer, void * context) { static_cast(context)->HandleTimer(); }