Skip to content

Commit b652d5c

Browse files
committed
Pass largepayload flag into CommandSender in IM test app.
Use the session information from DeviceProxy to construct CommandSender for large payload if session supports it.
1 parent 8ba371a commit b652d5c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/app/tests/suites/commands/interaction_model/InteractionModel.h

+14-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,20 @@ class InteractionModelCommands
251251

252252
chip::app::CommandPathParams commandPath = { endpointId, clusterId, commandId,
253253
(chip::app::CommandPathFlags::kEndpointIdValid) };
254-
auto commandSender = std::make_unique<chip::app::CommandSender>(
255-
mCallback, device->GetExchangeManager(), mTimedInteractionTimeoutMs.HasValue(), mSuppressResponse.ValueOr(false));
254+
std::unique_ptr<chip::app::CommandSender> commandSender;
255+
if (device->GetSecureSession().Value()->AllowsLargePayload())
256+
{
257+
commandSender = std::make_unique<chip::app::CommandSender>(mCallback, device->GetExchangeManager(),
258+
mTimedInteractionTimeoutMs.HasValue(),
259+
mSuppressResponse.ValueOr(false),
260+
/* allowLargePayload = */ true);
261+
}
262+
else
263+
{
264+
commandSender = std::make_unique<chip::app::CommandSender>(mCallback, device->GetExchangeManager(),
265+
mTimedInteractionTimeoutMs.HasValue(),
266+
mSuppressResponse.ValueOr(false));
267+
}
256268
VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY);
257269

258270
chip::app::CommandSender::AddRequestDataParameters addRequestDataParams(mTimedInteractionTimeoutMs);

0 commit comments

Comments
 (0)