PebbleOS
Loading...
Searching...
No Matches
Modules | Macros | Enumerations | Functions
Process management

Storage of installed app and worker binaries. More...

Modules

 App menu order storage
 Persisted order of the apps in the launcher menu.
 

Macros

#define APP_FILE_NAME_SUFFIX   "app"
 App file suffix of app binaries.
 
#define WORKER_FILE_NAME_SUFFIX   "worker"
 App file suffix of worker binaries.
 
#define MAX_APP_BANKS   8
 Number of app banks of the legacy put_bytes protocol.
 
#define APP_FILENAME_MAX_LENGTH   32
 Size of a buffer able to hold an app or worker binary file name.
 

Enumerations

enum  AppStorageGetAppInfoResult { GET_APP_INFO_SUCCESS , GET_APP_INFO_COULD_NOT_READ_FORMAT , GET_APP_INFO_INCOMPATIBLE_SDK }
 Result of app_storage_get_process_info(). More...
 

Functions

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.
 
void app_storage_delete_app (AppInstallId id)
 Remove the app, worker and resource files of an app.
 
bool app_storage_app_exists (AppInstallId id)
 Check whether the app binary and resources of an app are stored.
 
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.
 
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.
 

Detailed Description

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.

Macro Definition Documentation

◆ 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

#define MAX_APP_BANKS   8

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.

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ app_storage_app_exists()

bool app_storage_app_exists ( AppInstallId  id)

Check whether the app binary and resources of an app are stored.

Parameters
idApp 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
idApp 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]nameBuffer for the NUL-terminated file name.
buf_lengthSize of name, see APP_FILENAME_MAX_LENGTH.
app_idApp install id.
taskPebbleTask_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_infoMetadata read from flash.
[out]build_id_outBuffer 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_idApp install id.
taskPebbleTask_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
infoProcess metadata.
[out]load_size_outLoad size in bytes, set on success.
Returns
true on success, false if the size overflows.