ThingsBoard Client SDK 0.16.0
Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IUpdater Class Referenceabstract

Updater interface that contains the method that a class that can be used to flash given binary data onto a device has to implement. More...

#include <IUpdater.h>

Inheritance diagram for IUpdater:
[legend]

Public Member Functions

virtual ~IUpdater ()
 Virtual default destructor, created to ensure that if a pointer to this class is used and deleted, we will also call the derived base class destructor. More...
 
virtual bool begin (size_t const &firmware_size)=0
 Initalizes the writing of the given data. More...
 
virtual size_t write (uint8_t *payload, size_t const &total_bytes)=0
 Writes the given amount of bytes of the packet data. More...
 
virtual void reset ()=0
 Resets the writing of the given data so it can be restarted with begin. More...
 
virtual bool end ()=0
 Ends the update and returns wheter it was successfully completed. More...
 

Detailed Description

Updater interface that contains the method that a class that can be used to flash given binary data onto a device has to implement.

Constructor & Destructor Documentation

◆ ~IUpdater()

virtual IUpdater::~IUpdater ( )
inlinevirtual

Virtual default destructor, created to ensure that if a pointer to this class is used and deleted, we will also call the derived base class destructor.

Note
Deleting a base class destructor that does not have a virtual destructor is undefined behaviour, because the derived class destructor originally instantiated with new is never called. This can cause potential memory leaks, because derived classes can not clean up their internal members as expected and instead simply leak them

Member Function Documentation

◆ begin()

virtual bool IUpdater::begin ( size_t const &  firmware_size)
pure virtual

Initalizes the writing of the given data.

Parameters
firmware_sizeTotal size of the data that should be written, is done in multiple packets
Returns
Whether initalizing the update was successful or not

Implemented in SDCard_Updater< Logger >.

◆ end()

virtual bool IUpdater::end ( )
pure virtual

Ends the update and returns wheter it was successfully completed.

Returns
Whether the complete amount of bytes initally given was successfully written or not

Implemented in SDCard_Updater< Logger >.

◆ reset()

virtual void IUpdater::reset ( )
pure virtual

Resets the writing of the given data so it can be restarted with begin.

Implemented in SDCard_Updater< Logger >.

◆ write()

virtual size_t IUpdater::write ( uint8_t payload,
size_t const &  total_bytes 
)
pure virtual

Writes the given amount of bytes of the packet data.

Parameters
payloadFirmware packet data that should be written
total_bytesAmount of bytes in the current firmware packet data
Returns
Total amount of bytes that were successfully written

Implemented in SDCard_Updater< Logger >.


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