StandardPayloadParser.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  * StandardPayloadParser.h
8  *
9  * Created: 2021 - Slavey Karadzhov <slav@attachix.com>
10  *
11  ****/
12 
13 #pragma once
14 
15 #include "PayloadParser.h"
16 #include <Storage/Partition.h>
17 
18 namespace OtaUpgrade
19 {
20 namespace Mqtt
21 {
27 {
28 public:
29  StandardPayloadParser(Storage::Partition part, size_t currentVersion, size_t allowedVersionBytes = 24)
30  : PayloadParser(currentVersion, allowedVersionBytes), part(part)
31  {
32  }
33 
34  bool switchRom(const UpdateState& updateState) override;
35 
36  ReadWriteStream* getStorageStream(size_t storageSize) override;
37 
38 private:
39  Storage::Partition part;
40 };
41 
42 } // namespace Mqtt
43 } // namespace OtaUpgrade
Definition: PayloadParser.h:31
This parser allows the processing of firmware data that is directly stored to the flash memory using ...
Definition: StandardPayloadParser.h:27
ReadWriteStream * getStorageStream(size_t storageSize) override
Creates new stream to store the firmware update.
bool switchRom(const UpdateState &updateState) override
This method is responsible for switching the rom. This method is NOT restarting the system....
StandardPayloadParser(Storage::Partition part, size_t currentVersion, size_t allowedVersionBytes=24)
Definition: StandardPayloadParser.h:29
Base class for read/write stream.
Definition: ReadWriteStream.h:20
Represents a flash partition.
Definition: Partition.h:86
Definition: BasicStream.h:24
Definition: PayloadParser.h:33