Skip to content

Commit b8c152f

Browse files
[nxp][platform][ota] Add runtime ota reboot delay / Add OTA_ServiceDeInit in AbortAction
Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
1 parent 132a7a8 commit b8c152f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-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

+7-5
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,14 @@ 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
400+
+ CHIP_DEVICE_LAYER_OTA_REBOOT_DELAY),
399401
[](chip::System::Layer *, void *) { OtaHookReset(); }, nullptr);
400402
}
401403

0 commit comments

Comments
 (0)