AWS IoT Over-the-air Update v3.4.0
Client library for AWS IoT OTA
OTA_Resume

Resume OTA agent operations .

OtaErr_t
The OTA API return status. OTA agent error codes are in the upper 8 bits of the 32 bit OTA error word...
Definition: ota.h:80
OtaErr_t OTA_Resume(void)
Resume OTA agent operations .
Definition: ota.c:3578
Returns
OtaErrNone if successful, otherwise an error code prefixed with 'OtaErr' from the list above.

Example Resume the OTA agent after the network errors are resolved.

bool handleReconnect()
{
// OTA event message used for sending event to OTA Agent.
OtaEventMsg_t eventMsg = { 0 };
bool returnStatus = establishConnection();
if( returnStatus == EXIT_SUCCESS )
{
// Check if OTA process was suspended and resume if required.
if( OTA_GetState() == OtaAgentStateSuspended )
{
// Resume OTA operations.
otaErr = OTA_Resume();
}
else
{
// Send start event to OTA Agent.
OTA_SignalEvent( &eventMsg );
}
if( otaErr != OtaErrNone )
returnStatus = false;
}
return returnStatus;
}
@ OtaAgentEventStart
Start the OTA state machine.
Definition: ota_private.h:348
@ OtaErrUninitialized
The error code has not yet been set by a logic path.
Definition: ota.h:82
@ OtaErrNone
No error occurred during the operation.
Definition: ota.h:81
bool OTA_SignalEvent(const OtaEventMsg_t *const pEventMsg)
Signal event to the OTA Agent task.
Definition: ota.c:3066
OtaState_t OTA_GetState(void)
Get the current state of the OTA agent.
Definition: ota.c:3392
Stores information about the event message.
Definition: ota_private.h:432
OtaEvent_t eventId
Definition: ota_private.h:434