Storage of installed app and worker binaries.
More...
Storage of installed app and worker binaries.
App and worker binaries are stored in PFS as app files (see App files) with the suffixes APP_FILE_NAME_SUFFIX and WORKER_FILE_NAME_SUFFIX; resources are kept separately by the resource storage.
◆ APP_FILE_NAME_SUFFIX
| #define APP_FILE_NAME_SUFFIX "app" |
App file suffix of app binaries.
◆ APP_FILENAME_MAX_LENGTH
| #define APP_FILENAME_MAX_LENGTH 32 |
Size of a buffer able to hold an app or worker binary file name.
◆ MAX_APP_BANKS
Number of app banks of the legacy put_bytes protocol.
◆ WORKER_FILE_NAME_SUFFIX
| #define WORKER_FILE_NAME_SUFFIX "worker" |
App file suffix of worker binaries.
◆ AppStorageGetAppInfoResult
Result of app_storage_get_process_info().
| Enumerator |
|---|
| GET_APP_INFO_SUCCESS | Metadata read and compatible with the running firmware.
|
| GET_APP_INFO_COULD_NOT_READ_FORMAT | The binary is missing, unreadable or not a Pebble app.
|
| GET_APP_INFO_INCOMPATIBLE_SDK | The app was built with an SDK newer than the firmware supports.
|
◆ app_storage_app_exists()
| bool app_storage_app_exists |
( |
AppInstallId |
id | ) |
|
Check whether the app binary and resources of an app are stored.
- Parameters
-
| id | App install id, greater than 0. |
- Returns
- true if both exist.
◆ app_storage_delete_app()
| void app_storage_delete_app |
( |
AppInstallId |
id | ) |
|
Remove the app, worker and resource files of an app.
- Parameters
-
| id | App install id, greater than 0. |
◆ app_storage_get_file_name()
| void app_storage_get_file_name |
( |
char * |
name, |
|
|
size_t |
buf_length, |
|
|
AppInstallId |
app_id, |
|
|
PebbleTask |
task |
|
) |
| |
Get the file name of an app or worker binary.
- Parameters
-
| [out] | name | Buffer for the NUL-terminated file name. |
| buf_length | Size of name, see APP_FILENAME_MAX_LENGTH. |
| app_id | App install id. |
| task | PebbleTask_App or PebbleTask_Worker. |
◆ app_storage_get_process_info()
| AppStorageGetAppInfoResult app_storage_get_process_info |
( |
PebbleProcessInfo * |
app_info, |
|
|
uint8_t * |
build_id_out, |
|
|
AppInstallId |
app_id, |
|
|
PebbleTask |
task |
|
) |
| |
Read and check the metadata of a stored app or worker binary.
- Parameters
-
| [out] | app_info | Metadata read from flash. |
| [out] | build_id_out | Buffer of at least BUILD_ID_EXPECTED_LEN bytes for the GNU build ID of the executable, zero-filled if there is none. May be NULL. |
| app_id | App install id. |
| task | PebbleTask_App or PebbleTask_Worker. |
- Returns
- Result of the check.
◆ app_storage_get_process_load_size()
| bool app_storage_get_process_load_size |
( |
const PebbleProcessInfo * |
info, |
|
|
size_t * |
load_size_out |
|
) |
| |
Compute the size of the process image plus its relocation table.
- Parameters
-
| info | Process metadata. |
| [out] | load_size_out | Load size in bytes, set on success. |
- Returns
- true on success, false if the size overflows.