From 544939358266a53308112076042c76040713ba18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Kr=C3=B3lik?= <66667989+Damian-Nordic@users.noreply.github.com> Date: Thu, 10 Mar 2022 09:44:10 +0100 Subject: [PATCH] [ota] Remove two outdated/redundant methods (#16019) * [ota] Move test requestor feature to the application * [ota] Remove SetOTAImageProcessorParams The function was initially used to set name of image file to be downloaded, but most platforms don't use that and some platforms use the file name as the output file name, that is, the file name where the downloaded image should be saved. Remove the method from the common interface and add SetOTAImageFile setters in platforms that need to have the output file name set. --- .../ameba/main/chipinterface.cpp | 6 ---- .../lighting-app/ameba/main/chipinterface.cpp | 6 ---- .../nxp/k32w/k32w0/main/AppTask.cpp | 8 +----- .../ameba/main/chipinterface.cpp | 7 ----- .../ota-requestor-app/efr32/src/AppTask.cpp | 4 +-- examples/ota-requestor-app/linux/main.cpp | 28 ++++++++++--------- examples/ota-requestor-app/p6/src/AppTask.cpp | 1 - examples/platform/efr32/OTAConfig.cpp | 4 +-- .../clusters/ota-requestor/OTARequestor.cpp | 2 +- src/app/clusters/ota-requestor/OTARequestor.h | 6 ---- src/include/platform/OTAImageProcessor.h | 10 ++----- src/platform/EFR32/OTAImageProcessorImpl.cpp | 6 ++-- src/platform/EFR32/OTAImageProcessorImpl.h | 2 ++ src/platform/Linux/OTAImageProcessorImpl.cpp | 11 ++++---- src/platform/Linux/OTAImageProcessorImpl.h | 2 ++ .../nxp/k32w/k32w0/OTAImageProcessorImpl.cpp | 8 +++--- .../nxp/k32w/k32w0/OTAImageProcessorImpl.h | 2 ++ 17 files changed, 39 insertions(+), 74 deletions(-) diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp index 48e285b03d986a..bceeec83e598f5 100644 --- a/examples/all-clusters-app/ameba/main/chipinterface.cpp +++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -122,12 +122,6 @@ static void InitOTARequestor(void) // Set server instance used for session establishment gRequestorCore.Init(chip::Server::GetInstance(), gRequestorStorage, gRequestorUser, gDownloader); - // WARNING: this is probably not realistic to know such details of the image or to even have an OTADownloader instantiated at - // the beginning of program execution. We're using hardcoded values here for now since this is a reference application. - // TODO: instatiate and initialize these values when QueryImageResponse tells us an image is available - // TODO: add API for OTARequestor to pass QueryImageResponse info to the application to use for OTADownloader init - OTAImageProcessorParams ipParams; - gImageProcessor.SetOTAImageProcessorParams(ipParams); gImageProcessor.SetOTADownloader(&gDownloader); // Connect the Downloader and Image Processor objects diff --git a/examples/lighting-app/ameba/main/chipinterface.cpp b/examples/lighting-app/ameba/main/chipinterface.cpp index 96fd9c5887efaf..44322dbbe4ea2e 100644 --- a/examples/lighting-app/ameba/main/chipinterface.cpp +++ b/examples/lighting-app/ameba/main/chipinterface.cpp @@ -107,12 +107,6 @@ static void InitOTARequestor(void) // Set server instance used for session establishment gRequestorCore.Init(Server::GetInstance(), gRequestorStorage, gRequestorUser, gDownloader); - // WARNING: this is probably not realistic to know such details of the image or to even have an OTADownloader instantiated at - // the beginning of program execution. We're using hardcoded values here for now since this is a reference application. - // TODO: instatiate and initialize these values when QueryImageResponse tells us an image is available - // TODO: add API for OTARequestor to pass QueryImageResponse info to the application to use for OTADownloader init - OTAImageProcessorParams ipParams; - gImageProcessor.SetOTAImageProcessorParams(ipParams); gImageProcessor.SetOTADownloader(&gDownloader); // Connect the Downloader and Image Processor objects diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp index 646144671c8713..ed3a162cdb6e66 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -127,13 +127,7 @@ CHIP_ERROR AppTask::Init() gRequestorCore.Init(Server::GetInstance(), gRequestorStorage, gRequestorUser, gDownloader); gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - // WARNING: this is probably not realistic to know such details of the image or to even have an OTADownloader instantiated at - // the beginning of program execution. We're using hardcoded values here for now since this is a reference application. - // TODO: instatiate and initialize these values when QueryImageResponse tells us an image is available - // TODO: add API for OTARequestor to pass QueryImageResponse info to the application to use for OTADownloader init - OTAImageProcessorParams ipParams; - ipParams.imageFile = CharSpan("test.txt"); - gImageProcessor.SetOTAImageProcessorParams(ipParams); + gImageProcessor.SetOTAImageFile(CharSpan("test.txt")); gImageProcessor.SetOTADownloader(&gDownloader); // Connect the gDownloader and Image Processor objects diff --git a/examples/ota-requestor-app/ameba/main/chipinterface.cpp b/examples/ota-requestor-app/ameba/main/chipinterface.cpp index 679937ef2ff481..bfb91532a8c1db 100644 --- a/examples/ota-requestor-app/ameba/main/chipinterface.cpp +++ b/examples/ota-requestor-app/ameba/main/chipinterface.cpp @@ -50,7 +50,6 @@ using chip::NodeId; using chip::OnDeviceConnected; using chip::OnDeviceConnectionFailure; using chip::OTADownloader; -using chip::OTAImageProcessorParams; using chip::OTARequestor; using chip::PeerId; using chip::Server; @@ -107,12 +106,6 @@ static void InitOTARequestor(void) // Set server instance used for session establishment gRequestorCore.Init(chip::Server::GetInstance(), gRequestorStorage, gRequestorUser, gDownloader); - // WARNING: this is probably not realistic to know such details of the image or to even have an OTADownloader instantiated at - // the beginning of program execution. We're using hardcoded values here for now since this is a reference application. - // TODO: instatiate and initialize these values when QueryImageResponse tells us an image is available - // TODO: add API for OTARequestor to pass QueryImageResponse info to the application to use for OTADownloader init - OTAImageProcessorParams ipParams; - gImageProcessor.SetOTAImageProcessorParams(ipParams); gImageProcessor.SetOTADownloader(&gDownloader); // Connect the Downloader and Image Processor objects diff --git a/examples/ota-requestor-app/efr32/src/AppTask.cpp b/examples/ota-requestor-app/efr32/src/AppTask.cpp index a6f9dc56c6f705..0659962b174a9d 100644 --- a/examples/ota-requestor-app/efr32/src/AppTask.cpp +++ b/examples/ota-requestor-app/efr32/src/AppTask.cpp @@ -542,9 +542,7 @@ void AppTask::InitOTARequestor() gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - OTAImageProcessorParams ipParams; - ipParams.imageFile = CharSpan("test.txt"); - gImageProcessor.SetOTAImageProcessorParams(ipParams); + gImageProcessor.SetOTAImageFile(CharSpan("test.txt")); gImageProcessor.SetOTADownloader(&gDownloader); // Connect the Downloader and Image Processor objects diff --git a/examples/ota-requestor-app/linux/main.cpp b/examples/ota-requestor-app/linux/main.cpp index 0de41918de1e23..520c30a099542c 100644 --- a/examples/ota-requestor-app/linux/main.cpp +++ b/examples/ota-requestor-app/linux/main.cpp @@ -35,7 +35,6 @@ using chip::OnDeviceConnected; using chip::OnDeviceConnectionFailure; using chip::OTADownloader; using chip::OTAImageProcessorImpl; -using chip::OTAImageProcessorParams; using chip::OTARequestor; using chip::PeerId; using chip::Server; @@ -48,9 +47,15 @@ using namespace chip::ArgParser; using namespace chip::Messaging; using namespace chip::app::Clusters::OtaSoftwareUpdateProvider::Commands; +class CustomOTARequestorDriver : public DeviceLayer::ExtendedOTARequestorDriver +{ +public: + bool CanConsent() override; +}; + OTARequestor gRequestorCore; DefaultOTARequestorStorage gRequestorStorage; -DeviceLayer::ExtendedOTARequestorDriver gRequestorUser; +CustomOTARequestorDriver gRequestorUser; BDXDownloader gDownloader; OTAImageProcessorImpl gImageProcessor; chip::ota::DefaultOTARequestorUserConsentProvider gUserConsentProvider; @@ -81,7 +86,8 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" " Periodic timeout for querying providers in the default OTA provider list\n" " If none or zero is supplied the timeout is set to every 24 hours. \n" " -c/--requestorCanConsent\n" - " If supplied, the RequestorCanConsent field of the QueryImage command is set to true.\n" + " If supplied, the RequestorCanConsent field of the QueryImage command is set to " + "true.\n" " Otherwise, the value is determined by the driver.\n " " -f/--otaDownloadPath \n" " If supplied, the OTA image is downloaded to the given fully-qualified file-path.\n" @@ -93,6 +99,11 @@ OptionSet cmdLineOptions = { HandleOptions, cmdLineOptionsDef, "PROGRAM OPTIONS" OptionSet * allOptions[] = { &cmdLineOptions, nullptr }; +bool CustomOTARequestorDriver::CanConsent() +{ + return gRequestorCanConsent.ValueOr(DeviceLayer::ExtendedOTARequestorDriver::CanConsent()); +} + static void InitOTARequestor(void) { // Set the global instance of the OTA requestor core component @@ -105,11 +116,7 @@ static void InitOTARequestor(void) gRequestorCore.Init(chip::Server::GetInstance(), gRequestorStorage, gRequestorUser, gDownloader); gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - // WARNING: this is probably not realistic to know such details of the image or to even have an OTADownloader instantiated at - // the beginning of program execution. We're using hardcoded values here for now since this is a reference application. - OTAImageProcessorParams ipParams; - ipParams.imageFile = CharSpan::fromCharString(gOtaDownloadPath); - gImageProcessor.SetOTAImageProcessorParams(ipParams); + gImageProcessor.SetOTAImageFile(CharSpan::fromCharString(gOtaDownloadPath)); gImageProcessor.SetOTADownloader(&gDownloader); // Set the image processor instance used for handling image being downloaded @@ -174,11 +181,6 @@ void ApplicationInit() { chip::Dnssd::Resolver::Instance().Init(chip::DeviceLayer::UDPEndPointManager()); - if (gRequestorCanConsent.HasValue()) - { - gRequestorCore.SetRequestorCanConsent(gRequestorCanConsent.Value()); - } - // Initialize all OTA download components InitOTARequestor(); } diff --git a/examples/ota-requestor-app/p6/src/AppTask.cpp b/examples/ota-requestor-app/p6/src/AppTask.cpp index 2631a843160081..a5c4a61cc5d090 100644 --- a/examples/ota-requestor-app/p6/src/AppTask.cpp +++ b/examples/ota-requestor-app/p6/src/AppTask.cpp @@ -65,7 +65,6 @@ using chip::GetRequestorInstance; using chip::NodeId; using chip::OTADownloader; using chip::OTAImageProcessorImpl; -using chip::OTAImageProcessorParams; using chip::OTARequestor; using chip::System::Layer; diff --git a/examples/platform/efr32/OTAConfig.cpp b/examples/platform/efr32/OTAConfig.cpp index 068ff810bcc47e..4b9201230c84da 100644 --- a/examples/platform/efr32/OTAConfig.cpp +++ b/examples/platform/efr32/OTAConfig.cpp @@ -77,9 +77,7 @@ void OTAConfig::Init() gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - chip::OTAImageProcessorParams ipParams; - ipParams.imageFile = chip::CharSpan("test.txt"); - gImageProcessor.SetOTAImageProcessorParams(ipParams); + gImageProcessor.SetOTAImageFile(chip::CharSpan("test.txt")); gImageProcessor.SetOTADownloader(&gDownloader); // Connect the Downloader and Image Processor objects diff --git a/src/app/clusters/ota-requestor/OTARequestor.cpp b/src/app/clusters/ota-requestor/OTARequestor.cpp index d70298bdf6abc1..f45a1f1fdb8eb5 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.cpp +++ b/src/app/clusters/ota-requestor/OTARequestor.cpp @@ -656,7 +656,7 @@ CHIP_ERROR OTARequestor::SendQueryImageRequest(OperationalDeviceProxy & devicePr ReturnErrorOnFailure(DeviceLayer::ConfigurationMgr().GetSoftwareVersion(args.softwareVersion)); args.protocolsSupported = kProtocolsSupported; - args.requestorCanConsent.SetValue(mRequestorCanConsent.ValueOr(mOtaRequestorDriver->CanConsent())); + args.requestorCanConsent.SetValue(mOtaRequestorDriver->CanConsent()); uint16_t hardwareVersion; if (DeviceLayer::ConfigurationMgr().GetHardwareVersion(hardwareVersion) == CHIP_NO_ERROR) diff --git a/src/app/clusters/ota-requestor/OTARequestor.h b/src/app/clusters/ota-requestor/OTARequestor.h index b5de8b40b0c55b..9b0cdc1e84be34 100644 --- a/src/app/clusters/ota-requestor/OTARequestor.h +++ b/src/app/clusters/ota-requestor/OTARequestor.h @@ -130,11 +130,6 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe reinterpret_cast(this)); } - /** - * Called to set optional requestorCanConsent value provided by Requestor. - */ - void SetRequestorCanConsent(bool requestorCanConsent) { mRequestorCanConsent.SetValue(requestorCanConsent); } - private: using QueryImageResponseDecodableType = app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::DecodableType; using ApplyUpdateResponseDecodableType = app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::DecodableType; @@ -314,7 +309,6 @@ class OTARequestor : public OTARequestorInterface, public BDXDownloader::StateDe CharSpan mFileDesignator; OTAUpdateStateEnum mCurrentUpdateState = OTAUpdateStateEnum::kUnknown; Server * mServer = nullptr; - chip::Optional mRequestorCanConsent; ProviderLocationList mDefaultOtaProviderList; Optional mProviderLocation; // Provider location used for the current update in progress }; diff --git a/src/include/platform/OTAImageProcessor.h b/src/include/platform/OTAImageProcessor.h index 7fd7a2487ba95a..9317ce42136c9d 100644 --- a/src/include/platform/OTAImageProcessor.h +++ b/src/include/platform/OTAImageProcessor.h @@ -26,9 +26,8 @@ namespace chip { -struct OTAImageProcessorParams +struct OTAImageProgress { - CharSpan imageFile; uint64_t downloadedBytes = 0; uint64_t totalFileBytes = 0; }; @@ -76,11 +75,6 @@ class DLL_EXPORT OTAImageProcessorInterface */ virtual CHIP_ERROR ProcessBlock(ByteSpan & block) = 0; - /** - * Called to setup params for the OTA image download - */ - virtual void SetOTAImageProcessorParams(OTAImageProcessorParams & params) { mParams = params; }; - /** * Called to check the current download status of the OTA image download. */ @@ -97,7 +91,7 @@ class DLL_EXPORT OTAImageProcessorInterface virtual uint64_t GetBytesDownloaded() { return mParams.downloadedBytes; } protected: - OTAImageProcessorParams mParams; + OTAImageProgress mParams; }; } // namespace chip diff --git a/src/platform/EFR32/OTAImageProcessorImpl.cpp b/src/platform/EFR32/OTAImageProcessorImpl.cpp index d3f2190b588e6d..be2284d61afc27 100644 --- a/src/platform/EFR32/OTAImageProcessorImpl.cpp +++ b/src/platform/EFR32/OTAImageProcessorImpl.cpp @@ -34,7 +34,7 @@ uint32_t OTAImageProcessorImpl::mWriteOffset; CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() { - if (mParams.imageFile.empty()) + if (mImageFile.empty()) { ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); return CHIP_ERROR_INTERNAL; @@ -80,7 +80,7 @@ CHIP_ERROR OTAImageProcessorImpl::Apply() CHIP_ERROR OTAImageProcessorImpl::Abort() { - if (mParams.imageFile.empty()) + if (mImageFile.empty()) { ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); return CHIP_ERROR_INTERNAL; @@ -143,7 +143,7 @@ void OTAImageProcessorImpl::HandleFinalize(intptr_t context) imageProcessor->ReleaseBlock(); - ChipLogProgress(SoftwareUpdate, "OTA image downloaded to %s", imageProcessor->mParams.imageFile.data()); + ChipLogProgress(SoftwareUpdate, "OTA image downloaded to %s", imageProcessor->mImageFile.data()); } void OTAImageProcessorImpl::HandleAbort(intptr_t context) diff --git a/src/platform/EFR32/OTAImageProcessorImpl.h b/src/platform/EFR32/OTAImageProcessorImpl.h index c2318fc6c61525..186c2b0be2a2d7 100644 --- a/src/platform/EFR32/OTAImageProcessorImpl.h +++ b/src/platform/EFR32/OTAImageProcessorImpl.h @@ -37,6 +37,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface CHIP_ERROR ProcessBlock(ByteSpan & block) override; void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; } + void SetOTAImageFile(CharSpan name) { mImageFile = name; } private: //////////// Actual handlers for the OTAImageProcessorInterface /////////////// @@ -59,6 +60,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface static uint8_t mSlotId; // Bootloader storage slot MutableByteSpan mBlock; OTADownloader * mDownloader; + CharSpan mImageFile; }; } // namespace chip diff --git a/src/platform/Linux/OTAImageProcessorImpl.cpp b/src/platform/Linux/OTAImageProcessorImpl.cpp index 2609d337413c6c..ef415d4406a2d8 100644 --- a/src/platform/Linux/OTAImageProcessorImpl.cpp +++ b/src/platform/Linux/OTAImageProcessorImpl.cpp @@ -25,7 +25,7 @@ namespace chip { CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() { - if (mParams.imageFile.empty()) + if (mImageFile.empty()) { ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); return CHIP_ERROR_INTERNAL; @@ -49,7 +49,7 @@ CHIP_ERROR OTAImageProcessorImpl::Apply() CHIP_ERROR OTAImageProcessorImpl::Abort() { - if (mParams.imageFile.empty()) + if (mImageFile.empty()) { ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); return CHIP_ERROR_INTERNAL; @@ -97,8 +97,7 @@ void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) } imageProcessor->mHeaderParser.Init(); - imageProcessor->mOfs.open(imageProcessor->mParams.imageFile.data(), - std::ofstream::out | std::ofstream::ate | std::ofstream::app); + imageProcessor->mOfs.open(imageProcessor->mImageFile.data(), std::ofstream::out | std::ofstream::ate | std::ofstream::app); if (!imageProcessor->mOfs.good()) { imageProcessor->mDownloader->OnPreparedForDownload(CHIP_ERROR_OPEN_FAILED); @@ -121,7 +120,7 @@ void OTAImageProcessorImpl::HandleFinalize(intptr_t context) imageProcessor->mOfs.close(); imageProcessor->ReleaseBlock(); - ChipLogProgress(SoftwareUpdate, "OTA image downloaded to %s", imageProcessor->mParams.imageFile.data()); + ChipLogProgress(SoftwareUpdate, "OTA image downloaded to %s", imageProcessor->mImageFile.data()); } void OTAImageProcessorImpl::HandleApply(intptr_t context) @@ -149,7 +148,7 @@ void OTAImageProcessorImpl::HandleAbort(intptr_t context) } imageProcessor->mOfs.close(); - remove(imageProcessor->mParams.imageFile.data()); + remove(imageProcessor->mImageFile.data()); imageProcessor->ReleaseBlock(); } diff --git a/src/platform/Linux/OTAImageProcessorImpl.h b/src/platform/Linux/OTAImageProcessorImpl.h index 334bbd7d223afa..d01a7c92a2404e 100644 --- a/src/platform/Linux/OTAImageProcessorImpl.h +++ b/src/platform/Linux/OTAImageProcessorImpl.h @@ -38,6 +38,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface CHIP_ERROR ProcessBlock(ByteSpan & block) override; void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; } + void SetOTAImageFile(CharSpan name) { mImageFile = name; } private: //////////// Actual handlers for the OTAImageProcessorInterface /////////////// @@ -64,6 +65,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface OTADownloader * mDownloader; OTAImageHeaderParser mHeaderParser; uint32_t mSoftwareVersion; + CharSpan mImageFile; }; } // namespace chip diff --git a/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp b/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp index a0f9065c7aa19e..67decb387c2639 100644 --- a/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp +++ b/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.cpp @@ -28,7 +28,7 @@ namespace chip { CHIP_ERROR OTAImageProcessorImpl::PrepareDownload() { - if (mParams.imageFile.empty()) + if (mImageFile.empty()) { ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); return CHIP_ERROR_INTERNAL; @@ -51,7 +51,7 @@ CHIP_ERROR OTAImageProcessorImpl::Apply() CHIP_ERROR OTAImageProcessorImpl::Abort() { - if (mParams.imageFile.empty()) + if (mImageFile.empty()) { ChipLogError(SoftwareUpdate, "Invalid output image file supplied"); return CHIP_ERROR_INTERNAL; @@ -95,7 +95,7 @@ void OTAImageProcessorImpl::HandlePrepareDownload(intptr_t context) if (gOtaSuccess_c == OTA_ClientInit()) { - if (gOtaSuccess_c == OTA_StartImage(imageProcessor->mParams.imageFile.size())) + if (gOtaSuccess_c == OTA_StartImage(imageProcessor->mImageFile.size())) { imageProcessor->mDownloader->OnPreparedForDownload(CHIP_NO_ERROR); } @@ -110,7 +110,7 @@ void OTAImageProcessorImpl::HandleAbort(intptr_t context) return; } - remove(imageProcessor->mParams.imageFile.data()); + remove(imageProcessor->mImageFile.data()); imageProcessor->ReleaseBlock(); } diff --git a/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.h b/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.h index 05d6beb941e8ce..45f091bf6624c0 100644 --- a/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.h +++ b/src/platform/nxp/k32w/k32w0/OTAImageProcessorImpl.h @@ -35,6 +35,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface CHIP_ERROR ProcessBlock(ByteSpan & block) override; void SetOTADownloader(OTADownloader * downloader) { mDownloader = downloader; } + void SetOTAImageFile(CharSpan name) { mImageFile = name; } private: //////////// Actual handlers for the OTAImageProcessorInterface /////////////// @@ -55,6 +56,7 @@ class OTAImageProcessorImpl : public OTAImageProcessorInterface OTADownloader * mDownloader; MutableByteSpan mBlock; + CharSpan mImageFile; }; } // namespace chip