diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 9ad4eadcc4a478..64df9420feb075 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -985,6 +985,7 @@ PlatformManagerImpl plt png PollControl +pollInterval polymorphism POSIX PosixConfig diff --git a/examples/ota-provider-app/linux/README.md b/examples/ota-provider-app/linux/README.md index af21d26be9e773..4a1e65dc2f4467 100644 --- a/examples/ota-provider-app/linux/README.md +++ b/examples/ota-provider-app/linux/README.md @@ -26,6 +26,7 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug c | -u, --userConsentState \ | The user consent state for the first QueryImageResponse. For all subsequent responses, the value of granted will be used.
Note that --queryImageStatus overrides this option.
  • granted: Status field in the first QueryImageResponse is set to updateAvailable
  • denied: Status field in the first QueryImageResponse is set to updateNotAvailable
  • deferred: Status field in the first QueryImageResponse is set to busy | | -x, --ignoreQueryImage \ | The number of times to ignore the QueryImage Command and not send a response | | -y, --ignoreApplyUpdate \ | The number of times to ignore the ApplyUpdate Request and not send a response | +| -P, --pollInterval | Poll interval for the BDX transfer. | **Using `--filepath` and `--otaImageList`** diff --git a/examples/ota-provider-app/linux/main.cpp b/examples/ota-provider-app/linux/main.cpp index f2a526a4bb9e55..aefd9e39224fc7 100644 --- a/examples/ota-provider-app/linux/main.cpp +++ b/examples/ota-provider-app/linux/main.cpp @@ -54,6 +54,7 @@ constexpr uint16_t kOptionDelayedQueryActionTimeSec = 't'; constexpr uint16_t kOptionUserConsentState = 'u'; constexpr uint16_t kOptionIgnoreQueryImage = 'x'; constexpr uint16_t kOptionIgnoreApplyUpdate = 'y'; +constexpr uint16_t kOptionPollInterval = 'P'; OTAProviderExample gOtaProvider; chip::ota::DefaultOTAProviderUserConsent gUserConsentProvider; @@ -70,6 +71,7 @@ static chip::ota::UserConsentState gUserConsentState = chip::ota::UserConsentSta static bool gUserConsentNeeded = false; static uint32_t gIgnoreQueryImageCount = 0; static uint32_t gIgnoreApplyUpdateCount = 0; +static uint32_t gPollInterval = 0; // Parses the JSON filepath and extracts DeviceSoftwareVersionModel parameters static bool ParseJsonFileAndPopulateCandidates(const char * filepath, @@ -241,6 +243,10 @@ bool HandleOptions(const char * aProgram, OptionSet * aOptions, int aIdentifier, case kOptionUserConsentNeeded: gUserConsentNeeded = true; break; + case kOptionPollInterval: + gPollInterval = static_cast(strtoul(aValue, NULL, 0)); + break; + default: PrintArgError("%s: INTERNAL ERROR: Unhandled option: %s\n", aProgram, aName); retval = false; @@ -262,6 +268,7 @@ OptionDef cmdLineOptionsDef[] = { { "userConsentState", chip::ArgParser::kArgumentRequired, kOptionUserConsentState }, { "ignoreQueryImage", chip::ArgParser::kArgumentRequired, kOptionIgnoreQueryImage }, { "ignoreApplyUpdate", chip::ArgParser::kArgumentRequired, kOptionIgnoreApplyUpdate }, + { "pollInterval", chip::ArgParser::kArgumentRequired, kOptionPollInterval }, {}, }; @@ -300,7 +307,9 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " -x, --ignoreQueryImage \n" " The number of times to ignore the QueryImage Command and not send a response.\n" " -y, --ignoreApplyUpdate \n" - " The number of times to ignore the ApplyUpdateRequest Command and not send a response.\n" }; + " The number of times to ignore the ApplyUpdateRequest Command and not send a response.\n" + " -P, --pollInterval