Loading...
Searching...
No Matches
flipper_application.h File Reference

Flipper application. More...

#include "application_manifest.h"
#include "elf/elf_api_interface.h"
#include <furi.h>
#include <storage/storage.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  FlipperApplicationMemoryMapEntry
 
struct  FlipperApplicationState
 
struct  FlipperAppPluginDescriptor
 An object that describes a plugin - must be returned by plugin's entry point. More...
 

Typedefs

typedef struct FlipperApplication FlipperApplication
 
typedef int32_t(* FlipperApplicationEntryPoint) (void *)
 Entry point prototype for standalone applications.
 
typedef const FlipperAppPluginDescriptor *(* FlipperApplicationPluginEntryPoint) (void)
 Entry point prototype for plugins.
 

Enumerations

enum  FlipperApplicationPreloadStatus {
  FlipperApplicationPreloadStatusSuccess = 0 , FlipperApplicationPreloadStatusInvalidFile , FlipperApplicationPreloadStatusNotEnoughMemory , FlipperApplicationPreloadStatusInvalidManifest ,
  FlipperApplicationPreloadStatusApiTooOld , FlipperApplicationPreloadStatusApiTooNew , FlipperApplicationPreloadStatusTargetMismatch
}
 
enum  FlipperApplicationLoadStatus { FlipperApplicationLoadStatusSuccess = 0 , FlipperApplicationLoadStatusUnspecifiedError , FlipperApplicationLoadStatusMissingImports }
 

Functions

const char * flipper_application_preload_status_to_string (FlipperApplicationPreloadStatus status)
 Get text description of preload status.
 
const char * flipper_application_load_status_to_string (FlipperApplicationLoadStatus status)
 Get text description of load status.
 
FlipperApplicationflipper_application_alloc (Storage *storage, const ElfApiInterface *api_interface)
 Initialize FlipperApplication object.
 
void flipper_application_free (FlipperApplication *app)
 Destroy FlipperApplication object.
 
FlipperApplicationPreloadStatus flipper_application_preload (FlipperApplication *app, const char *path)
 Validate elf file and load application metadata.
 
FlipperApplicationPreloadStatus flipper_application_preload_manifest (FlipperApplication *app, const char *path)
 Validate elf file and load application manifest.
 
const FlipperApplicationManifestflipper_application_get_manifest (FlipperApplication *app)
 Get pointer to application manifest for preloaded application.
 
FlipperApplicationLoadStatus flipper_application_map_to_memory (FlipperApplication *app)
 Load sections and process relocations for already pre-loaded application.
 
FuriThreadflipper_application_alloc_thread (FlipperApplication *app, const char *args)
 Allocate application thread at entry point address, using app name and stack size from metadata.
 
bool flipper_application_is_plugin (FlipperApplication *app)
 Check if application is a plugin (not a runnable standalone app)
 
const FlipperAppPluginDescriptorflipper_application_plugin_get_descriptor (FlipperApplication *app)
 Get plugin descriptor for preloaded plugin.
 
bool flipper_application_load_name_and_icon (FuriString *path, Storage *storage, uint8_t **icon_ptr, FuriString *item_name)
 Load name and icon from FAP file.
 

Detailed Description

Flipper application.

Function Documentation

◆ flipper_application_alloc()

FlipperApplication * flipper_application_alloc ( Storage * storage,
const ElfApiInterface * api_interface )

Initialize FlipperApplication object.

Parameters
storageStorage instance
api_interfaceELF API interface to use for pre-loading and symbol resolving
Returns
Application instance

◆ flipper_application_alloc_thread()

FuriThread * flipper_application_alloc_thread ( FlipperApplication * app,
const char * args )

Allocate application thread at entry point address, using app name and stack size from metadata.

Returned thread isn't started yet. Can be only called once for application instance.

Parameters
appApplicaiton pointer
argsArgs to pass to app's entry point
Returns
Created thread

◆ flipper_application_free()

void flipper_application_free ( FlipperApplication * app)

Destroy FlipperApplication object.

Parameters
appApplication pointer

◆ flipper_application_get_manifest()

const FlipperApplicationManifest * flipper_application_get_manifest ( FlipperApplication * app)

Get pointer to application manifest for preloaded application.

Parameters
appApplication pointer
Returns
Pointer to application manifest

◆ flipper_application_is_plugin()

bool flipper_application_is_plugin ( FlipperApplication * app)

Check if application is a plugin (not a runnable standalone app)

Parameters
appApplication pointer
Returns
true if application is a plugin, false otherwise

◆ flipper_application_load_name_and_icon()

bool flipper_application_load_name_and_icon ( FuriString * path,
Storage * storage,
uint8_t ** icon_ptr,
FuriString * item_name )

Load name and icon from FAP file.

Parameters
pathPath to FAP file.
storageStorage instance.
icon_ptrIcon pointer.
item_nameApplication name.
Returns
true if icon and name were loaded successfully.

◆ flipper_application_load_status_to_string()

const char * flipper_application_load_status_to_string ( FlipperApplicationLoadStatus status)

Get text description of load status.

Parameters
statusStatus code
Returns
String pointer to description

◆ flipper_application_map_to_memory()

FlipperApplicationLoadStatus flipper_application_map_to_memory ( FlipperApplication * app)

Load sections and process relocations for already pre-loaded application.

Parameters
appApplication pointer
Returns
Load result code

◆ flipper_application_plugin_get_descriptor()

const FlipperAppPluginDescriptor * flipper_application_plugin_get_descriptor ( FlipperApplication * app)

Get plugin descriptor for preloaded plugin.

Parameters
appApplication pointer
Returns
Pointer to plugin descriptor

◆ flipper_application_preload()

FlipperApplicationPreloadStatus flipper_application_preload ( FlipperApplication * app,
const char * path )

Validate elf file and load application metadata.

Parameters
appApplication pointer
[in]pathThe path to fap file
Returns
Preload result code

◆ flipper_application_preload_manifest()

FlipperApplicationPreloadStatus flipper_application_preload_manifest ( FlipperApplication * app,
const char * path )

Validate elf file and load application manifest.

Parameters
appApplication pointer
[in]pathThe path to fap file
Returns
Preload result code

◆ flipper_application_preload_status_to_string()

const char * flipper_application_preload_status_to_string ( FlipperApplicationPreloadStatus status)

Get text description of preload status.

Parameters
statusStatus code
Returns
String pointer to description