Skip to content

Commit

Permalink
Make a QueryImage command from OTA Requestor to OTA Provider
Browse files Browse the repository at this point in the history
* Make ota-provider-app and ota-requestor-app compilable on Mac
* Remove self commissioning code from ota-requestor-app
* Add a parameter for IP address for OTA Requestor to use for creating secure session
* Add a parameter for fabric index for OTA Requestor to use for creating secure session
* Add a parameter for time to wait for OTA Requestor to initiate a QueryImage command from startup
  • Loading branch information
carol-apple committed Oct 26, 2021
1 parent 4eeffb6 commit 9d4e2da
Show file tree
Hide file tree
Showing 13 changed files with 218 additions and 584 deletions.
9 changes: 4 additions & 5 deletions examples/ota-provider-app/linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Suggest doing the following:

## Usage

`./ota-provider-app [--filepath \<filepath\>]`
`./ota-provider-app [-f/--filepath \<file\>]`

If `-filepath` is provided, `ota-provider-app` will automatically serve that
file to the Requestor (SoftwareVersion will be Requester version + 1).
If `--filepath` is supplied, `ota-provider-app` will automatically serve that
file to the OTA Requestor (SoftwareVersion will be Requester version + 1).

If no `-filepath` is provided, `ota-provider-app` will respond to `QueryImage`
If no `--filepath` is supplied, `ota-provider-app` will respond to `QueryImage`
with `NotAvailable` status.

## Current Features/Limitations
Expand All @@ -31,6 +31,5 @@ with `NotAvailable` status.
- Synchronous BDX transfer only
- using hardcoded test values for local and peer Node IDs
- does not check VID/PID
- no configuration for `Busy`/`DelayedActionTime`
- no configuration for `AwaitNextAction`
- only one transfer at a time (does not check incoming `UpdateTokens`)
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void BdxOtaSender::HandleTransferSessionOutput(TransferSession::OutputEvent & ev
VerifyOrReturn(otaFile.good() || otaFile.eof(), ChipLogError(BDX, "%s: file read failed", __FUNCTION__));

blockData.Data = blockBuf->Start();
blockData.Length = otaFile.gcount();
blockData.Length = static_cast<size_t>(otaFile.gcount());
blockData.IsEof = (blockData.Length < blockSize) ||
(mNumBytesSent + static_cast<uint64_t>(blockData.Length) == mTransfer.GetTransferLength() || (otaFile.peek() == EOF));
mNumBytesSent = static_cast<uint32_t>(mNumBytesSent + blockData.Length);
Expand Down
7 changes: 2 additions & 5 deletions examples/ota-requestor-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

executable("chip-ota-requestor-app") {
sources = [
"ExampleSelfCommissioning.h",
"PersistentStorage.cpp",
"main.cpp",
]
sources = [ "main.cpp" ]

deps = [
"${chip_root}/examples/ota-requestor-app/ota-requestor-common",
"${chip_root}/examples/platform/linux:app-main",
"${chip_root}/src/app/device",
"${chip_root}/src/app/server",
"${chip_root}/src/lib",
]
Expand Down
87 changes: 0 additions & 87 deletions examples/ota-requestor-app/linux/ExampleSelfCommissioning.h

This file was deleted.

251 changes: 0 additions & 251 deletions examples/ota-requestor-app/linux/PersistentStorage.cpp

This file was deleted.

Loading

0 comments on commit 9d4e2da

Please sign in to comment.