31 #ifndef _AWS_OTA_AGENT_H_ 32 #define _AWS_OTA_AGENT_H_ 35 #include "aws_ota_types.h" 42 #include "aws_logging_task.h" 45 #define CONST_STRLEN( s ) ( ( ( uint32_t ) sizeof( s ) ) - 1UL ) 48 #define OTA_FILE_SIG_KEY_STR_MAX_LENGTH 32 49 extern const char pcOTA_JSON_FileSignatureKey[ OTA_FILE_SIG_KEY_STR_MAX_LENGTH ];
54 #define OTA_DEBUG_LOG_LEVEL 1 55 #if OTA_DEBUG_LOG_LEVEL >= 1 56 #define DEFINE_OTA_METHOD_NAME(name) static const char OTA_METHOD_NAME[] = name; 57 #define OTA_LOG_L1 vLoggingPrintf 59 #define DEFINE_OTA_METHOD_NAME(name) 60 #define OTA_LOG_L1(...) 62 #if OTA_DEBUG_LOG_LEVEL >= 2 63 #define DEFINE_OTA_METHOD_NAME_L2(name) static const char OTA_METHOD_NAME[] = name; 64 #define OTA_LOG_L2 vLoggingPrintf 66 #define DEFINE_OTA_METHOD_NAME_L2(name) 67 #define OTA_LOG_L2(...) 69 #if OTA_DEBUG_LOG_LEVEL >= 3 70 #define DEFINE_OTA_METHOD_NAME_L3(name) static const char OTA_METHOD_NAME[] = name; 71 #define OTA_LOG_L3 vLoggingPrintf 73 #define DEFINE_OTA_METHOD_NAME_L3(name) 74 #define OTA_LOG_L3(...) 90 eOTA_NumAgentStates = 4
95 #define kOTA_MaxSignatureSize 256 99 uint8_t ucData[kOTA_MaxSignatureSize];
115 #define kOTA_PAL_ErrMask 0xffffffUL 116 #define kOTA_Main_ErrMask 0xff000000UL 117 #define kOTA_MainErrShiftDownBits 24U 125 #define kOTA_Err_Panic 0xfe000000UL 126 #define kOTA_Err_Uninitialized 0xff000000UL 127 #define kOTA_Err_None 0x00000000UL 128 #define kOTA_Err_SignatureCheckFailed 0x01000000UL 129 #define kOTA_Err_BadSignerCert 0x02000000UL 130 #define kOTA_Err_OutOfMemory 0x03000000UL 131 #define kOTA_Err_ActivateFailed 0x04000000UL 132 #define kOTA_Err_CommitFailed 0x05000000UL 133 #define kOTA_Err_RejectFailed 0x06000000UL 134 #define kOTA_Err_AbortFailed 0x07000000UL 135 #define kOTA_Err_PublishFailed 0x08000000UL 136 #define kOTA_Err_BadImageState 0x09000000UL 137 #define kOTA_Err_NoActiveJob 0x0a000000UL 138 #define kOTA_Err_NoFreeContext 0x0b000000UL 139 #define kOTA_Err_FileAbort 0x10000000UL 140 #define kOTA_Err_FileClose 0x11000000UL 141 #define kOTA_Err_RxFileCreateFailed 0x12000000UL 142 #define kOTA_Err_BootInfoCreateFailed 0x13000000UL 143 #define kOTA_Err_RxFileTooLarge 0x14000000UL 144 #define kOTA_Err_NullFilePtr 0x20000000UL 145 #define kOTA_Err_MomentumAbort 0x21000000UL 146 #define kOTA_Err_DowngradeNotAllowed 0x22000000UL 147 #define kOTA_Err_SameFirmwareVersion 0x23000000UL 148 #define kOTA_Err_JobParserError 0x24000000UL 149 #define kOTA_Err_FailedToEncodeCBOR 0x25000000UL 150 #define kOTA_Err_ImageStateMismatch 0x26000000UL 151 #define kOTA_Err_GenericIngestError 0x27000000UL 152 #define kOTA_Err_UserAbort 0x28000000UL 153 #define kOTA_Err_ResetNotSupported 0x29000000UL 154 #define kOTA_Err_TopicTooLarge 0x2a000000UL OTA_State_t
OTA Agent states.
uint32_t OTA_Err_t
OTA Error type.
uint8_t * pacRxBlockBitmap
uint32_t OTA_GetPacketsQueued(void)
Get the number of OTA message packets queued by the OTA agent.
OTA_ImageState_t
OTA Image states.
OTA_JobEvent_t
OTA Job callback events.
OTA_ImageState_t OTA_GetImageState(void)
Get the state of the currently running MCU image.
uint32_t OTA_GetPacketsProcessed(void)
Get the number of OTA message packets processed by the OTA agent.
OTA File Context Information.
OTA_State_t OTA_AgentShutdown(TickType_t xTicksToWait)
Signal to the OTA Agent to shut down.
uint8_t * pacCertFilepath
OTA_State_t OTA_GetAgentState(void)
Get the current state of the OTA agent.
uint32_t ulBlocksRemaining
uint32_t ulUpdaterVersion
OTA_Err_t OTA_SetImageState(OTA_ImageState_t eState)
Set the state of the current MCU image.
OTA_Err_t OTA_ActivateNewImage(void)
Activate the newest MCU image received via OTA.
uint32_t ulRequestMomentum
void(* pxOTACompleteCallback_t)(OTA_JobEvent_t eEvent)
OTA update complete callback function typedef.
OTA_State_t OTA_AgentInit(void *pvClient, const uint8_t *pcThingName, pxOTACompleteCallback_t xFunc, TickType_t xTicksToWait)
OTA Agent initialization function.
uint32_t OTA_GetPacketsDropped(void)
Get the number of OTA message packets dropped by the OTA agent.
uint32_t ulFileAttributes
uint32_t OTA_GetPacketsReceived(void)
Get the number of OTA message packets received by the OTA agent.
TimerHandle_t pvRequestTimer