-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OTA] Set default configuration values for OTA Provider to prevent crash
- Update README on application usage
- Loading branch information
1 parent
31b5331
commit abd4d45
Showing
4 changed files
with
84 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,52 @@ | ||
# ota-provider-app | ||
|
||
This is a reference application that implements an example of an OTA Provider | ||
Cluster Server. | ||
This is a reference application that implements an example of an OTA Provider Cluster Server. | ||
|
||
## Building | ||
|
||
Suggest doing the following: | ||
`scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false` | ||
``` | ||
scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/debug chip_config_network_layer_ble=false | ||
``` | ||
|
||
## Usage | ||
|
||
`./ota-provider-app [-f/--filepath \<file\>] [-o/--otaImageList \<file\>]` | ||
|
||
If `--filepath` is supplied, `ota-provider-app` will automatically serve that | ||
file to the OTA Requestor (SoftwareVersion will be Requester version + 1). | ||
|
||
If `--otaImageList` is supplied, `ota-provider-app` will parse the JSON file and | ||
extract all required data. Then the most recent, valid software version will be | ||
selected and the corresponding ota-file will be sent to the OTA Requestor. | ||
|
||
Here's an example of the otaImageList file contents: | ||
|
||
{ "foo": 1, // ignored by parser "deviceSoftwareVersionModel": [ { "vendorId": | ||
1, "productId": 1, "softwareVersion": 10, "softwareVersionString": "1.0.0", | ||
"cDVersionNumber": 18, "softwareVersionValid": true, | ||
"minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, | ||
"otaURL": "/tmp/ota.txt" }, { "vendorId": 1, "productId": 1, "softwareVersion": | ||
20, "softwareVersionString": "1.0.1", "cDVersionNumber": 18, | ||
"softwareVersionValid": false, "minApplicableSoftwareVersion": 0, | ||
"maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" }, { "vendorId": | ||
1, "productId": 1, "softwareVersion": 30, "softwareVersionString": "1.0.2", | ||
"cDVersionNumber": 18, "softwareVersionValid": true, | ||
"minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, | ||
"otaURL": "/tmp/ota.txt" }, { "vendorId": 1, "productId": 1, "softwareVersion": | ||
40, "softwareVersionString": "1.1.0", "cDVersionNumber": 18, | ||
"softwareVersionValid": true, "minApplicableSoftwareVersion": 0, | ||
"maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" }, { "vendorId": | ||
1, "productId": 1, "softwareVersion": 50, "softwareVersionString": "1.1.1", | ||
"cDVersionNumber": 18, "softwareVersionValid": false, | ||
"minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, | ||
"otaURL": "/tmp/ota.txt" } ] } | ||
|
||
If neither `--filepath` nor `--otaImageList` are supplied, `ota-provider-app` | ||
will respond to `QueryImage` with `NotAvailable` status. | ||
|
||
## Current Features/Limitations | ||
|
||
### Features | ||
|
||
- can provide local filepath to serve as OTA image | ||
- can complete full BDX transfer | ||
- supports variable-length / startoffset for BDX transfer | ||
|
||
### Limitations: | ||
| Command Line Options | Description | | ||
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| -f/--filepath <file> | Path to a file containing an OTA image | | ||
| -o/--otaImageList <file> | Path to a file containing a list of OTA images | | ||
| -q/--queryImageStatus <updateAvailable \| busy \| updateNotAvailable> | Value for the Status field in the QueryImageResponse | | ||
| -t/--delayedActionTimeSec <time> | Value in seconds for the DelayedActionTime field in the QueryImageResponse and ApplyUpdateResponse | | ||
| -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 | | ||
| -s/--softwareVersion <version> | Value for the SoftwareVersion field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option | | ||
| -S/--softwareVersionStr <version string> | Value for the SoftwareVersionString field in the QueryImageResponse <br> Note that -o/--otaImageList overrides this option | | ||
| -c/--UserConsentNeeded | If provided, value of UserConsentNeeded in the Query Image Response is set to true | | ||
|
||
**Using `--filepath` and `--otaImageList`** | ||
|
||
- The two options cannot be supplied together | ||
- If neither option is supplied, the application will respond with `NotAvailable` status | ||
- If `--filepath` is supplied, the application will automatically serve that file to the OTA Requestor (SoftwareVersion will be requester software version + 1) | ||
- If `--otaImageList` is supplied, the application will parse the JSON file and extract all required data. The most recent/valid software version will be selected and the corresponding OTA file will be sent to the OTA Requestor | ||
|
||
An example of the `--otaImageList` file contents: | ||
|
||
``` | ||
{ "foo": 1, // ignored by parser | ||
"deviceSoftwareVersionModel": | ||
[ | ||
{ "vendorId": 1, "productId": 1, "softwareVersion": 10, "softwareVersionString": "1.0.0", "cDVersionNumber": 18, "softwareVersionValid": true, "minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" }, | ||
{ "vendorId": 1, "productId": 1, "softwareVersion": 20, "softwareVersionString": "1.0.1", "cDVersionNumber": 18, "softwareVersionValid": false, "minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" }, | ||
{ "vendorId": 1, "productId": 1, "softwareVersion": 30, "softwareVersionString": "1.0.2", "cDVersionNumber": 18, "softwareVersionValid": true, "minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" }, | ||
{ "vendorId": 1, "productId": 1, "softwareVersion": 40, "softwareVersionString": "1.1.0", "cDVersionNumber": 18, "softwareVersionValid": true, "minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" }, | ||
{ "vendorId": 1, "productId": 1, "softwareVersion": 50, "softwareVersionString": "1.1.1", "cDVersionNumber": 18, "softwareVersionValid": false, "minApplicableSoftwareVersion": 0, "maxApplicableSoftwareVersion": 100, "otaURL": "/tmp/ota.txt" } | ||
] | ||
} | ||
``` | ||
|
||
## Current Limitations | ||
|
||
- Synchronous BDX transfer only | ||
- using hardcoded test values for local and peer Node IDs | ||
- does not check VID/PID | ||
- no configuration for `AwaitNextAction` | ||
- only one transfer at a time (does not check incoming `UpdateTokens`) | ||
- Does not check VID/PID | ||
- No configuration for `AwaitNextAction` | ||
- Only one transfer at a time (does not check incoming `UpdateTokens`) |
Oops, something went wrong.