Soletta™ Framework
|
Updating a Soletta based app may vary depending on Soletta environment and configuration. More...
Modules | |
Update modules | |
Data Structures | |
struct | sol_update_info |
Contains update info got via sol_update_check call. More... | |
Typedefs | |
typedef struct sol_update_handle | sol_update_handle |
Handle returned by some sol_update* calls, so they can be cancelled appropriately. More... | |
typedef struct sol_update_info | sol_update_info |
Contains update info got via sol_update_check call. More... | |
Functions | |
bool | sol_update_cancel (struct sol_update_handle *handle) |
Cancel an ongoing check, fetch or install task. More... | |
struct sol_update_handle * | sol_update_check (void(*cb)(void *data, int status, const struct sol_update_info *response), const void *data) |
Check if there's an update to get. More... | |
struct sol_update_handle * | sol_update_fetch (void(*cb)(void *data, int status), const void *data, bool resume) |
Fetch update, so it can be installed later wit sol_update_install . More... | |
int | sol_update_get_progress (struct sol_update_handle *handle) |
Get progress of given update task. More... | |
struct sol_update_handle * | sol_update_install (void(*cb)(void *data, int status), const void *data) |
Install update. More... | |
Updating a Soletta based app may vary depending on Soletta environment and configuration.
For instance, updating a static Linux Micro (PID 1) Soletta based app is only a matter of replacing app file, but when using shared libs, may involve update/install newer versions of used libs. So, Soletta provides different update modules to update Soletta based apps on different scenarios. Soletta will try to use the first module it can use, but if having different modules to be loaded, environment variable SOL_UPDATE_MODULE can be used to define a specific one, like SOL_UPDATE_MODULE=linux-micro-efi-update.
When Soletta update module cheks for update, it should get version and size of new file to fill sol_update_info
.
Each update module is free to decide how to check, fetch and install the update. Check update module documentation to understand how it works. Note also that comparing obtained version with app current version and deciding to fetch update file is up to user/developer.
Handle returned by some sol_update* calls, so they can be cancelled appropriately.
typedef struct sol_update_info sol_update_info |
Contains update info got via sol_update_check
call.
bool sol_update_cancel | ( | struct sol_update_handle * | handle | ) |
Cancel an ongoing check, fetch or install task.
Note that cancelling the task may not be possible at any moment, depending on update module being used.
handle | handle of update task to be cancelled. |
struct sol_update_handle* sol_update_check | ( | void(*)(void *data, int status, const struct sol_update_info *response) | cb, |
const void * | data | ||
) |
Check if there's an update to get.
Module must return a sol_update_info
containing update size and version.
cb | callback that will be called to return update information. If status < 0, then something went wrong with check and response is undefined. If status == 0, check went OK and response argument shall contain obtained update information. |
data | user defined data to be sent to callback cb |
struct sol_update_handle* sol_update_fetch | ( | void(*)(void *data, int status) | cb, |
const void * | data, | ||
bool | resume | ||
) |
Fetch update, so it can be installed later wit sol_update_install
.
Fetch will get the update. Update module should check its hash and signature before informing that task was completed successfully. If everything is OK, callback cb will be called with status == 0.
cb | callback called to inform fetch completion or failure. If status < 0, then something went wrong. If status == 0, fetch went OK and sol_update_install can be used to install the update. |
data | user specified data to be sent to callback cb |
resume | NOT IMPLEMENTED. If false, any previous data downloaded shall be discarded. Otherwise, will resume a previous cancelled fetch. |
int sol_update_get_progress | ( | struct sol_update_handle * | handle | ) |
Get progress of given update task.
Note that getting the progress may not work for all tasks, depending on update module being used.
handle | handle of update task to get current progress. |
struct sol_update_handle* sol_update_install | ( | void(*)(void *data, int status) | cb, |
const void * | data | ||
) |
Install update.
Install process vary depending on update module being used, but all shall give feedback of success or not on cb callback.
cb | callback called to inform installation success or failure. If status < 0, then something went wrong. If status == 0, installation completed successfully. |
data | user defined data to be passed to callback cb |