#include <UpgraderBase.h>
Public Types | |
using | Partition = Storage::Partition |
Public Member Functions | |
virtual | ~UpgraderBase () |
virtual bool | begin (Partition partition, size_t size=0)=0 |
Prepares a partition for an upgrade. The preparation is bootloader and architecture dependent. More... | |
virtual size_t | write (const uint8_t *buffer, size_t size)=0 |
Writes chunk of data to the partition set in begin() . More... | |
virtual bool | end ()=0 |
Finalizes the partition upgrade. More... | |
virtual bool | abort () |
Aborts a partition upgrade. More... | |
virtual bool | setBootPartition (Partition partition, bool save=true)=0 |
Sets the default partition from where the application will be booted on next restart. More... | |
virtual Partition | getBootPartition ()=0 |
Gets information about the partition that is set as the default one to boot. More... | |
virtual Partition | getRunningPartition ()=0 |
Gets information about the partition from which the current application is running. More... | |
virtual Partition | getNextBootPartition (Partition startFrom={})=0 |
Gets the next bootable partition that can be used after successful OTA 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 Attributes | |
static constexpr uint8_t | SLOT_NONE {255} |
Member Typedef Documentation
◆ Partition
Constructor & Destructor Documentation
◆ ~UpgraderBase()
|
inlinevirtual |
Member Function Documentation
◆ abort()
|
inlinevirtual |
Aborts a partition upgrade.
Reimplemented in Ota::IdfUpgrader.
◆ begin()
Prepares a partition for an upgrade. The preparation is bootloader and architecture dependent.
- Parameters
-
partition size
- Return values
-
bool
Implemented in Ota::RbootUpgrader, and Ota::IdfUpgrader.
◆ end()
|
pure virtual |
Finalizes the partition upgrade.
Implemented in Ota::RbootUpgrader, and Ota::IdfUpgrader.
◆ getBootPartition()
|
pure virtual |
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
Implemented in Ota::IdfUpgrader, and Ota::RbootUpgrader.
◆ getBootPartitions()
|
inline |
Gets information about all bootable partitions.
- Return values
-
Storage::Iterator
◆ getNextBootPartition()
Gets the next bootable partition that can be used after successful OTA upgrade.
- Parameters
-
startFrom - optional
- Return values
-
partition
Implemented in Ota::IdfUpgrader, and Ota::RbootUpgrader.
◆ getRunningPartition()
|
pure virtual |
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
Implemented in Ota::IdfUpgrader, and Ota::RbootUpgrader.
◆ getSlot()
Gets slot number for a partition.
- Parameters
-
partition
- Return values
-
uint8_t slot number
◆ setBootPartition()
|
pure virtual |
Sets the default partition from where the application will be booted on next restart.
- Parameters
-
partition save if true the change is persisted on the flash, otherwise it will be valid only for the next boot
- Return values
-
bool
Implemented in Ota::IdfUpgrader, and Ota::RbootUpgrader.
◆ write()
Writes chunk of data to the partition set in begin()
.
- Parameters
-
buffer size
- Return values
-
size_t actually written bytes
Implemented in Ota::RbootUpgrader, and Ota::IdfUpgrader.
Member Data Documentation
◆ SLOT_NONE
|
staticconstexpr |
The documentation for this class was generated from the following file: