From c50705fb797c4dbd51e18649d953bb530715b01e Mon Sep 17 00:00:00 2001 From: Carol Yang Date: Fri, 14 Jan 2022 07:41:04 -0800 Subject: [PATCH] [OTA] QueryImageResponse status reflects command line input (#13565) --- examples/ota-provider-app/linux/main.cpp | 4 ++-- .../ota-provider-common/OTAProviderExample.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/ota-provider-app/linux/main.cpp b/examples/ota-provider-app/linux/main.cpp index 2f749324d5399a..9242ab780e41ce 100644 --- a/examples/ota-provider-app/linux/main.cpp +++ b/examples/ota-provider-app/linux/main.cpp @@ -54,7 +54,7 @@ constexpr uint16_t kOptionQueryImageBehavior = 'q'; constexpr uint16_t kOptionDelayedActionTimeSec = 'd'; // Global variables used for passing the CLI arguments to the OTAProviderExample object -OTAProviderExample::queryImageBehaviorType gQueryImageBehavior = OTAProviderExample::kRespondWithUpdateAvailable; +OTAProviderExample::QueryImageBehaviorType gQueryImageBehavior = OTAProviderExample::kRespondWithUpdateAvailable; uint32_t gDelayedActionTimeSec = 0; const char * gOtaFilepath = nullptr; @@ -91,7 +91,7 @@ bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, } else if (strcmp(aValue, "UpdateNotAvailable") == 0) { - gQueryImageBehavior = OTAProviderExample::kRespondWithUpdateAvailable; + gQueryImageBehavior = OTAProviderExample::kRespondWithNotAvailable; } else { diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h index 67e4a70e277282..1645e9dc6f66e2 100644 --- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h +++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.h @@ -44,19 +44,19 @@ class OTAProviderExample : public chip::app::Clusters::OTAProviderDelegate chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType & commandData) override; - enum queryImageBehaviorType + enum QueryImageBehaviorType { kRespondWithUpdateAvailable, kRespondWithBusy, kRespondWithNotAvailable }; - void SetQueryImageBehavior(queryImageBehaviorType behavior) { mQueryImageBehavior = behavior; } + void SetQueryImageBehavior(QueryImageBehaviorType behavior) { mQueryImageBehavior = behavior; } void SetDelayedActionTimeSec(uint32_t time) { mDelayedActionTimeSec = time; } private: BdxOtaSender mBdxOtaSender; static constexpr size_t kFilepathBufLen = 256; char mOTAFilePath[kFilepathBufLen]; // null-terminated - queryImageBehaviorType mQueryImageBehavior; + QueryImageBehaviorType mQueryImageBehavior; uint32_t mDelayedActionTimeSec; };