1#ifndef VITROIO_SDK_UPGRADE_CONTROLLER_H
2#define VITROIO_SDK_UPGRADE_CONTROLLER_H
31#define VITROIO_UPGRADE_CONTROLLER_DEFAULT_EVENT_QUEUE_SIZE 32
68 EventQueue* eventQueue
113 static SegmentDecoder* create(
const uint8_t* data, uint32_t size);
118 uint32_t segmentsCount();
120 const uint8_t* data()
const;
123 bool setBuffer(
const uint8_t* data, uint32_t size);
125 static uint32_t allocated();
126 static uint32_t deleted();
131 static const uint8_t dataOffset_ = 4;
132 static uint32_t allocated_;
133 static uint32_t deleted_;
146 EventQueue* eventQueue_;
149 uint32_t nextSegment_;
152 uint32_t flashedBytes_;
153 bool upgradeProcessRunning_;
154 bool breakIncorrectUpdate;
159 Queue<SegmentDecoder, 64> segmentsToProcessQueue_;
160 Queue<SegmentDecoder, 64> notUsedSegmentsQueue_;
162 void processSegments();
163 bool processSegment(SegmentDecoder* sd);
167 bool writeSectorBufferToFlash();
173 void setSegmentNotUsed(SegmentDecoder* segment);
178 SegmentDecoder* getNotUsedSegment();
184 bool setSegmentToProcess(SegmentDecoder* segment);
190 SegmentDecoder* getSegmentToProcess();
Class is a wrapper for mbed::FlashIAP module.
Definition: flash_interface.h:26
Class is responsible for handling upgrade data.
Definition: upgrade_controller.h:39
bool isValid() const
Function allows to check whether the controller is in valid state.
void processData(const uint8_t *data, uint32_t size)
Function processes upgrade data.
void configure(FlashSpace flashSpace)
Function configures the controller.
Callback< void()> OnNewFirmwareAvailableCallback
Type defines signature of the callback function which is to be called when the new firmware will be a...
Definition: upgrade_controller.h:45
~UpgradeController()
Destructor.
UpgradeController(FlashInterface *flash, FirmwareId fwId, Version fwVersion, OnNewFirmwareAvailableCallback callback, EventQueue *eventQueue)
Constructor.
The namespace contains all of components of vitro-shard-sdk and components based on the sdk....
Definition: can_layer.h:9
Structure representing space of flash memory.
Definition: types.h:79
Structure representing version in format major.minor.patch.
Definition: types.h:47
The file contains types used by vitro-shard-sdk.