PayloadParser.h
Go to the documentation of this file.
46 {
47 }
50 {
76 int parse(MqttPayloadParserState& state, mqtt_message_t* message, const char* buffer, int length);
virtual bool switchRom(const UpdateState &updateState)=0
This method is responsible for switching the rom. This method is NOT restarting the system....
virtual ~PayloadParser()
Definition: PayloadParser.h:69
Definition: BasicStream.h:23
Definition: MqttPayloadParser.h:29
std::unique_ptr< ReadWriteStream > stream
Definition: PayloadParser.h:54
constexpr int8_t ERROR_INVALID_PATCH_VERSION
Definition: PayloadParser.h:47
virtual ReadWriteStream * getStorageStream(size_t storageSize)=0
Creates new stream to store the firmware update.
PayloadParser(size_t currentPatchVersion, size_t allowedVersionBytes=24)
Definition: PayloadParser.h:64
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 responsobl...
constexpr int8_t ERROR_UNKNOWN_REASON
Definition: PayloadParser.h:48
constexpr int8_t ERROR_INVALID_MQTT_MESSAGE
Definition: PayloadParser.h:46