@@ -35,6 +35,7 @@ void CASESessionManager::FindOrEstablishSession(const ScopedNodeId & peerId, Cal
35
35
,
36
36
uint8_t attemptCount, Callback::Callback<OnDeviceConnectionRetry> * onRetry
37
37
#endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES
38
+ , bool forLargePayload
38
39
)
39
40
{
40
41
ChipLogDetail (CASESessionManager, " FindOrEstablishSession: PeerId = [%d:" ChipLogFormatX64 " ]" , peerId.GetFabricIndex (),
@@ -66,7 +67,7 @@ void CASESessionManager::FindOrEstablishSession(const ScopedNodeId & peerId, Cal
66
67
}
67
68
#endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES
68
69
69
- session->Connect (onConnection, onFailure);
70
+ session->Connect (onConnection, onFailure, forLargePayload );
70
71
}
71
72
72
73
void CASESessionManager::ReleaseSessionsForFabric (FabricIndex fabricIndex)
@@ -82,7 +83,16 @@ void CASESessionManager::ReleaseAllSessions()
82
83
CHIP_ERROR CASESessionManager::GetPeerAddress (const ScopedNodeId & peerId, Transport::PeerAddress & addr)
83
84
{
84
85
ReturnErrorOnFailure (mConfig .sessionInitParams .Validate ());
85
- auto optionalSessionHandle = FindExistingSession (peerId);
86
+ auto optionalSessionHandle = FindExistingSession (peerId, false );
87
+ ReturnErrorCodeIf (!optionalSessionHandle.HasValue (), CHIP_ERROR_NOT_CONNECTED);
88
+ addr = optionalSessionHandle.Value ()->AsSecureSession ()->GetPeerAddress ();
89
+ return CHIP_NO_ERROR;
90
+ }
91
+
92
+ CHIP_ERROR CASESessionManager::GetPeerAddressForLargePayloadSession (const ScopedNodeId & peerId, Transport::PeerAddress & addr)
93
+ {
94
+ ReturnErrorOnFailure (mConfig .sessionInitParams .Validate ());
95
+ auto optionalSessionHandle = FindExistingSession (peerId, true );
86
96
ReturnErrorCodeIf (!optionalSessionHandle.HasValue (), CHIP_ERROR_NOT_CONNECTED);
87
97
addr = optionalSessionHandle.Value ()->AsSecureSession ()->GetPeerAddress ();
88
98
return CHIP_NO_ERROR;
@@ -118,10 +128,11 @@ OperationalSessionSetup * CASESessionManager::FindExistingSessionSetup(const Sco
118
128
return mConfig .sessionSetupPool ->FindSessionSetup (peerId, forAddressUpdate);
119
129
}
120
130
121
- Optional<SessionHandle> CASESessionManager::FindExistingSession (const ScopedNodeId & peerId) const
131
+ Optional<SessionHandle> CASESessionManager::FindExistingSession (const ScopedNodeId & peerId, const bool forLargePayload ) const
122
132
{
123
133
return mConfig .sessionInitParams .sessionManager ->FindSecureSessionForNode (peerId,
124
- MakeOptional (Transport::SecureSession::Type::kCASE ));
134
+ MakeOptional (Transport::SecureSession::Type::kCASE ),
135
+ forLargePayload);
125
136
}
126
137
127
138
void CASESessionManager::ReleaseSession (OperationalSessionSetup * session)
0 commit comments