Skip to content

Commit

Permalink
Merge branch 'master' into cleanup_darwin_strtok
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 committed Nov 17, 2021
2 parents 0c73035 + 1359f6e commit 5cfbe88
Show file tree
Hide file tree
Showing 85 changed files with 24,013 additions and 22,174 deletions.
12 changes: 3 additions & 9 deletions src/app/CASESessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,12 @@ CHIP_ERROR CASESessionManager::GetPeerAddress(NodeId nodeId, Transport::PeerAddr
return CHIP_NO_ERROR;
}

void CASESessionManager::OnNewConnection(SessionHandle sessionHandle, Messaging::ExchangeManager * mgr)
{
// TODO Update the MRP params based on the MRP params extracted from CASE, when this is available.
}

void CASESessionManager::OnConnectionExpired(SessionHandle sessionHandle, Messaging::ExchangeManager * mgr)
void CASESessionManager::OnSessionReleased(SessionHandle sessionHandle)
{
OperationalDeviceProxy * session = FindSession(sessionHandle);
VerifyOrReturn(session != nullptr,
ChipLogDetail(Controller, "OnConnectionExpired was called for unknown device, ignoring it."));
VerifyOrReturn(session != nullptr, ChipLogDetail(Controller, "OnSessionReleased was called for unknown device, ignoring it."));

session->OnConnectionExpired(sessionHandle);
session->OnSessionReleased(sessionHandle);
}

OperationalDeviceProxy * CASESessionManager::FindSession(SessionHandle session)
Expand Down
9 changes: 4 additions & 5 deletions src/app/CASESessionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <lib/core/CHIPCore.h>
#include <lib/dnssd/DnssdCache.h>
#include <lib/support/Pool.h>
#include <messaging/ExchangeMgrDelegate.h>
#include <transport/SessionDelegate.h>

#include <lib/dnssd/Resolver.h>

Expand All @@ -43,7 +43,7 @@ struct CASESessionManagerConfig
* 4. During session establishment, trigger node ID resolution (if needed), and update the DNS-SD cache (if resolution is
* successful)
*/
class CASESessionManager : public Messaging::ExchangeMgrDelegate, public Dnssd::ResolverDelegate
class CASESessionManager : public SessionReleaseDelegate, public Dnssd::ResolverDelegate
{
public:
CASESessionManager() = delete;
Expand Down Expand Up @@ -91,9 +91,8 @@ class CASESessionManager : public Messaging::ExchangeMgrDelegate, public Dnssd::
*/
CHIP_ERROR GetPeerAddress(NodeId nodeId, Transport::PeerAddress & addr);

//////////// ExchangeMgrDelegate Implementation ///////////////
void OnNewConnection(SessionHandle session, Messaging::ExchangeManager * mgr) override;
void OnConnectionExpired(SessionHandle session, Messaging::ExchangeManager * mgr) override;
//////////// SessionReleaseDelegate Implementation ///////////////
void OnSessionReleased(SessionHandle session) override;

//////////// ResolverDelegate Implementation ///////////////
void OnNodeIdResolved(const Dnssd::ResolvedNodeData & nodeData) override;
Expand Down
6 changes: 0 additions & 6 deletions src/app/DeviceProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ class DLL_EXPORT DeviceProxy
virtual ~DeviceProxy() {}
DeviceProxy() {}

/**
* Called when a connection is closing.
* The object releases all resources associated with the connection.
*/
virtual void OnConnectionExpired(SessionHandle session) = 0;

/**
* Mark any open session with the device as expired.
*/
Expand Down
Loading

0 comments on commit 5cfbe88

Please sign in to comment.