Skip to content

Commit

Permalink
[nrfconnect] Fix OTA initialization order
Browse files Browse the repository at this point in the history
Recent OTA changes impose an assumption that OTA Requestor
must be initialized prior to the OTA Requestor driver.
  • Loading branch information
Damian-Nordic committed Mar 24, 2022
1 parent 07fc8cd commit 14cc589
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ void AppTask::InitOTARequestor()
#if CONFIG_CHIP_OTA_REQUESTOR
mOTAImageProcessor.SetOTADownloader(&mBDXDownloader);
mBDXDownloader.SetImageProcessorDelegate(&mOTAImageProcessor);
mOTARequestorDriver.Init(&mOTARequestor, &mOTAImageProcessor);
mOTARequestorStorage.Init(chip::Server::GetInstance().GetPersistentStorage());
mOTARequestor.Init(chip::Server::GetInstance(), mOTARequestorStorage, mOTARequestorDriver, mBDXDownloader);
mOTARequestorDriver.Init(&mOTARequestor, &mOTAImageProcessor);
chip::SetRequestorInstance(&mOTARequestor);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ void AppTask::InitOTARequestor()
#if CONFIG_CHIP_OTA_REQUESTOR
sOTAImageProcessor.SetOTADownloader(&sBDXDownloader);
sBDXDownloader.SetImageProcessorDelegate(&sOTAImageProcessor);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage());
sOTARequestor.Init(Server::GetInstance(), sRequestorStorage, sOTARequestorDriver, sBDXDownloader);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
chip::SetRequestorInstance(&sOTARequestor);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ void AppTask::InitOTARequestor()
#if CONFIG_CHIP_OTA_REQUESTOR
sOTAImageProcessor.SetOTADownloader(&sBDXDownloader);
sBDXDownloader.SetImageProcessorDelegate(&sOTAImageProcessor);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
sRequestorStorage.Init(Server::GetInstance().GetPersistentStorage());
sOTARequestor.Init(Server::GetInstance(), sRequestorStorage, sOTARequestorDriver, sBDXDownloader);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
chip::SetRequestorInstance(&sOTARequestor);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ void AppTask::InitOTARequestor()
#if CONFIG_CHIP_OTA_REQUESTOR
sOTAImageProcessor.SetOTADownloader(&sBDXDownloader);
sBDXDownloader.SetImageProcessorDelegate(&sOTAImageProcessor);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
sRequestorStorage.Init(chip::Server::GetInstance().GetPersistentStorage());
sOTARequestor.Init(chip::Server::GetInstance(), sRequestorStorage, sOTARequestorDriver, sBDXDownloader);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
chip::SetRequestorInstance(&sOTARequestor);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-controller-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ void AppTask::InitOTARequestor()
#if CONFIG_CHIP_OTA_REQUESTOR
sOTAImageProcessor.SetOTADownloader(&sBDXDownloader);
sBDXDownloader.SetImageProcessorDelegate(&sOTAImageProcessor);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
sRequestorStorage.Init(chip::Server::GetInstance().GetPersistentStorage());
sOTARequestor.Init(chip::Server::GetInstance(), sRequestorStorage, sOTARequestorDriver, sBDXDownloader);
sOTARequestorDriver.Init(&sOTARequestor, &sOTAImageProcessor);
chip::SetRequestorInstance(&sOTARequestor);
#endif
}
Expand Down

0 comments on commit 14cc589

Please sign in to comment.