From 01a424f5dc42ace114c96c4e2369d7b265c6ec60 Mon Sep 17 00:00:00 2001 From: Carol Yang Date: Fri, 27 May 2022 17:02:33 -0700 Subject: [PATCH] [OTA] Only supply DelayActionTime field for busy status response (#18912) --- .../ota-provider-common/OTAProviderExample.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp index 2e7b9f35470834..28658b9578c28b 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp @@ -296,9 +296,14 @@ void OTAProviderExample::SendQueryImageResponse(app::CommandHandler * commandObj } } + // Delay action time is only applicable when the provider is busy + if (mQueryImageStatus == OTAQueryStatus::kBusy) + { + response.delayedActionTime.Emplace(mDelayedQueryActionTimeSec); + } + // Set remaining fields common to all status types response.status = mQueryImageStatus; - response.delayedActionTime.Emplace(mDelayedQueryActionTimeSec); if (mUserConsentNeeded && requestorCanConsent) { response.userConsentNeeded.Emplace(true);