|
45 | 45 |
|
46 | 46 | namespace chip {
|
47 | 47 |
|
48 |
| -struct DeviceProxyInitParams |
49 |
| -{ |
50 |
| - SessionManager * sessionManager = nullptr; |
51 |
| - SessionResumptionStorage * sessionResumptionStorage = nullptr; |
52 |
| - Credentials::CertificateValidityPolicy * certificateValidityPolicy = nullptr; |
53 |
| - Messaging::ExchangeManager * exchangeMgr = nullptr; |
54 |
| - FabricTable * fabricTable = nullptr; |
55 |
| - CASEClientPoolDelegate * clientPool = nullptr; |
56 |
| - Credentials::GroupDataProvider * groupDataProvider = nullptr; |
57 |
| - |
58 |
| - Optional<ReliableMessageProtocolConfig> mrpLocalConfig = Optional<ReliableMessageProtocolConfig>::Missing(); |
59 |
| - |
60 |
| - CHIP_ERROR Validate() const |
61 |
| - { |
62 |
| - ReturnErrorCodeIf(sessionManager == nullptr, CHIP_ERROR_INCORRECT_STATE); |
63 |
| - // sessionResumptionStorage can be nullptr when resumption is disabled |
64 |
| - ReturnErrorCodeIf(exchangeMgr == nullptr, CHIP_ERROR_INCORRECT_STATE); |
65 |
| - ReturnErrorCodeIf(fabricTable == nullptr, CHIP_ERROR_INCORRECT_STATE); |
66 |
| - ReturnErrorCodeIf(groupDataProvider == nullptr, CHIP_ERROR_INCORRECT_STATE); |
67 |
| - ReturnErrorCodeIf(clientPool == nullptr, CHIP_ERROR_INCORRECT_STATE); |
68 |
| - |
69 |
| - return CHIP_NO_ERROR; |
70 |
| - } |
71 |
| -}; |
72 |
| - |
73 | 48 | class OperationalSessionSetup;
|
74 | 49 |
|
75 | 50 | /**
|
@@ -171,20 +146,20 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate,
|
171 | 146 | public:
|
172 | 147 | ~OperationalSessionSetup() override;
|
173 | 148 |
|
174 |
| - OperationalSessionSetup(DeviceProxyInitParams & params, ScopedNodeId peerId, |
| 149 | + OperationalSessionSetup(const CASEClientInitParams & params, CASEClientPoolDelegate * clientPool, ScopedNodeId peerId, |
175 | 150 | OperationalSessionReleaseDelegate * releaseDelegate) :
|
176 | 151 | mSecureSession(*this)
|
177 | 152 | {
|
178 | 153 | mInitParams = params;
|
179 |
| - if (params.Validate() != CHIP_NO_ERROR || releaseDelegate == nullptr) |
| 154 | + if (params.Validate() != CHIP_NO_ERROR || clientPool == nullptr || releaseDelegate == nullptr) |
180 | 155 | {
|
181 | 156 | mState = State::Uninitialized;
|
182 | 157 | return;
|
183 | 158 | }
|
184 | 159 |
|
| 160 | + mClientPool = clientPool; |
185 | 161 | mSystemLayer = params.exchangeMgr->GetSessionManager()->SystemLayer();
|
186 | 162 | mPeerId = peerId;
|
187 |
| - mFabricTable = params.fabricTable; |
188 | 163 | mReleaseDelegate = releaseDelegate;
|
189 | 164 | mState = State::NeedsAddress;
|
190 | 165 | mAddressLookupHandle.SetListener(this);
|
@@ -260,8 +235,8 @@ class DLL_EXPORT OperationalSessionSetup : public SessionDelegate,
|
260 | 235 | SecureConnected, // CASE session established.
|
261 | 236 | };
|
262 | 237 |
|
263 |
| - DeviceProxyInitParams mInitParams; |
264 |
| - FabricTable * mFabricTable = nullptr; |
| 238 | + CASEClientInitParams mInitParams; |
| 239 | + CASEClientPoolDelegate * mClientPool = nullptr; |
265 | 240 | System::Layer * mSystemLayer;
|
266 | 241 |
|
267 | 242 | // mCASEClient is only non-null if we are in State::Connecting or just
|
|
0 commit comments