Skip to content

Commit 4323356

Browse files
isiu-applepull[bot]
authored andcommitted
Change CLI option behavior for OTA-R and OTA-P to revert back to the success case after using the CLI supplied values (#16095)
* Issue #15656 [ota-provider-app] Add counters for various QueryImageResponse and ApplyImageResponse commands - For OTA-P, make -q, -a, and -u be applied just once and then revert back to the success case. * - Remove debug logs - Remove counters and just revert behavior to success case after first use - Fix userConsentState ignore once case * - Update ReadMes and CLI comments. * - Remove debug code. - Remove count variables. * scripts/helpers/restyle-diff.sh * Resolve spellcheck errors. * Code review changes. - Update comments. * scripts/helpers/restyle-diff.sh * Code review changes. - Split -t command line arg into -t and -p. * scripts/helpers/restyle-diff.sh * Code review changes. - Update readme and CLI info texts.
1 parent 3530458 commit 4323356

File tree

10 files changed

+92
-50
lines changed

10 files changed

+92
-50
lines changed

.github/.wordlist.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ DefaultSuccess
326326
definedValue
327327
DehumidificationControl
328328
DelayedActionTime
329-
delayedActionTimeSec
329+
delayedApplyActionTimeSec
330+
delayedQueryActionTimeSec
330331
delayQuery
331332
demangle
332333
deployable

examples/ota-provider-app/esp32/main/OTAProviderCommands.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ CHIP_ERROR DelayedActionTimeHandler(int argc, char ** argv)
3434
VerifyOrReturnError(exampleOTAProvider != nullptr, CHIP_ERROR_INCORRECT_STATE);
3535

3636
const uint32_t delay = strtoul(argv[0], nullptr, 10);
37-
exampleOTAProvider->SetDelayedActionTimeSec(delay);
37+
exampleOTAProvider->SetDelayedQueryActionTimeSec(delay);
38+
exampleOTAProvider->SetDelayedApplyActionTimeSec(delay);
3839
return CHIP_NO_ERROR;
3940
}
4041

examples/ota-provider-app/linux/README.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug c
1313

1414
## Usage
1515

16-
| Command Line Options | Description |
17-
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18-
| -f/--filepath <file> | Path to a file containing an OTA image |
19-
| -o/--otaImageList <file> | Path to a file containing a list of OTA images |
20-
| -q/--queryImageStatus <updateAvailable \| busy \| updateNotAvailable> | Value for the Status field in the QueryImageResponse |
21-
| -x/--ignoreQueryImage <num_times_to_ignore> | The number of times to ignore the QueryImage Command and not send a response | |
22-
| -y/--ignoreApplyUpdate <num_times_to_ignore> | The number of times to ignore the ApplyUpdate Request and not send a response |
23-
| -a/--applyUpdateAction <proceed \| awaitNextAction \| discontinue> | Value for the Action field in the ApplyUpdateResponse |
24-
| -t/--delayedActionTimeSec <time> | Value in seconds for the DelayedActionTime field in the QueryImageResponse and ApplyUpdateResponse |
25-
| -u/--userConsentState <granted \| denied \| deferred> | Current user consent state which results in various values for Status field in QueryImageResponse <br> Note that -q/--queryImageStatus overrides this option <li> granted: Status field in QueryImageResponse is set to updateAvailable <li> denied: Status field in QueryImageResponse is set to updateNotAvailable <li> deferred: Status field in QueryImageResponse is set to busy |
26-
| -s/--softwareVersion <version> | Value for the SoftwareVersion field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option |
27-
| -S/--softwareVersionStr <version string> | Value for the SoftwareVersionString field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option |
28-
| -c/--UserConsentNeeded | If provided, and value of RequestorCanConsent field in QueryImage Command is true, <br> then value of UserConsentNeeded field in the QueryImageResponse is set to true. <br> Else, value of UserConsentNeeded is false. |
16+
| Command Line Options | Description |
17+
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18+
| -f/--filepath <file> | Path to a file containing an OTA image |
19+
| -o/--otaImageList <file> | Path to a file containing a list of OTA images |
20+
| -q/--queryImageStatus <updateAvailable \| busy \| updateNotAvailable> | Value for the Status field in the first QueryImageResponse. <br> For all subsequent responses, the value of updateAvailable will be used. |
21+
| -x/--ignoreQueryImage <num_times_to_ignore> | The number of times to ignore the QueryImage Command and not send a response |
22+
| -y/--ignoreApplyUpdate <num_times_to_ignore> | The number of times to ignore the ApplyUpdate Request and not send a response |
23+
| -a/--applyUpdateAction <proceed \| awaitNextAction \| discontinue> | Value for the Action field in the first ApplyUpdateResponse. <br> For all subsequent responses, the value of proceed will be used. |
24+
| -t/--delayedQueryActionTimeSec <time> | Value in seconds for the DelayedActionTime field in the first QueryImageResponse. <br> Value will revert back to 0 seconds on subsequent QueryImage Responses. |
25+
| -p/--delayedApplyActionTimeSec <time> | Value in seconds for the DelayedActionTime field in the first ApplyUpdateResponse. <br> Value will revert back to 0 seconds on subsequent ApplyUpdate Responses. |
26+
| -u/--userConsentState <granted \| denied \| deferred> | The user consent state for the first QueryImageResponse. For all subsequent responses, the value of granted state will be used. <br> Current user consent state which results in various values for Status field in QueryImageResponse <br> Note that -q/--queryImageStatus overrides this option <li> granted: Status field in QueryImageResponse is set to updateAvailable <li> denied: Status field in QueryImageResponse is set to updateNotAvailable <li> deferred: Status field in QueryImageResponse is set to busy |
27+
| -s/--softwareVersion <version> | Value for the SoftwareVersion field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option |
28+
| -S/--softwareVersionStr <version string> | Value for the SoftwareVersionString field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option |
29+
| -c/--UserConsentNeeded | If provided, and value of RequestorCanConsent field in QueryImage Command is true, <br> then value of UserConsentNeeded field in the QueryImageResponse is set to true. <br> Else, value of UserConsentNeeded is false. |
2930

3031
**Using `--filepath` and `--otaImageList`**
3132

0 commit comments

Comments
 (0)