应用商店
概述
brookesia_app_store 管理 System Core 安装环境中的本地和远端应用包。
核心职责
通过 HTTP 服务获取远端应用索引。
下载、安装、移除和列出应用包。
通过 Storage 与 System Core 应用管理接口处理包数据。
集成位置
该组件是 ESP-Brookesia 发布组件清单中的独立组件,可通过 ESP-IDF 组件依赖集成,并与同层框架组件按需组合。
API 参考
Header File
Classes
-
class AppStoreApp : public esp_brookesia::system::core::IApp
Built-in app store application for browsing, downloading, installing, and removing apps.
Public Functions
-
AppStoreApp()
Create an app store application instance.
-
~AppStoreApp() override
Destroy the app store application instance.
-
virtual system::core::AppManifest get_manifest() const override
Get the static metadata used to identify and present the application.
- 返回
Application manifest containing id, name, version, and launch metadata.
-
virtual system::core::AppGuiDescriptor get_gui_descriptor() const override
Get the optional GUI resource descriptor for applications with a visual surface.
- 返回
GUI descriptor; the default descriptor is empty for non-visual apps.
-
virtual std::expected<void, std::string> on_start(system::core::AppContext &context) override
Called when the application is started.
- 参数
context -- Runtime context for GUI, timers, storage, and services.
- 返回
Empty result on success, or an error string that aborts startup.
-
virtual std::expected<void, std::string> on_stop(system::core::AppContext &context) override
Called when the application is stopped.
- 参数
context -- Runtime context for releasing app resources.
- 返回
Empty result on success, or an error string.
-
virtual std::expected<void, std::string> on_action(system::core::AppContext &context, std::string_view action) override
Handle an action emitted by the application GUI or shell.
- 参数
context -- Runtime context for the running application.
action -- Action identifier registered by the application GUI.
- 返回
Empty result on success, or an error string.
-
virtual std::expected<void, std::string> on_timer(system::core::AppContext &context, system::core::TimerId timer_id, std::string_view name) override
Handle a timer event previously scheduled through the app context.
- 参数
context -- Runtime context for the running application.
timer_id -- Runtime timer identifier.
name -- Application-defined timer name.
- 返回
Empty result on success, or an error string.
-
AppStoreApp()
-
class AppStoreAppProvider : public esp_brookesia::system::core::IAppProvider
Public Functions
-
virtual system::core::AppManifest get_manifest() const override
Get the manifest for the built-in app store app.
- 返回
App store application manifest.
-
virtual system::core::AppManifest get_manifest() const override