Skip to content

Commit b37349c

Browse files
committedJun 18, 2024
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 b37349c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,18 @@ 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(), mTimedInteractionTimeoutMs.HasValue(), mSuppressResponse.ValueOr(false));
265+
}
256266
VerifyOrReturnError(commandSender != nullptr, CHIP_ERROR_NO_MEMORY);
257267

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

0 commit comments

Comments
 (0)