![]() |
BSB Developer Docs
|
Firmware update system interface. More...
#include "settings/settings.h"#include <furi.h>#include <toolbox/update_lib/update_manifest.h>Go to the source code of this file.
Data Structures | |
| struct | UpdaterUpdateState |
| Update state information accessible via FuriState. More... | |
| struct | UpdaterCheckState |
| Update check state information accessible via FuriState. More... | |
| struct | UpdateCheckInfo |
Macros | |
| #define | RECORD_UPDATER "updater" |
| #define | UPDATER_UPDATE_STATE_DETAIL_MAX_LENGTH 128 |
Typedefs | |
| typedef struct Updater | Updater |
Functions | |
| const char * | updater_get_status_string (UpdaterStatus status) |
| Get human-readable string for a status code. | |
| FuriState * | updater_get_update_state (Updater *instance) |
| Get update state object for monitoring progress. | |
| FuriState * | updater_get_check_state (Updater *instance) |
| Get update check state object for monitoring update availability. | |
| void | updater_get_check_info (Updater *instance, UpdateCheckInfo *info) |
| Get update information. | |
| UpdaterStatus | updater_get_allowance_status (Updater *instance) |
| Check if update is allowed to start. | |
| UpdaterStatus | updater_session_start (Updater *instance) |
| Start update process. | |
| void | updater_session_stop (Updater *instance) |
| Stop update process. | |
| UpdaterStatus | updater_download (Updater *instance, const char *url, const char *path, bool do_wait) |
| Download update bundle from URL. | |
| void | updater_abort_download (Updater *instance) |
| Abort ongoing download operation. | |
| UpdaterStatus | updater_verify_bundle_sha (Updater *instance, const char *tar_path, const char *sha, bool do_wait) |
| Verify SHA256 checksum of update bundle. | |
| UpdaterStatus | updater_unpack (Updater *instance, const char *tar_path, const char *staging_path, FuriString *manifest_path, bool do_wait) |
| Unpack update bundle .tar archive. | |
| UpdaterStatus | updater_installation_prepare (Updater *instance, const char *manifest_path, bool do_wait) |
| Prepare update for installation. | |
| void | updater_installation_apply (Updater *instance, bool do_wait) |
| Apply prepared installation. | |
| void | updater_install_from_url (Updater *instance, const char *url, const char *sha256) |
| Install firmware from URL. | |
| UpdaterStatus | updater_check_for_update (Updater *instance) |
| Check for available firmware updates. | |
| void | updater_pause_autoupdates (Updater *instance) |
| Pause automatic updates. | |
| void | updater_resume_autoupdates (Updater *instance) |
| Resume automatic updates. | |
| const char * | updater_get_active_version (void) |
| Get currently active firmware version string. | |
| bool | updater_get_active_security_flags (uint32_t *flags) |
| Get the device's active firmware protection flags. | |
| void | updater_get_settings (const Updater *instance, UpdaterSettings *settings) |
| Get the current updater settings. | |
| bool | updater_set_settings (Updater *instance, const UpdaterSettings *settings) |
| Set new updater settings. | |
| FuriState * | updater_get_settings_state (Updater *instance) |
| Get settings state object for change notifications. | |
Firmware update system interface.
| enum UpdaterCheckEvent |
| enum UpdaterCheckResult |
| enum UpdaterStatus |
| enum UpdaterUpdateAction |
| enum UpdaterUpdateEvent |
| void updater_abort_download | ( | Updater * | instance | ) |
Abort ongoing download operation.
Signals download to abort. Download will complete with UpdaterStatusDownloadAbort. Must be called from inside of updater's session.
| [in] | instance | Updater instance |
| UpdaterStatus updater_check_for_update | ( | Updater * | instance | ) |
Check for available firmware updates.
Queries remote server for available updates and populates check state.
| [in] | instance | Updater instance |
| UpdaterStatus updater_download | ( | Updater * | instance, |
| const char * | url, | ||
| const char * | path, | ||
| bool | do_wait ) |
Download update bundle from URL.
Must be called from inside of updater's session.
| [in] | instance | Updater instance |
| [in] | url | URL to download from |
| [in] | path | Local file path to save to (NULL for default) |
| [in] | do_wait | true to block until complete, false for async operation |
| bool updater_get_active_security_flags | ( | uint32_t * | flags | ) |
Get the device's active firmware protection flags.
Computes a bitmask of active UpdateManifestSecurityFlag bits from the wireless co-processor (Si917) NWP/M4 signature and encryption state.
| [out] | flags | Pointer to receive the security flags bitmask (see UpdateManifestSecurityFlag in update_manifest.h) |
| const char * updater_get_active_version | ( | void | ) |
Get currently active firmware version string.
| UpdaterStatus updater_get_allowance_status | ( | Updater * | instance | ) |
Check if update is allowed to start.
| [in] | instance | Updater instance |
| void updater_get_check_info | ( | Updater * | instance, |
| UpdateCheckInfo * | info ) |
Get update information.
The info parameter should point to an initialized struct:
| [in] | instance | Updater instance |
| [out] | info | Pointer to UpdateCheckInfo struct. |
| FuriState * updater_get_check_state | ( | Updater * | instance | ) |
Get update check state object for monitoring update availability.
| [in] | instance | Updater instance |
| void updater_get_settings | ( | const Updater * | instance, |
| UpdaterSettings * | settings ) |
Get the current updater settings.
Retrieves the current configuration of the updater service including check URL, channel ID, sync intervals, and autoupdate settings.
| [in] | instance | Updater instance |
| [out] | settings | Pointer to a structure to be filled with current settings |
| FuriState * updater_get_settings_state | ( | Updater * | instance | ) |
Get settings state object for change notifications.
| [in] | instance | Updater instance |
| const char * updater_get_status_string | ( | UpdaterStatus | status | ) |
Get human-readable string for a status code.
| [in] | status | The status code |
| FuriState * updater_get_update_state | ( | Updater * | instance | ) |
Get update state object for monitoring progress.
| [in] | instance | Updater instance |
| void updater_install_from_url | ( | Updater * | instance, |
| const char * | url, | ||
| const char * | sha256 ) |
Install firmware from URL.
Downloads, verifies, unpacks, prepares, and installs firmware from a remote URL. Runs asynchronously in a background thread and reboots the device upon completion. The update session is automatically started and stopped by this function. Requires update session to be started, will close it on completion.
| [in] | instance | Updater instance |
| [in] | url | URL to download update bundle from |
| [in] | sha256 | Expected SHA256 checksum (NULL to skip verification) |
| void updater_installation_apply | ( | Updater * | instance, |
| bool | do_wait ) |
Apply prepared installation.
This will reboot the device. Requires update session to be started.
| [in] | instance | Updater instance |
| [in] | do_wait | true to block and reboot, false for async reboot |
| UpdaterStatus updater_installation_prepare | ( | Updater * | instance, |
| const char * | manifest_path, | ||
| bool | do_wait ) |
Prepare update for installation.
Must be called from inside of updater's session.
| [in] | instance | Updater instance |
| [in] | manifest_path | Path to update manifest file (NULL for default: /ext/update/staging/update.fuf) |
| [in] | do_wait | true to block until complete, false for async operation |
| void updater_pause_autoupdates | ( | Updater * | instance | ) |
Pause automatic updates.
| [in] | instance | Updater instance |
| void updater_resume_autoupdates | ( | Updater * | instance | ) |
Resume automatic updates.
| [in] | instance | Updater instance |
| UpdaterStatus updater_session_start | ( | Updater * | instance | ) |
Start update process.
Checks allowance status, acquires update lock, and emits UpdaterUpdateEventSessionStart event. Must be called before any update operations.
| [in] | instance | Updater instance |
| void updater_session_stop | ( | Updater * | instance | ) |
Stop update process.
Emits UpdaterUpdateEventSessionStop event and releases update lock. Must be called after all update operations complete.
| [in] | instance | Updater instance |
| bool updater_set_settings | ( | Updater * | instance, |
| const UpdaterSettings * | settings ) |
Set new updater settings.
Updates the updater service configuration. Changes take effect immediately and will trigger a reconfiguration of the background update task if the service is enabled.
| [in,out] | instance | Updater instance |
| [in] | settings | Pointer to a structure containing the new settings |
| UpdaterStatus updater_unpack | ( | Updater * | instance, |
| const char * | tar_path, | ||
| const char * | staging_path, | ||
| FuriString * | manifest_path, | ||
| bool | do_wait ) |
Unpack update bundle .tar archive.
Must be called from inside of updater's session.
| [in] | instance | Updater instance |
| [in] | tar_path | Path to .tar archive (NULL for default) |
| [in] | staging_path | Directory to extract to (NULL for default) |
| [out] | manifest_path | FuriString to receive manifest path (or NULL if not needed) |
| [in] | do_wait | true to block until complete, false for async operation |
| UpdaterStatus updater_verify_bundle_sha | ( | Updater * | instance, |
| const char * | tar_path, | ||
| const char * | sha, | ||
| bool | do_wait ) |
Verify SHA256 checksum of update bundle.
Must be called from inside of updater's session.
| [in] | instance | Updater instance |
| [in] | tar_path | Path to .tar archive (NULL for default) |
| [in] | sha | Expected SHA256 checksum string |
| [in] | do_wait | true to block until complete, false for async operation |