ESP32 OTA Upgrader implementation. More...

#include <IdfUpgrader.h>

Inheritance diagram for Ota::IdfUpgrader:
Collaboration diagram for Ota::IdfUpgrader:

Public Member Functions

bool begin (Partition partition, size_t size=0) override
 Prepares a partition for an upgrade. The preparation is bootloader and architecture dependent. More...
 
size_t write (const uint8_t *buffer, size_t size) override
 Writes chunk of data to the partition set in begin(). More...
 
bool end () override
 Finalizes the partition upgrade. More...
 
bool abort () override
 Aborts a partition upgrade. More...
 
bool setBootPartition (Partition partition, bool save=true) override
 Sets the default partition from where the application will be booted on next restart. More...
 
Partition getBootPartition () override
 Gets information about the partition that is set as the default one to boot. More...
 
Partition getRunningPartition () override
 Gets information about the partition from which the current application is running. More...
 
Partition getNextBootPartition (Partition startFrom={}) override
 Gets the next bootable partition that can be used after successful OTA upgrade. More...
 
- Public Member Functions inherited from Ota::UpgraderBase
virtual ~UpgraderBase ()
 
Storage::Iterator getBootPartitions ()
 Gets information about all bootable partitions. More...
 
uint8_t getSlot (Partition partition)
 Gets slot number for a partition. More...
 

Static Public Member Functions

static const esp_partition_t * convertToIdfPartition (Partition partition)
 
static Partition convertFromIdfPartition (const esp_partition_t *partition)
 

Additional Inherited Members

- Public Types inherited from Ota::UpgraderBase
using Partition = Storage::Partition
 
- Static Public Attributes inherited from Ota::UpgraderBase
static constexpr uint8_t SLOT_NONE {255}
 

Detailed Description

ESP32 OTA Upgrader implementation.

Member Function Documentation

◆ abort()

bool Ota::IdfUpgrader::abort ( )
inlineoverridevirtual

Aborts a partition upgrade.

Reimplemented from Ota::UpgraderBase.

◆ begin()

bool Ota::IdfUpgrader::begin ( Partition  partition,
size_t  size = 0 
)
overridevirtual

Prepares a partition for an upgrade. The preparation is bootloader and architecture dependent.

Parameters
partition
size
Return values
bool

Implements Ota::UpgraderBase.

◆ convertFromIdfPartition()

static Partition Ota::IdfUpgrader::convertFromIdfPartition ( const esp_partition_t *  partition)
inlinestatic

◆ convertToIdfPartition()

static const esp_partition_t* Ota::IdfUpgrader::convertToIdfPartition ( Partition  partition)
inlinestatic

◆ end()

bool Ota::IdfUpgrader::end ( )
inlineoverridevirtual

Finalizes the partition upgrade.

Implements Ota::UpgraderBase.

◆ getBootPartition()

Partition Ota::IdfUpgrader::getBootPartition ( )
inlineoverridevirtual

Gets information about the partition that is set as the default one to boot.

Note
The returned partition can be different than the current running partition.
Return values
partition

Implements Ota::UpgraderBase.

◆ getNextBootPartition()

Partition Ota::IdfUpgrader::getNextBootPartition ( Partition  startFrom = {})
inlineoverridevirtual

Gets the next bootable partition that can be used after successful OTA upgrade.

Parameters
startFrom- optional
Return values
partition

Implements Ota::UpgraderBase.

◆ getRunningPartition()

Partition Ota::IdfUpgrader::getRunningPartition ( )
inlineoverridevirtual

Gets information about the partition from which the current application is running.

Note
The returned partition can be different than the default boot partition.
Return values
partition

Implements Ota::UpgraderBase.

◆ setBootPartition()

bool Ota::IdfUpgrader::setBootPartition ( Partition  partition,
bool  save = true 
)
inlineoverridevirtual

Sets the default partition from where the application will be booted on next restart.

Parameters
partition
saveif true the change is persisted on the flash, otherwise it will be valid only for the next boot
Return values
bool

Implements Ota::UpgraderBase.

◆ write()

size_t Ota::IdfUpgrader::write ( const uint8_t *  buffer,
size_t  size 
)
overridevirtual

Writes chunk of data to the partition set in begin().

Parameters
buffer
size
Return values
size_tactually written bytes

Implements Ota::UpgraderBase.


The documentation for this class was generated from the following file: