PicoUpgrader.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * Ota.h
8  *
9  * This header includes all unified Over-The-Air functions.
10  *
11 */
12 
13 #pragma once
14 #include <Ota/UpgraderBase.h>
16 
17 namespace Ota
18 {
22 class PicoUpgrader : public UpgraderBase
23 {
24 public:
25  bool begin(Partition partition, size_t size = 0) override;
26  size_t write(const uint8_t* buffer, size_t size) override;
27  bool end() override;
28  bool setBootPartition(Partition partition, bool save = true) override;
31  Partition getNextBootPartition(Partition startFrom = {}) override;
32 
33 private:
34  Partition partition;
35  std::unique_ptr<Storage::PartitionStream> stream;
36 };
37 
38 } // namespace Ota
RP2350 OTA Upgrader implementation.
Definition: PicoUpgrader.h:23
bool begin(Partition partition, size_t size=0) override
Prepares a partition for an upgrade. The preparation is bootloader and architecture dependent.
Partition getNextBootPartition(Partition startFrom={}) override
Gets the next bootable partition that can be used after successful OTA upgrade.
size_t write(const uint8_t *buffer, size_t size) override
Writes chunk of data to the partition set in begin().
bool setBootPartition(Partition partition, bool save=true) override
Sets the default partition from where the application will be booted on next restart.
bool end() override
Finalizes the partition upgrade.
Partition getBootPartition() override
Gets information about the partition that is set as the default one to boot.
Partition getRunningPartition() override
Gets information about the partition from which the current application is running.
Each supported architecture implements this interface to support OTA updates.
Definition: UpgraderBase.h:23
Storage::Partition Partition
Definition: UpgraderBase.h:27
Represents a flash partition.
Definition: Partition.h:86
Definition: IdfUpgrader.h:18