AWS IoT Over-the-air Update v3.3.0
Client library for AWS IoT OTA
ota_os_interface.h File Reference

Contains OTA OS Functional Interface statuses, type definitions and structures to store interface routines. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  OtaEventInterface_t
 
struct  OtaTimerInterface_t
 OTA Retry Timer Interface. More...
 
struct  OtaMallocInterface_t
 OTA memory allocation interface. More...
 
struct  OtaOSInterface_t
 OTA OS Interface. More...
 

Typedefs

typedef struct OtaEventContext OtaEventContext_t
 Type definition for Event Context.
 
typedef OtaOsStatus_t(* OtaInitEvent_t) (OtaEventContext_t *pEventCtx)
 Initialize the OTA events. More...
 
typedef OtaOsStatus_t(* OtaSendEvent_t) (OtaEventContext_t *pEventCtx, const void *pEventMsg, unsigned int timeout)
 Sends an OTA event. More...
 
typedef OtaOsStatus_t(* OtaReceiveEvent_t) (OtaEventContext_t *pEventCtx, void *pEventMsg, uint32_t timeout)
 Receive an OTA event. More...
 
typedef OtaOsStatus_t(* OtaDeinitEvent_t) (OtaEventContext_t *pEventCtx)
 Deinitialize the OTA Events mechanism. More...
 
typedef void(* OtaTimerCallback_t) (OtaTimerId_t otaTimerId)
 Timer callback. More...
 
typedef OtaOsStatus_t(* OtaStartTimer_t) (OtaTimerId_t otaTimerId, const char *const pTimerName, const uint32_t timeout, OtaTimerCallback_t callback)
 Start timer. More...
 
typedef OtaOsStatus_t(* OtaStopTimer_t) (OtaTimerId_t otaTimerId)
 Stop timer. More...
 
typedef OtaOsStatus_t(* OtaDeleteTimer_t) (OtaTimerId_t otaTimerId)
 Delete a timer. More...
 
typedef void *(* OtaMalloc_t) (size_t size)
 Allocate memory. More...
 
typedef void(* OtaFree_t) (void *ptr)
 Free memory. More...
 

Enumerations

enum  OtaTimerId_t { OtaRequestTimer = 0 , OtaSelfTestTimer , OtaNumOfTimers }
 Enumeration for tracking multiple timers.
 
enum  OtaOsStatus_t {
  OtaOsSuccess = 0 , OtaOsEventQueueCreateFailed = 0x80U , OtaOsEventQueueSendFailed , OtaOsEventQueueReceiveFailed ,
  OtaOsEventQueueDeleteFailed , OtaOsTimerCreateFailed , OtaOsTimerStartFailed , OtaOsTimerRestartFailed ,
  OtaOsTimerStopFailed , OtaOsTimerDeleteFailed
}
 The OTA OS interface return status. More...
 

Detailed Description

Contains OTA OS Functional Interface statuses, type definitions and structures to store interface routines.

Typedef Documentation

◆ OtaInitEvent_t

typedef OtaOsStatus_t(* OtaInitEvent_t) (OtaEventContext_t *pEventCtx)

Initialize the OTA events.

This function initializes the OTA events mechanism.

Parameters
[pEventCtx]Pointer to the OTA event context.
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaSendEvent_t

typedef OtaOsStatus_t(* OtaSendEvent_t) (OtaEventContext_t *pEventCtx, const void *pEventMsg, unsigned int timeout)

Sends an OTA event.

This function sends an event to OTA library event handler.

Parameters
[pEventCtx]Pointer to the OTA event context.
[pEventMsg]Event to be sent to the OTA handler.
[timeout]The maximum amount of time (msec) the task should block.
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaReceiveEvent_t

typedef OtaOsStatus_t(* OtaReceiveEvent_t) (OtaEventContext_t *pEventCtx, void *pEventMsg, uint32_t timeout)

Receive an OTA event.

This function receives next event from the pending OTA events.

Parameters
[pEventCtx]Pointer to the OTA event context.
[pEventMsg]Pointer to store message.
[timeout]The maximum amount of time the task should block.
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaDeinitEvent_t

typedef OtaOsStatus_t(* OtaDeinitEvent_t) (OtaEventContext_t *pEventCtx)

Deinitialize the OTA Events mechanism.

This function deinitialize the OTA events mechanism and frees any resources used.

Parameters
[pEventCtx]Pointer to the OTA event context.
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaTimerCallback_t

typedef void(* OtaTimerCallback_t) (OtaTimerId_t otaTimerId)

Timer callback.

Type definition for timer callback.

Parameters
[otaTimerId]Timer ID of type otaTimerId_t
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaStartTimer_t

typedef OtaOsStatus_t(* OtaStartTimer_t) (OtaTimerId_t otaTimerId, const char *const pTimerName, const uint32_t timeout, OtaTimerCallback_t callback)

Start timer.

This function starts the timer or resets it if it has already started.

Parameters
[otaTimerId]Timer ID of type otaTimerId_t
[pTimerName]Timer name.
[timeout]Timeout for the timer in milliseconds.
[callback]Callback to be called when timer expires.
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaStopTimer_t

typedef OtaOsStatus_t(* OtaStopTimer_t) (OtaTimerId_t otaTimerId)

Stop timer.

This function stops the time.

Parameters
[otaTimerId]Timer ID of type otaTimerId_t
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaDeleteTimer_t

typedef OtaOsStatus_t(* OtaDeleteTimer_t) (OtaTimerId_t otaTimerId)

Delete a timer.

This function deletes a timer.

Parameters
[otaTimerId]Timer ID of type otaTimerId_t
Returns
OtaOsStatus_t, OtaOsSuccess if success , other error code on failure.

◆ OtaMalloc_t

typedef void *(* OtaMalloc_t) (size_t size)

Allocate memory.

This function allocates the requested memory and returns a pointer to it.

Parameters
[size]This is the size of the memory block, in bytes..
Returns
This function returns a pointer to the allocated memory, or NULL if the request fails.

◆ OtaFree_t

typedef void(* OtaFree_t) (void *ptr)

Free memory.

This function deallocates the memory previously allocated by a call to allocation function of type OtaMalloc_t.

Parameters
[ptr]This is the pointer to a memory block previously allocated with function of type OtaMalloc_t. If a null pointer is passed as argument, no action occurs.
Returns
None.