|
|
#define | RECORD_LOADER "loader" |
| |
|
#define | LOADER_APPLICATIONS_NAME "Apps" |
| |
|
|
typedef struct Loader | Loader |
| |
|
| enum | LoaderStatus {
LoaderStatusOk
, LoaderStatusErrorAppStarted
, LoaderStatusErrorAppNotRunning
, LoaderStatusErrorUnknownApp
,
LoaderStatusErrorNoSignalHandler
} |
| |
| enum | LoaderEventType { LoaderEventTypeApplicationBeforeLoad
, LoaderEventTypeApplicationLoadFailed
, LoaderEventTypeApplicationStopped
, LoaderEventTypePriorityChanged
} |
| |
Loader is a system service that loads and manages applications.
◆ loader_get_application_name()
| bool loader_get_application_name |
( |
Loader * | instance, |
|
|
FuriString * | name ) |
Get the name of the currently running application.
- Parameters
-
| [in] | instance | pointer to the loader instance |
| [in,out] | name | pointer to the string to contain the name (must be allocated) |
- Returns
- true if it was possible to get an application name, false otherwise
◆ loader_get_priority()
| size_t loader_get_priority |
( |
Loader * | instance | ) |
|
Get the priority level of the currently running app.
The canvas service calls this on every draw request to compute the effective rejection threshold. Returns 0 if no application is currently running.
- Parameters
-
| [in] | instance | loader instance |
- Returns
- Current app priority, or 0 if no app is running.
◆ loader_get_pubsub()
| FuriPubSub * loader_get_pubsub |
( |
Loader * | instance | ) |
|
Get loader pubsub.
- Parameters
-
| [in] | instance | loader instance |
- Returns
- FuriPubSub*
◆ loader_is_locked()
| bool loader_is_locked |
( |
Loader * | instance | ) |
|
Check if loader is locked.
- Parameters
-
| [in] | instance | loader instance |
- Returns
- true if locked
◆ loader_lock()
| bool loader_lock |
( |
Loader * | instance | ) |
|
Lock application start.
- Parameters
-
| [in] | instance | loader instance |
- Returns
- true on success
◆ loader_send_signal()
| bool loader_send_signal |
( |
Loader * | instance, |
|
|
uint32_t | signal, |
|
|
void * | arg ) |
Send a signal to the currently running application.
- Parameters
-
| [in] | instance | pointer to the loader instance |
| [in] | signal | signal value |
| [in] | arg | optional argument to pass with the signal |
- Returns
- true if signal was sent and consumed, false otherwise
◆ loader_set_priority()
| bool loader_set_priority |
( |
Loader * | instance, |
|
|
size_t | priority ) |
Set the priority level for the currently running app.
The priority gates HTTP canvas draw requests: see the LoaderPriority group for the full scale and interaction rules.
The call is synchronous and is processed by the loader task. It succeeds only when an application is running and the calling thread belongs to that same application (verified by app-id comparison).
- Parameters
-
| [in] | instance | loader instance |
| [in] | priority | new priority (0 … LOADER_BLOCKING_PRIORITY) |
- Returns
- true priority was updated
-
false no app is running, or the caller is not the running app
◆ loader_start()
| LoaderStatus loader_start |
( |
Loader * | instance, |
|
|
const char * | name, |
|
|
const char * | args, |
|
|
FuriString * | error_message ) |
Start application.
- Parameters
-
| [in] | instance | loader instance |
| [in] | name | application name or id |
| [in] | args | application arguments |
| [out] | error_message | detailed error message, can be NULL |
- Returns
- LoaderStatus
◆ loader_stop()
| LoaderStatus loader_stop |
( |
Loader * | instance | ) |
|
Stop the currently running application.
- Parameters
-
| [in] | instance | loader instance |
- Returns
- LoaderStatusOk on success, any other error code on failure
◆ loader_unlock()
| void loader_unlock |
( |
Loader * | instance | ) |
|
Unlock application start.
- Parameters
-
| [in] | instance | loader instance |