AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_ota.h File Reference

OTA library header file. More...

Go to the source code of this file.

Data Structures

struct  otaStatus_st
 OTA status. More...
 

Enumerations

enum  flashOtaStatus_et {
  OTA_STATUS_READY , OTA_STATUS_SUCCESS , OTA_STATUS_GET_PARTITION_FAILED , OTA_STATUS_BEGIN_FAILED ,
  OTA_STATUS_WRITE_FAILED , OTA_STATUS_END_FAILED , OTA_STATUS_SET_PARTITION_FAILED , OTA_STATUS_TIMEDOUT ,
  OTA_STATUS_DOWNLOAD_FAILED , OTA_STATUS_FAILED_UNKOWN_REASON , OTA_STATUS_MAX
}
 
enum  firmUpdateType_et { OTA_UPDATE_TYPE_NONE , OTA_UPDATE_TYPE_LOCAL , OTA_UPDATE_TYPE_WEB , OTA_UPDATE_TYPE_MAX }
 

Functions

bool OTA_start (firmUpdateType_et updateType_e)
 Start OTA firmware update process. More...
 
uint8_t OTA_getProgressPercentage ()
 Get OTA progress in percentage. More...
 
bool OTA_inProgress ()
 Check if OTA is in progress. More...
 
void OTA_printStatus ()
 Prints the status of OTA. More...
 

Detailed Description

OTA library header file.

Enumeration Type Documentation

◆ firmUpdateType_et

Types of supported firmware updates.

Enumerator
OTA_UPDATE_TYPE_NONE 

None

OTA_UPDATE_TYPE_LOCAL 

Perform local update

OTA_UPDATE_TYPE_WEB 

Perform web update

OTA_UPDATE_TYPE_MAX 

Total number of firmware update types

◆ flashOtaStatus_et

An enum to represent OTA status.

Enumerator
OTA_STATUS_READY 

Ready status

OTA_STATUS_SUCCESS 

OTA was successful

OTA_STATUS_GET_PARTITION_FAILED 

Failed to get partition

OTA_STATUS_BEGIN_FAILED 

Failed to start OTA

OTA_STATUS_WRITE_FAILED 

Failed to write OTA packets

OTA_STATUS_END_FAILED 

Failed to end OTA process

OTA_STATUS_SET_PARTITION_FAILED 

Failed to set boot parition after OTA

OTA_STATUS_TIMEDOUT 

OTA process timedout

OTA_STATUS_DOWNLOAD_FAILED 

OTA file download failed

OTA_STATUS_FAILED_UNKOWN_REASON 

OTA failed with unknown error

OTA_STATUS_MAX 

Total number of OTA status

Function Documentation

◆ OTA_getProgressPercentage()

uint8_t OTA_getProgressPercentage ( )

Get OTA progress in percentage.

Parameters
none
Returns
Progress value in percentage.

◆ OTA_inProgress()

bool OTA_inProgress ( )

Check if OTA is in progress.

Parameters
none
Returns
Status to indicate if OTA is in progress
Return values
trueif in progress
falseif not in progress

◆ OTA_printStatus()

void OTA_printStatus ( )

Prints the status of OTA.

Parameters
none
Returns
none

◆ OTA_start()

bool OTA_start ( firmUpdateType_et  updateType_e)

Start OTA firmware update process.

Parameters
[in]updateType_etype of update
Returns
status of OTA start request
Return values
trueon success
falseon failure