Skip to content

Commit

Permalink
[OTA] Make default requestor more consistently named (#17026)
Browse files Browse the repository at this point in the history
  • Loading branch information
carol-apple authored and pull[bot] committed Nov 23, 2023
1 parent 0f2d319 commit 30140b0
Show file tree
Hide file tree
Showing 30 changed files with 110 additions and 112 deletions.
2 changes: 1 addition & 1 deletion config/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ if (CONFIG_CHIP_OTA_REQUESTOR)

target_sources(${APP_TARGET} PRIVATE
${CHIP_ROOT}/examples/platform/mbed/ota/OTARequestorDriverImpl.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/GenericOTARequestorDriver.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ list(
APPEND ${list_chip_main_sources}
#OTARequestor
${chip_dir}/src/app/clusters/ota-requestor/BDXDownloader.cpp
${chip_dir}/src/app/clusters/ota-requestor/OTARequestor.cpp
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp
${chip_dir}/src/app/clusters/ota-requestor/GenericOTARequestorDriver.cpp
${chip_dir}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#if CONFIG_ENABLE_OTA_REQUESTOR
#include "app/clusters/ota-requestor/DefaultOTARequestorStorage.h"
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <platform/Ameba/AmebaOTAImageProcessor.h>
#endif

Expand Down Expand Up @@ -99,7 +99,7 @@ Identify gIdentify1 = {
static DeviceCallbacks EchoCallbacks;

#if CONFIG_ENABLE_OTA_REQUESTOR
OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@

#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/af.h>
#include <binding-handler.h>
Expand Down Expand Up @@ -77,7 +77,7 @@ static DeviceCallbacks EchoCallbacks;
namespace {

#if CONFIG_ENABLE_OTA_REQUESTOR
OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ list(
APPEND ${list_chip_main_sources}
#OTARequestor
${chip_dir}/src/app/clusters/ota-requestor/BDXDownloader.cpp
${chip_dir}/src/app/clusters/ota-requestor/OTARequestor.cpp
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp
${chip_dir}/src/app/clusters/ota-requestor/GenericOTARequestorDriver.cpp
${chip_dir}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#if CONFIG_ENABLE_OTA_REQUESTOR
#include "app/clusters/ota-requestor/DefaultOTARequestorStorage.h"
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <platform/Ameba/AmebaOTAImageProcessor.h>
#endif

Expand Down Expand Up @@ -84,7 +84,7 @@ void NetWorkCommissioningInstInit()
static DeviceCallbacks EchoCallbacks;

#if CONFIG_ENABLE_OTA_REQUESTOR
OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "shell_extension/launch.h"
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
Expand All @@ -45,7 +45,7 @@ using namespace ::chip::DeviceManager;
using namespace ::chip::DeviceLayer;

#if CONFIG_ENABLE_OTA_REQUESTOR
OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
6 changes: 3 additions & 3 deletions examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include "OTAImageProcessorImpl.h"
#include "OtaSupport.h"
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>

#include "Keyboard.h"
#include "LED.h"
Expand Down Expand Up @@ -85,7 +85,7 @@ using namespace chip;
AppTask AppTask::sAppTask;

/* OTA related variables */
static OTARequestor gRequestorCore;
static DefaultOTARequestor gRequestorCore;
static DefaultOTARequestorStorage gRequestorStorage;
static DeviceLayer::GenericOTARequestorDriver gRequestorUser;
static BDXDownloader gDownloader;
Expand Down Expand Up @@ -489,7 +489,7 @@ void AppTask::OTAHandler(AppEvent * aEvent)
return;
}

static_cast<OTARequestor *>(GetRequestorInstance())->TriggerImmediateQuery();
static_cast<DefaultOTARequestor *>(GetRequestorInstance())->TriggerImmediateQuery();
}

void AppTask::BleHandler(AppEvent * aEvent)
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ target_sources(app PRIVATE
${CHIP_ROOT}/src/app/clusters/network-commissioning/network-commissioning.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/BDXDownloader.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/OTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
${CHIP_ROOT}/src/app/clusters/ota-requestor/GenericOTARequestorDriver.cpp
${CHIP_ROOT}/src/app/clusters/groups-server/groups-server.cpp
)
4 changes: 2 additions & 2 deletions examples/lock-app/cc13x2x7_26x2x7/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <platform/CHIPDeviceLayer.h>

#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/CHIPPlatformMemory.h>
#include <platform/cc13x2_26x2/OTAImageProcessorImpl.h>
Expand Down Expand Up @@ -63,7 +63,7 @@ static Button_Handle sAppRightHandle;

AppTask AppTask::sAppTask;

static OTARequestor sRequestorCore;
static DefaultOTARequestor sRequestorCore;
static DefaultOTARequestorStorage sRequestorStorage;
static GenericOTARequestorDriver sRequestorUser;
static BDXDownloader sDownloader;
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-requestor-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ list(
${chip_dir}/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp

${chip_dir}/src/app/clusters/ota-requestor/BDXDownloader.cpp
${chip_dir}/src/app/clusters/ota-requestor/OTARequestor.cpp
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
${chip_dir}/src/app/clusters/ota-requestor/DefaultOTARequestorStorage.cpp
${chip_dir}/src/app/clusters/ota-requestor/GenericOTARequestorDriver.cpp
${chip_dir}/src/app/clusters/ota-requestor/ota-requestor-server.cpp
Expand Down
6 changes: 3 additions & 3 deletions examples/ota-requestor-app/ameba/main/chipinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@
#include <support/CHIPMem.h>

#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <platform/Ameba/AmebaOTAImageProcessor.h>

void * __dso_handle = 0;

using chip::AmebaOTAImageProcessor;
using chip::BDXDownloader;
using chip::ByteSpan;
using chip::DefaultOTARequestor;
using chip::EndpointId;
using chip::FabricIndex;
using chip::GetRequestorInstance;
using chip::NodeId;
using chip::OnDeviceConnected;
using chip::OnDeviceConnectionFailure;
using chip::OTADownloader;
using chip::OTARequestor;
using chip::PeerId;
using chip::Server;
using chip::VendorId;
Expand Down Expand Up @@ -85,7 +85,7 @@ void NetWorkCommissioningInstInit()

static DeviceCallbacks EchoCallbacks;

OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
4 changes: 2 additions & 2 deletions examples/ota-requestor-app/cyw30739/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*/
#include <ChipShellCollection.h>
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <app/server/Server.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/shell/Engine.h>
Expand All @@ -42,7 +42,7 @@ using namespace chip::Shell;

static void InitApp(intptr_t args);

OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
DeviceLayer::GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
4 changes: 2 additions & 2 deletions examples/ota-requestor-app/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
#include <app/util/attribute-storage.h>

#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <platform/EFR32/OTAImageProcessorImpl.h>

#include <assert.h>
Expand Down Expand Up @@ -100,7 +100,7 @@ using namespace ::chip::Credentials;
using namespace ::chip::DeviceLayer;

// Global OTA objects
OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
DeviceLayer::GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
4 changes: 2 additions & 2 deletions examples/ota-requestor-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include "nvs_flash.h"
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <app/server/Server.h>
#include <platform/ESP32/NetworkCommissioningDriver.h>

Expand All @@ -53,7 +53,7 @@ namespace {
const char * TAG = "ota-requester-app";
static DeviceCallbacks EchoCallbacks;

OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down
8 changes: 4 additions & 4 deletions examples/ota-requestor-app/linux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

#include "AppMain.h"
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorUserConsent.h>
#include <app/clusters/ota-requestor/ExtendedOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <platform/Linux/OTAImageProcessorImpl.h>

using chip::BDXDownloader;
Expand All @@ -35,10 +35,10 @@ using chip::OnDeviceConnected;
using chip::OnDeviceConnectionFailure;
using chip::OTADownloader;
using chip::OTAImageProcessorImpl;
using chip::OTARequestor;
using chip::PeerId;
using chip::Server;
using chip::VendorId;
using chip::app::Clusters::OtaSoftwareUpdateRequestor::OTAUpdateStateEnum;
using chip::Callback::Callback;
using chip::System::Layer;
using chip::Transport::PeerAddress;
Expand All @@ -54,7 +54,7 @@ class CustomOTARequestorDriver : public DeviceLayer::ExtendedOTARequestorDriver
void UpdateDownloaded() override;
};

OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
CustomOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down Expand Up @@ -229,7 +229,7 @@ int main(int argc, char * argv[])
ChipLinuxAppMainLoop();

// If the event loop had been stopped due to an update being applied, boot into the new image
if (gRequestorCore.GetCurrentUpdateState() == OTARequestor::OTAUpdateStateEnum::kApplying)
if (gRequestorCore.GetCurrentUpdateState() == OTAUpdateStateEnum::kApplying)
{
if (kMaxFilePathSize <= strlen(kImageExecPath))
{
Expand Down
8 changes: 4 additions & 4 deletions examples/ota-requestor-app/p6/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
Expand Down Expand Up @@ -60,12 +60,12 @@ extern "C" {

using chip::BDXDownloader;
using chip::CharSpan;
using chip::DefaultOTARequestor;
using chip::FabricIndex;
using chip::GetRequestorInstance;
using chip::NodeId;
using chip::OTADownloader;
using chip::OTAImageProcessorImpl;
using chip::OTARequestor;
using chip::System::Layer;

using namespace ::chip;
Expand Down Expand Up @@ -93,7 +93,7 @@ StaticQueue_t sAppEventQueueStruct;
StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)];
StaticTask_t appTaskStruct;

OTARequestor gRequestorCore;
DefaultOTARequestor gRequestorCore;
DefaultOTARequestorStorage gRequestorStorage;
GenericOTARequestorDriver gRequestorUser;
BDXDownloader gDownloader;
Expand Down Expand Up @@ -470,6 +470,6 @@ void OnTriggerUpdateTimerHandler(Layer * systemLayer, void * appState)
{
P6_LOG("Triggering immediate OTA update query");

OTARequestor * req = static_cast<OTARequestor *>(GetRequestorInstance());
DefaultOTARequestor * req = static_cast<DefaultOTARequestor *>(GetRequestorInstance());
req->TriggerImmediateQuery();
}
2 changes: 1 addition & 1 deletion examples/platform/efr32/OTAConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ __attribute__((used)) ApplicationProperties_t sl_app_properties = {
};

// Global OTA objects
chip::OTARequestor gRequestorCore;
chip::DefaultOTARequestor gRequestorCore;
chip::DefaultOTARequestorStorage gRequestorStorage;
chip::DeviceLayer::GenericOTARequestorDriver gRequestorUser;
chip::BDXDownloader gDownloader;
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/efr32/OTAConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#pragma once

#include <app/clusters/ota-requestor/BDXDownloader.h>
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/GenericOTARequestorDriver.h>
#include <app/clusters/ota-requestor/OTARequestor.h>
#include <platform/EFR32/OTAImageProcessorImpl.h>

class OTAConfig
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/mbed/util/include/DFUManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

#ifdef CHIP_OTA_REQUESTOR
#include <BDXDownloader.h>
#include <DefaultOTARequestor.h>
#include <DefaultOTARequestorStorage.h>
#include <OTAImageProcessorImpl.h>
#include <OTARequestor.h>
#include <OTARequestorDriverImpl.h>
#endif // CHIP_OTA_REQUESTOR

Expand All @@ -54,7 +54,7 @@ class DFUManager
static DFUManager sDFUMgr;

#ifdef CHIP_OTA_REQUESTOR
chip::OTARequestor mRequestorCore;
chip::DefaultOTARequestor mRequestorCore;
chip::DefaultOTARequestorStorage mRequestorStorage;
chip::DeviceLayer::OTARequestorDriverImpl mRequestorDriver;
chip::BDXDownloader mDownloader;
Expand Down
Loading

0 comments on commit 30140b0

Please sign in to comment.