VitroIO SDK
Software development kit for Vitro Shard.
|
Class is responsible for handling upgrade data. More...
#include <upgrade_controller.h>
Public Types | |
typedef Callback< void()> | OnNewFirmwareAvailableCallback |
Type defines signature of the callback function which is to be called when the new firmware will be available. More... | |
Public Member Functions | |
UpgradeController (FlashInterface *flash, FirmwareId fwId, Version fwVersion, OnNewFirmwareAvailableCallback callback, EventQueue *eventQueue) | |
Constructor. More... | |
~UpgradeController () | |
Destructor. More... | |
bool | isValid () const |
Function allows to check whether the controller is in valid state. More... | |
void | configure (FlashSpace flashSpace) |
Function configures the controller. More... | |
void | processData (const uint8_t *data, uint32_t size) |
Function processes upgrade data. More... | |
Class is responsible for handling upgrade data.
typedef Callback<void()> vitroio::sdk::impl::UpgradeController::OnNewFirmwareAvailableCallback |
Type defines signature of the callback function which is to be called when the new firmware will be available.
|
explicit |
Constructor.
@detials There is not guarantee that the object is in valid state. User should call isValid() method to determine if the object was initialized successfully. When the object is in invalid state, the behaviour is undefined.
flash | Pointer to FlashInterface object |
fwId | id if firmware |
fwVersion | Current firmware version |
callback | Callback that is to be called when new firmware is available |
eventQueue | External event queue for storing controller events |
vitroio::sdk::impl::UpgradeController::~UpgradeController | ( | ) |
Destructor.
void vitroio::sdk::impl::UpgradeController::configure | ( | FlashSpace | flashSpace | ) |
Function configures the controller.
Function allows to set parameters that can be not known during instantiation of the controller. The controller must be configured before usage.
flashSpace | Specifies flash memory space for a new firmware |
bool vitroio::sdk::impl::UpgradeController::isValid | ( | ) | const |
Function allows to check whether the controller is in valid state.
void vitroio::sdk::impl::UpgradeController::processData | ( | const uint8_t * | data, |
uint32_t | size | ||
) |
Function processes upgrade data.
data | Pointer to buffer with new upgrade data |
size | Size of buffer with upgrade data |