mirror of
https://github.com/m5stack/StackChan.git
synced 2026-04-27 19:12:40 +00:00
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#include "app_ai_agent.h"
|
||||
#include <hal/hal.h>
|
||||
#include <mooncake.h>
|
||||
#include <mooncake_log.h>
|
||||
#include <assets/assets.h>
|
||||
#include <smooth_lvgl.hpp>
|
||||
|
||||
using namespace mooncake;
|
||||
using namespace smooth_ui_toolkit::lvgl_cpp;
|
||||
|
||||
AppAiAgent::AppAiAgent()
|
||||
{
|
||||
// Configure App name
|
||||
setAppInfo().name = "AI.AGENT";
|
||||
// Configure App icon
|
||||
setAppInfo().icon = (void*)&icon_ai_agent;
|
||||
// Configure App theme color
|
||||
static uint32_t theme_color = 0x33CC99;
|
||||
setAppInfo().userData = (void*)&theme_color;
|
||||
}
|
||||
|
||||
// Called when the App is installed
|
||||
void AppAiAgent::onCreate()
|
||||
{
|
||||
mclog::tagInfo(getAppInfo().name, "on create");
|
||||
}
|
||||
|
||||
// Called when the App is opened
|
||||
// You can construct UI, initialize operations, etc. here
|
||||
void AppAiAgent::onOpen()
|
||||
{
|
||||
mclog::tagInfo(getAppInfo().name, "on open");
|
||||
|
||||
GetHAL().startXiaozhi();
|
||||
}
|
||||
|
||||
// Called repeatedly while the App is running
|
||||
void AppAiAgent::onRunning()
|
||||
{
|
||||
}
|
||||
|
||||
// Called when the App is closed
|
||||
// You can destroy UI, release resources, etc. here
|
||||
void AppAiAgent::onClose()
|
||||
{
|
||||
mclog::tagInfo(getAppInfo().name, "on close");
|
||||
}
|
||||
Reference in New Issue
Block a user