Firmware updater: Add support for l10n firmware images

This commit is contained in:
Vojtech Kral 2018-06-19 11:16:56 +02:00 committed by bubnikv
parent 15f943938b
commit 635bb1e484
4 changed files with 156 additions and 78 deletions

View file

@ -15,20 +15,20 @@ public:
typedef std::function<void()> RunFn;
typedef std::function<void(const char * /* msg */, unsigned /* size */)> MessageFn;
typedef std::function<void(const char * /* task */, unsigned /* progress */)> ProgressFn;
typedef std::function<void(int /* exit status */)> CompleteFn;
typedef std::function<void(int /* exit status */, size_t /* args_id */)> CompleteFn;
AvrDude();
// Main c-tor, sys_config is the location of avrdude's main configuration file
AvrDude(std::string sys_config);
AvrDude(AvrDude &&);
AvrDude(const AvrDude &) = delete;
AvrDude &operator=(AvrDude &&) = delete;
AvrDude &operator=(const AvrDude &) = delete;
~AvrDude();
// Set location of avrdude's main configuration file
AvrDude& sys_config(std::string sys_config);
// Set avrdude cli arguments
AvrDude& args(std::vector<std::string> args);
// Push a set of avrdude cli arguments
// Each set makes one avrdude invocation - use this method multiple times to push
// more than one avrdude invocations.
AvrDude& push_args(std::vector<std::string> args);
// Set a callback to be called just after run() before avrdude is ran
// This can be used to perform any needed setup tasks from the background thread.
@ -42,7 +42,10 @@ public:
// Progress is reported per each task (reading / writing) in percents.
AvrDude& on_progress(ProgressFn fn);
// Called when avrdude's main function finishes
// Called when the last avrdude invocation finishes with the exit status of zero,
// or earlier, if one of the invocations return a non-zero status.
// The second argument contains the sequential id of the last avrdude invocation argument set.
// This has no effect when using run_sync().
AvrDude& on_complete(CompleteFn fn);
int run_sync();