ESP8266 rBoot OTA Upgrader implementation. More...

#include <RbootUpgrader.h>

Inheritance diagram for Ota::RbootUpgrader:
Collaboration diagram for Ota::RbootUpgrader:

Public Member Functions

bool begin (Partition partition, size_t size=0) override
 Prepare the partition for. 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 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 ()
 
virtual bool abort ()
 Aborts a partition upgrade. More...
 
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 uint8_t getSlotForPartition (Partition partition)
 
static Partition getPartitionForSlot (uint8_t slot)
 

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

ESP8266 rBoot OTA Upgrader implementation.

Member Function Documentation

◆ begin()

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

Prepare the partition for.

Implements Ota::UpgraderBase.

◆ end()

bool Ota::RbootUpgrader::end ( )
inlineoverridevirtual

Finalizes the partition upgrade.

Implements Ota::UpgraderBase.

◆ getBootPartition()

Partition Ota::RbootUpgrader::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::RbootUpgrader::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.

◆ getPartitionForSlot()

static Partition Ota::RbootUpgrader::getPartitionForSlot ( uint8_t  slot)
inlinestatic

◆ getRunningPartition()

Partition Ota::RbootUpgrader::getRunningPartition ( )
overridevirtual

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.

◆ getSlotForPartition()

static uint8_t Ota::RbootUpgrader::getSlotForPartition ( Partition  partition)
inlinestatic

◆ setBootPartition()

bool Ota::RbootUpgrader::setBootPartition ( Partition  partition,
bool  save = true 
)
overridevirtual

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::RbootUpgrader::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: