AWS IoT for ESP32 v1.0.0
An ESP-IDF based solution
lib_ota.h
Go to the documentation of this file.
1/*******************************************************************************
2* Copyright (c) 2021, Buildstorm Pvt Ltd
3*
4* Filename: lib_ota.h
5*
6* Author: Amruta
7* email: amruta@buildstorm.com
8*
9* Description:
10* Contains wrapper functions to handle OTA functionalities.
11*******************************************************************************/
12
18#ifndef _LIB_OTA_H_
19#define _LIB_OTA_H_
20
21/* Includes ------------------------------------------------------------------*/
22#include "esp_err.h"
23#include "stdutils.h"
24
25// TODO: update the library using new apis. refer esp-idf ota example
26
31typedef enum
32{
45
50typedef enum
51{
57
58/*---------------------------structures-------------------------------------*/
59
63typedef struct
64{
65 esp_err_t error;
69
70/* Function declarations ----------------------------------------------------*/
71
79bool OTA_start(firmUpdateType_et updateType_e);
80
87
96
103
104#endif
void OTA_printStatus()
Prints the status of OTA.
uint8_t OTA_getProgressPercentage()
Get OTA progress in percentage.
flashOtaStatus_et
Definition: lib_ota.h:32
@ OTA_STATUS_READY
Definition: lib_ota.h:33
@ OTA_STATUS_END_FAILED
Definition: lib_ota.h:38
@ OTA_STATUS_SUCCESS
Definition: lib_ota.h:34
@ OTA_STATUS_MAX
Definition: lib_ota.h:43
@ OTA_STATUS_BEGIN_FAILED
Definition: lib_ota.h:36
@ OTA_STATUS_DOWNLOAD_FAILED
Definition: lib_ota.h:41
@ OTA_STATUS_WRITE_FAILED
Definition: lib_ota.h:37
@ OTA_STATUS_SET_PARTITION_FAILED
Definition: lib_ota.h:39
@ OTA_STATUS_GET_PARTITION_FAILED
Definition: lib_ota.h:35
@ OTA_STATUS_TIMEDOUT
Definition: lib_ota.h:40
@ OTA_STATUS_FAILED_UNKOWN_REASON
Definition: lib_ota.h:42
bool OTA_inProgress()
Check if OTA is in progress.
firmUpdateType_et
Definition: lib_ota.h:51
@ OTA_UPDATE_TYPE_NONE
Definition: lib_ota.h:52
@ OTA_UPDATE_TYPE_MAX
Definition: lib_ota.h:55
@ OTA_UPDATE_TYPE_WEB
Definition: lib_ota.h:54
@ OTA_UPDATE_TYPE_LOCAL
Definition: lib_ota.h:53
bool OTA_start(firmUpdateType_et updateType_e)
Start OTA firmware update process.
OTA status.
Definition: lib_ota.h:64
flashOtaStatus_et status_e
Definition: lib_ota.h:66
esp_err_t error
Definition: lib_ota.h:65
uint8_t previousPartition_u8
Definition: lib_ota.h:67