OtaUpgrade::Mqtt::PayloadParser Class Referenceabstract
#include <PayloadParser.h>
Inheritance diagram for OtaUpgrade::Mqtt::PayloadParser:
Classes | |
struct | UpdateState |
Public Member Functions | |
PayloadParser (size_t currentPatchVersion, size_t allowedVersionBytes=24) | |
virtual | ~PayloadParser () |
virtual bool | switchRom (const UpdateState &updateState)=0 |
This method is responsible for switching the rom. This method is NOT restarting the system. It will happen lated in the parse method. More... | |
virtual ReadWriteStream * | getStorageStream (size_t storageSize)=0 |
Creates new stream to store the firmware update. More... | |
int | parse (MqttPayloadParserState &state, mqtt_message_t *message, const char *buffer, int length) |
This method takes care to read the incoming MQTT message and pass it to the stream that is responsoble for storing the data. More... | |
Constructor & Destructor Documentation
◆ PayloadParser()
|
inline |
- Parameters
-
currentPatchVersion allowedVersionBytes - maximum allowed bytes to be used for describing a patch version
◆ ~PayloadParser()
|
inlinevirtual |
Member Function Documentation
◆ getStorageStream()
|
pure virtual |
Creates new stream to store the firmware update.
- Parameters
-
size_t storageSize the requested storage size
- Return values
-
ReadWriteStream*
Implemented in OtaUpgrade::Mqtt::StandardPayloadParser, and OtaUpgrade::Mqtt::AdvancedPayloadParser.
◆ parse()
int OtaUpgrade::Mqtt::PayloadParser::parse | ( | MqttPayloadParserState & | state, |
mqtt_message_t * | message, | ||
const char * | buffer, | ||
int | length | ||
) |
This method takes care to read the incoming MQTT message and pass it to the stream that is responsoble for storing the data.
- Return values
-
int 0 when everything is ok <0 when an error has occurred
◆ switchRom()
|
pure virtual |
This method is responsible for switching the rom. This method is NOT restarting the system. It will happen lated in the parse method.
- Return values
-
true if the switch was successful
Implemented in OtaUpgrade::Mqtt::StandardPayloadParser, and OtaUpgrade::Mqtt::AdvancedPayloadParser.
The documentation for this class was generated from the following file: