30 #if !defined(_Updater_h_) 33 #include "Bootloader.h" 34 #include "SourceFile.h" 39 using namespace blfwk;
48 std::string description;
58 , description(description)
64 value = old_enum.value;
65 description = old_enum.description.c_str();
89 : task_desc(task_desc)
103 typedef std::vector<updater_task_t> updater_task_vector_t;
114 updater_task_vector_t tasks;
115 uint32_t current_task;
120 uint32_t current = 0;
122 for (uint32_t i = 0; i < current_task; ++i)
124 current += tasks[i].total;
127 current += tasks[current_task].current;
135 for (uint32_t i = 0; i < tasks.size(); ++i)
137 total += tasks[i].total;
143 : operation_desc(operation_desc)
146 , user_stopped(
false)
151 : operation_desc(value, description)
154 , user_stopped(
false)
187 void setCallback(progress_callback_t callback) { m_progressCallback = callback; }
194 m_progress.registerCallback(callback, abort);
203 status_t flashFirmware(
const char *filename, uint32_t base_address);
211 void eraseAllUnsecure();
221 void unlock(
string backdoor_key);
231 bool isCommandSupported(
const cmd_t &command);
261 void eraseFlashRegion(uint32_t start, uint32_t length);
267 void eraseFlashAll(uint32_t memoryId);
279 void programOnce(uint32_t index, uint32_t byteCount,
string data);
302 void writeMemory(uint32_t address,
const uchar_vector_t &data);
305 status_t flashFromSourceFile();
308 status_t flashFromSBFile(
const char *filename);
324 #endif // _Updater_h_ SourceFile * m_sourceFile
SourceFile object.
Definition: Updater.h:315
Represents the host bootloader.
Definition: src/blfwk/Bootloader.h:52
Progress m_progress
Progress control.
Definition: Updater.h:317
Definition: BlfwkErrors.h:16
Update class contains the functionality necessary to update the firmware on a device running Bootload...
Definition: Updater.h:167
uint32_t getFlshSize()
get Device's flash size.
Definition: Updater.h:252
uint32_t m_sector_size
Sector size of the flash on the device.
Definition: Updater.h:312
uint32_t m_base_address
Base address of the image.
Definition: Updater.h:311
updater_operation_t m_operation
Struct used to monitor the Operation progress.
Definition: Updater.h:182
uint32_t m_flashSize
The flash size (in bytes) of the device.
Definition: Updater.h:314
Definition: Updater.h:111
Abstract base class for a source file containing executable code.
Definition: src/blfwk/SourceFile.h:56
uint32_t getSectorSize()
get Device's flash sector size.
Definition: Updater.h:248
Discrete, contiguous part of the source's data.
Definition: src/blfwk/DataSource.h:65
Contains the callback function for progress and abort phase.
Definition: Command.h:225
void setCallback(progress_callback_t callback)
Set the user-defined function to call on progress events.
Definition: Updater.h:187
Definition: Command.h:117
uint32_t m_flashStart
Start address of the flash on the device.
Definition: Updater.h:313
void registerCallback(void(*callback)(int, int, int), bool *abort)
Set callback for progress and abort control.
Definition: Updater.h:192
progress_callback_t m_progressCallback
Callback used to report update progress.
Definition: Updater.h:316
Definition: Peripheral.h:60