Skip to content

Commit 750dca9

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 750dca9

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>(
258+
mCallback, device->GetExchangeManager(), mTimedInteractionTimeoutMs.HasValue(),
259+
mSuppressResponse.ValueOr(false), /* allowLargePayload = */ true);
260+
}
261+
else
262+
{
263+
commandSender = std::make_unique<chip::app::CommandSender>(
264+
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)