|
PebbleOS
|
Fetches app binaries from the phone. More...
Data Structures | |
| struct | AppFetchError |
| Result of the last app fetch. More... | |
Enumerations | |
| enum | AppFetchResult { AppFetchResultSuccess , AppFetchResultTimeoutError , AppFetchResultGeneralFailure , AppFetchResultPhoneBusy , AppFetchResultUUIDInvalid , AppFetchResultNoBluetooth , AppFetchResultPutBytesFailure , AppFetchResultNoData , AppFetchResultUserCancelled , AppFetchResultIncompatibleJSFailure } |
| Outcome of an app fetch. More... | |
Functions | |
| void | app_fetch_binaries (const Uuid *uuid, AppInstallId app_id, bool has_worker) |
| Request the binaries of an app from the phone. | |
| void | app_fetch_cancel (AppInstallId app_id) |
| Cancel a fetch in progress. | |
| void | app_fetch_cancel_from_system_task (AppInstallId app_id) |
| Cancel a fetch in progress, synchronously. | |
| bool | app_fetch_in_progress (void) |
| Check whether a fetch is in progress. | |
| void | app_fetch_put_bytes_event_handler (PebblePutBytesEvent *pb_event) |
| Handle a put_bytes event. | |
| AppFetchError | app_fetch_get_previous_error (void) |
| Get the result of the last fetch. | |
Fetches app binaries from the phone.
The watch sends an install request for an app to the phone, which then pushes the app, worker and resources over put_bytes. Progress, completion and errors are reported with PEBBLE_APP_FETCH_EVENT events; once all parts are received the app is added to the app cache. Only one fetch can be in progress at a time. The work runs on KernelBackground.
| struct AppFetchError |
Result of the last app fetch.
| Data Fields | ||
|---|---|---|
| AppFetchResult | error | Outcome of the fetch. |
| AppInstallId | id | App that was fetched. |
| enum AppFetchResult |
Outcome of an app fetch.
| void app_fetch_binaries | ( | const Uuid * | uuid, |
| AppInstallId | app_id, | ||
| bool | has_worker | ||
| ) |
Request the binaries of an app from the phone.
Ignored if a fetch is already in progress.
| uuid | UUID of the app. |
| app_id | Install id of the app. |
| has_worker | true if the app has a worker binary to fetch. |
| void app_fetch_cancel | ( | AppInstallId | app_id | ) |
Cancel a fetch in progress.
The cancellation runs asynchronously on KernelBackground.
| app_id | App whose fetch is cancelled; INSTALL_ID_INVALID cancels any fetch. |
| void app_fetch_cancel_from_system_task | ( | AppInstallId | app_id | ) |
Cancel a fetch in progress, synchronously.
Must be called from KernelBackground.
| app_id | App whose fetch is cancelled; INSTALL_ID_INVALID cancels any fetch. |
| AppFetchError app_fetch_get_previous_error | ( | void | ) |
Get the result of the last fetch.
| bool app_fetch_in_progress | ( | void | ) |
Check whether a fetch is in progress.
| void app_fetch_put_bytes_event_handler | ( | PebblePutBytesEvent * | pb_event | ) |
Handle a put_bytes event.
Tracks the progress and completion of the fetched parts. Called from KernelMain; ignored if no fetch is in progress.
| pb_event | Put bytes event, copied before processing. |