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 ReadWriteStreamgetStorageStream (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()

OtaUpgrade::Mqtt::PayloadParser::PayloadParser ( size_t  currentPatchVersion,
size_t  allowedVersionBytes = 24 
)
inline
Parameters
currentPatchVersion
allowedVersionBytes- maximum allowed bytes to be used for describing a patch version

◆ ~PayloadParser()

virtual OtaUpgrade::Mqtt::PayloadParser::~PayloadParser ( )
inlinevirtual

Member Function Documentation

◆ getStorageStream()

virtual ReadWriteStream* OtaUpgrade::Mqtt::PayloadParser::getStorageStream ( size_t  storageSize)
pure virtual

Creates new stream to store the firmware update.

Parameters
size_tstorageSize 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
int0 when everything is ok <0 when an error has occurred

◆ switchRom()

virtual bool OtaUpgrade::Mqtt::PayloadParser::switchRom ( const UpdateState updateState)
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
trueif the switch was successful

Implemented in OtaUpgrade::Mqtt::StandardPayloadParser, and OtaUpgrade::Mqtt::AdvancedPayloadParser.


The documentation for this class was generated from the following file: