From a297e4aec1a35b9eefaa8a85444eded78fe249e2 Mon Sep 17 00:00:00 2001 From: Zang MingJie Date: Thu, 21 Apr 2022 21:24:01 +0800 Subject: [PATCH] Remove TransportMgrBase argument from CASEServer::ListenForSessionEstablishment (#17570) --- src/app/server/Server.cpp | 4 ++-- src/controller/CHIPDeviceControllerFactory.cpp | 4 ++-- src/protocols/secure_channel/CASEServer.cpp | 7 ++----- src/protocols/secure_channel/CASEServer.h | 5 ++--- src/protocols/secure_channel/tests/TestCASESession.cpp | 4 ++-- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 4a85df9b320f07..60ccf17ba726a6 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -260,8 +260,8 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) err = mCASESessionManager.Init(&DeviceLayer::SystemLayer(), caseSessionManagerConfig); SuccessOrExit(err); - err = mCASEServer.ListenForSessionEstablishment(&mExchangeMgr, &mTransports, &mSessions, &mFabrics, mSessionResumptionStorage, - mGroupsProvider); + err = + mCASEServer.ListenForSessionEstablishment(&mExchangeMgr, &mSessions, &mFabrics, mSessionResumptionStorage, mGroupsProvider); SuccessOrExit(err); // This code is necessary to restart listening to existing groups after a reboot diff --git a/src/controller/CHIPDeviceControllerFactory.cpp b/src/controller/CHIPDeviceControllerFactory.cpp index 062257ce54f5af..a0b12ac2daafc0 100644 --- a/src/controller/CHIPDeviceControllerFactory.cpp +++ b/src/controller/CHIPDeviceControllerFactory.cpp @@ -181,8 +181,8 @@ CHIP_ERROR DeviceControllerFactory::InitSystemState(FactoryInitParams params) // Enable listening for session establishment messages. ReturnErrorOnFailure(stateParams.caseServer->ListenForSessionEstablishment( - stateParams.exchangeMgr, stateParams.transportMgr, stateParams.sessionMgr, stateParams.fabricTable, - stateParams.sessionResumptionStorage, stateParams.groupDataProvider)); + stateParams.exchangeMgr, stateParams.sessionMgr, stateParams.fabricTable, stateParams.sessionResumptionStorage, + stateParams.groupDataProvider)); // // We need to advertise the port that we're listening to for unsolicited messages over UDP. However, we have both a IPv4 diff --git a/src/protocols/secure_channel/CASEServer.cpp b/src/protocols/secure_channel/CASEServer.cpp index 18947b3651c6e0..4ecbd28547ad8b 100644 --- a/src/protocols/secure_channel/CASEServer.cpp +++ b/src/protocols/secure_channel/CASEServer.cpp @@ -29,15 +29,12 @@ using namespace ::chip::Credentials; namespace chip { -CHIP_ERROR CASEServer::ListenForSessionEstablishment(Messaging::ExchangeManager * exchangeManager, TransportMgrBase * transportMgr, - SessionManager * sessionManager, FabricTable * fabrics, - SessionResumptionStorage * sessionResumptionStorage, +CHIP_ERROR CASEServer::ListenForSessionEstablishment(Messaging::ExchangeManager * exchangeManager, SessionManager * sessionManager, + FabricTable * fabrics, SessionResumptionStorage * sessionResumptionStorage, Credentials::GroupDataProvider * responderGroupDataProvider) { - VerifyOrReturnError(transportMgr != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(exchangeManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(sessionManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - VerifyOrReturnError(sessionManager != nullptr, CHIP_ERROR_INVALID_ARGUMENT); VerifyOrReturnError(responderGroupDataProvider != nullptr, CHIP_ERROR_INVALID_ARGUMENT); mSessionManager = sessionManager; diff --git a/src/protocols/secure_channel/CASEServer.h b/src/protocols/secure_channel/CASEServer.h index 685046730243a6..d50ad6708c0583 100644 --- a/src/protocols/secure_channel/CASEServer.h +++ b/src/protocols/secure_channel/CASEServer.h @@ -38,9 +38,8 @@ class CASEServer : public SessionEstablishmentDelegate, } } - CHIP_ERROR ListenForSessionEstablishment(Messaging::ExchangeManager * exchangeManager, TransportMgrBase * transportMgr, - SessionManager * sessionManager, FabricTable * fabrics, - SessionResumptionStorage * sessionResumptionStorage, + CHIP_ERROR ListenForSessionEstablishment(Messaging::ExchangeManager * exchangeManager, SessionManager * sessionManager, + FabricTable * fabrics, SessionResumptionStorage * sessionResumptionStorage, Credentials::GroupDataProvider * responderGroupDataProvider); //////////// SessionEstablishmentDelegate Implementation /////////////// diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index 8e214221695dea..b714b52e203e6e 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -311,8 +311,8 @@ void CASE_SecurePairingHandshakeServerTest(nlTestSuite * inSuite, void * inConte // Use the same session manager on both CASE client and server sides to validate that both // components may work simultaneously on a single device. NL_TEST_ASSERT(inSuite, - gPairingServer.ListenForSessionEstablishment(&ctx.GetExchangeManager(), &ctx.GetTransportMgr(), - &ctx.GetSecureSessionManager(), &gDeviceFabrics, nullptr, + gPairingServer.ListenForSessionEstablishment(&ctx.GetExchangeManager(), &ctx.GetSecureSessionManager(), + &gDeviceFabrics, nullptr, &gDeviceGroupDataProvider) == CHIP_NO_ERROR); ExchangeContext * contextCommissioner = ctx.NewUnauthenticatedExchangeToBob(pairingCommissioner);