Skip to content

Commit

Permalink
[OTA] QueryImageResponse status reflects command line input (project-…
Browse files Browse the repository at this point in the history
  • Loading branch information
carol-apple authored and selissia committed Jan 28, 2022
1 parent 9dcf66b commit c50705f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/ota-provider-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit c50705f

Please sign in to comment.