Skip to content

Commit 6cc5fb1

Browse files
[nxp][platform][ota] Add runtime ota reboot delay / Add OTA_ServiceDeInit in AbortAction (project-chip#38056)
* [nxp][platform][ota] Add runtime ota reboot delay / Add OTA_ServiceDeInit in AbortAction Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> * Restyled by clang-format --------- Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 8c3de05 commit 6cc5fb1

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/platform/nxp/common/ota/OTAFirmwareProcessor.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ CHIP_ERROR OTAFirmwareProcessor::ApplyAction()
107107
CHIP_ERROR OTAFirmwareProcessor::AbortAction()
108108
{
109109
OTA_CancelImage();
110+
OTA_ServiceDeInit();
111+
110112
Clear();
111113

112114
return CHIP_NO_ERROR;

src/platform/nxp/common/ota/OTAImageProcessorImpl.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,13 @@ void OTAImageProcessorImpl::HandleApply(intptr_t context)
390390

391391
ConfigurationManagerImpl().StoreSoftwareUpdateCompleted();
392392
PlatformMgr().HandleServerShuttingDown();
393-
394-
// Set the necessary information to inform the SSBL that a new image is available
395-
// and trigger the actual device reboot after some time, to take into account
396-
// queued actions, e.g. sending events to a subscription
393+
/*
394+
* Set the necessary information to inform the SSBL/bootloader that a new image
395+
* is available and trigger the actual device reboot after some time, to take
396+
* into account queued actions, e.g. sending events to a subscription.
397+
*/
397398
SystemLayer().StartTimer(
398-
chip::System::Clock::Milliseconds32(CHIP_DEVICE_LAYER_OTA_REBOOT_DELAY),
399+
chip::System::Clock::Milliseconds32(imageProcessor->mDelayBeforeRebootSec * 1000 + CHIP_DEVICE_LAYER_OTA_REBOOT_DELAY),
399400
[](chip::System::Layer *, void *) { OtaHookReset(); }, nullptr);
400401
}
401402

0 commit comments

Comments
 (0)