Skip to content

Commit 540c991

Browse files
authored
Add LargePayload flag in GetConnectedDevice() API (#33887)
Using the flag in this key API would allow applications to establish a session that supports large payload transfers.
1 parent f0bf341 commit 540c991

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/controller/CHIPDeviceController.h

+14-4
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,15 @@ class DLL_EXPORT DeviceController : public AbstractDnssdDiscoveryController
244244
* called yet, and neither callback will be called in the future.
245245
*/
246246
CHIP_ERROR GetConnectedDevice(NodeId peerNodeId, Callback::Callback<OnDeviceConnected> * onConnection,
247-
chip::Callback::Callback<OnDeviceConnectionFailure> * onFailure)
247+
chip::Callback::Callback<OnDeviceConnectionFailure> * onFailure,
248+
TransportPayloadCapability transportPayloadCapability = TransportPayloadCapability::kMRPPayload)
248249
{
249250
VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE);
250-
mSystemState->CASESessionMgr()->FindOrEstablishSession(ScopedNodeId(peerNodeId, GetFabricIndex()), onConnection, onFailure);
251+
mSystemState->CASESessionMgr()->FindOrEstablishSession(ScopedNodeId(peerNodeId, GetFabricIndex()), onConnection, onFailure,
252+
#if CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES
253+
1, nullptr,
254+
#endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES
255+
transportPayloadCapability);
251256
return CHIP_NO_ERROR;
252257
}
253258

@@ -267,11 +272,16 @@ class DLL_EXPORT DeviceController : public AbstractDnssdDiscoveryController
267272
*/
268273
CHIP_ERROR
269274
GetConnectedDevice(NodeId peerNodeId, Callback::Callback<OnDeviceConnected> * onConnection,
270-
chip::Callback::Callback<OperationalSessionSetup::OnSetupFailure> * onSetupFailure)
275+
chip::Callback::Callback<OperationalSessionSetup::OnSetupFailure> * onSetupFailure,
276+
TransportPayloadCapability transportPayloadCapability = TransportPayloadCapability::kMRPPayload)
271277
{
272278
VerifyOrReturnError(mState == State::Initialized, CHIP_ERROR_INCORRECT_STATE);
273279
mSystemState->CASESessionMgr()->FindOrEstablishSession(ScopedNodeId(peerNodeId, GetFabricIndex()), onConnection,
274-
onSetupFailure);
280+
onSetupFailure,
281+
#if CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES
282+
1, nullptr,
283+
#endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES
284+
transportPayloadCapability);
275285
return CHIP_NO_ERROR;
276286
}
277287

0 commit comments

Comments
 (0)