|
enum | OtaErr_t {
OtaErrNone = 0
, OtaErrUninitialized
, OtaErrPanic
, OtaErrInvalidArg
,
OtaErrAgentStopped
, OtaErrSignalEventFailed
, OtaErrRequestJobFailed
, OtaErrInitFileTransferFailed
,
OtaErrRequestFileBlockFailed
, OtaErrCleanupControlFailed
, OtaErrCleanupDataFailed
, OtaErrUpdateJobStatusFailed
,
OtaErrJobParserError
, OtaErrInvalidDataProtocol
, OtaErrMomentumAbort
, OtaErrDowngradeNotAllowed
,
OtaErrSameFirmwareVersion
, OtaErrImageStateMismatch
, OtaErrNoActiveJob
, OtaErrUserAbort
,
OtaErrFailedToEncodeCbor
, OtaErrFailedToDecodeCbor
, OtaErrActivateFailed
, OtaErrFileSizeOverflow
} |
| The OTA API return status. OTA agent error codes are in the upper 8 bits of the 32 bit OTA error word, OtaErr_t. More...
|
|
enum | OtaState_t {
OtaAgentStateNoTransition = -1
, OtaAgentStateInit = 0
, OtaAgentStateReady
, OtaAgentStateRequestingJob
,
OtaAgentStateWaitingForJob
, OtaAgentStateCreatingFile
, OtaAgentStateRequestingFileBlock
, OtaAgentStateWaitingForFileBlock
,
OtaAgentStateClosingFile
, OtaAgentStateSuspended
, OtaAgentStateShuttingDown
, OtaAgentStateStopped
,
OtaAgentStateAll
} |
| OTA Agent states. More...
|
|
enum | OtaJobParseErr_t {
OtaJobParseErrUnknown = -1
, OtaJobParseErrNone = 0
, OtaJobParseErrNullJob
, OtaJobParseErrUpdateCurrentJob
,
OtaJobParseErrZeroFileSize
, OtaJobParseErrNonConformingJobDoc
, OtaJobParseErrBadModelInitParams
, OtaJobParseErrNoContextAvailable
,
OtaJobParseErrNoActiveJobs
} |
| OTA job document parser error codes.
|
|
enum | OtaJobEvent_t {
OtaJobEventActivate = 0
, OtaJobEventFail = 1
, OtaJobEventStartTest = 2
, OtaJobEventProcessed = 3
,
OtaJobEventSelfTestFailed = 4
, OtaJobEventParseCustomJob = 5
, OtaJobEventReceivedJob = 6
, OtaJobEventUpdateComplete = 7
,
OtaJobEventNoActiveJob = 8
, OtaLastJobEvent = OtaJobEventStartTest
} |
| OTA Job callback events. More...
|
|
enum | OtaJobStatus_t {
JobStatusInProgress = 0
, JobStatusFailed
, JobStatusSucceeded
, JobStatusRejected
,
JobStatusFailedWithVal
, NumJobStatusMappings
} |
| Gives the status of the job operation.
|
|
enum | OtaHttpStatus_t { OtaHttpSuccess = 0
, OtaHttpInitFailed = 0xc0
, OtaHttpDeinitFailed
, OtaHttpRequestFailed
} |
| The OTA HTTP interface return status. More...
|
|
enum | OtaMqttStatus_t { OtaMqttSuccess = 0
, OtaMqttPublishFailed = 0xa0
, OtaMqttSubscribeFailed
, OtaMqttUnsubscribeFailed
} |
| The OTA MQTT interface return status. More...
|
|
enum | OtaOsStatus_t {
OtaOsSuccess = 0
, OtaOsEventQueueCreateFailed = 0x80U
, OtaOsEventQueueSendFailed
, OtaOsEventQueueReceiveFailed
,
OtaOsEventQueueDeleteFailed
, OtaOsTimerCreateFailed
, OtaOsTimerStartFailed
, OtaOsTimerRestartFailed
,
OtaOsTimerStopFailed
, OtaOsTimerDeleteFailed
} |
| The OTA OS interface return status. More...
|
|
enum | OtaImageState_t {
OtaImageStateUnknown = 0
, OtaImageStateTesting = 1
, OtaImageStateAccepted = 2
, OtaImageStateRejected = 3
,
OtaImageStateAborted = 4
, OtaLastImageState = OtaImageStateAborted
} |
| OTA Image states. More...
|
|
enum | OtaPalImageState_t { OtaPalImageStateUnknown = 0
, OtaPalImageStatePendingCommit
, OtaPalImageStateValid
, OtaPalImageStateInvalid
} |
| OTA Platform Image State. More...
|
|
enum | OtaEvent_t {
OtaAgentEventStart = 0
, OtaAgentEventStartSelfTest
, OtaAgentEventRequestJobDocument
, OtaAgentEventReceivedJobDocument
,
OtaAgentEventCreateFile
, OtaAgentEventRequestFileBlock
, OtaAgentEventReceivedFileBlock
, OtaAgentEventRequestTimer
,
OtaAgentEventCloseFile
, OtaAgentEventSuspend
, OtaAgentEventResume
, OtaAgentEventUserAbort
,
OtaAgentEventShutdown
, OtaAgentEventMax
} |
| OTA Agent Events. More...
|
|
Enumerated types of the OTA library.
OTA Job callback events.
After an OTA update image is received and authenticated, the agent calls the user callback (set with the OTA_Init API) with the value OtaJobEventActivate to signal that the device must be rebooted to activate the new image. When the device boots, if the OTA job status is in self test mode, the agent calls the user callback with the value OtaJobEventStartTest, signaling that any additional self tests should be performed.
If the OTA receive fails for any reason, the agent calls the user callback with the value OtaJobEventFail instead to allow the user to log the failure and take any action deemed appropriate by the user code.
See the OtaImageState_t type for more information.
Enumerator |
---|
OtaJobEventActivate | OTA receive is authenticated and ready to activate.
|
OtaJobEventFail | OTA receive failed. Unable to use this update.
|
OtaJobEventStartTest | OTA job is now in self test, perform user tests.
|
OtaJobEventProcessed | OTA event queued by OTA_SignalEvent is processed.
|
OtaJobEventSelfTestFailed | OTA self-test failed for current job.
|
OtaJobEventParseCustomJob | OTA event for parsing custom job document.
|
OtaJobEventReceivedJob | OTA event when a new valid AFT-OTA job is received.
|
OtaJobEventUpdateComplete | OTA event when the update is completed.
|
OtaJobEventNoActiveJob | OTA event when no active job is pending.
|
OTA Image states.
After an OTA update image is received and authenticated, it is logically moved to the Self Test state by the OTA agent pending final acceptance. After the image is activated and tested by your user code, you should put it into either the Accepted or Rejected state by calling OTA_SetImageState ( OtaImageStateAccepted ) or OTA_SetImageState ( OtaImageStateRejected ). If the image is accepted, it becomes the main firmware image to be booted from then on. If it is rejected, the image is no longer valid and shall not be used, reverting to the last known good image.
If you want to abort an active OTA transfer, you may do so by calling the API OTA_SetImageState ( OtaImageStateAborted ).
Enumerator |
---|
OtaImageStateUnknown | The initial state of the OTA MCU Image.
|
OtaImageStateTesting | The state of the OTA MCU Image post successful download and reboot.
|
OtaImageStateAccepted | The state of the OTA MCU Image post successful download and successful self_test.
|
OtaImageStateRejected | The state of the OTA MCU Image when the job has been rejected.
|
OtaImageStateAborted | The state of the OTA MCU Image after a timeout publish to the stream request fails. Also if the OTA MCU image is aborted in the middle of a stream.
|