forked from xiaozhi/xiaozhi-esp32
Enhance device activation and OTA update process
- Add support for device activation with audio feedback - Refactor OTA update flow to include activation code handling - Update asset management for localized sound resources - Improve error handling and device state management - Reorganize binary asset includes and CMake configuration
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "system_info.h"
|
||||
#include "font_awesome_symbols.h"
|
||||
#include "settings.h"
|
||||
#include "assets/zh/binary.h"
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
@@ -37,7 +38,6 @@ std::string WifiBoard::GetBoardType() {
|
||||
|
||||
void WifiBoard::EnterWifiConfigMode() {
|
||||
auto& application = Application::GetInstance();
|
||||
auto display = Board::GetInstance().GetDisplay();
|
||||
application.SetDeviceState(kDeviceStateWifiConfiguring);
|
||||
|
||||
auto& wifi_ap = WifiConfigurationAp::GetInstance();
|
||||
@@ -49,11 +49,9 @@ void WifiBoard::EnterWifiConfigMode() {
|
||||
hint += wifi_ap.GetSsid();
|
||||
hint += ",然后打开浏览器访问 ";
|
||||
hint += wifi_ap.GetWebServerUrl();
|
||||
|
||||
display->SetStatus(hint);
|
||||
|
||||
// 播报配置 WiFi 的提示
|
||||
application.Alert("Info", "进入配网模式");
|
||||
application.Alert("配网模式", hint, "", std::string(p3_wificonfig_start, p3_wificonfig_end - p3_wificonfig_start));
|
||||
|
||||
// Wait forever until reset after configuration
|
||||
while (true) {
|
||||
@@ -83,11 +81,11 @@ void WifiBoard::StartNetwork() {
|
||||
auto& wifi_station = WifiStation::GetInstance();
|
||||
wifi_station.OnScanBegin([this]() {
|
||||
auto display = Board::GetInstance().GetDisplay();
|
||||
display->ShowNotification("正在扫描 WiFi 网络", 30000);
|
||||
display->ShowNotification("扫描 WiFi...", 30000);
|
||||
});
|
||||
wifi_station.OnConnect([this](const std::string& ssid) {
|
||||
auto display = Board::GetInstance().GetDisplay();
|
||||
display->ShowNotification(std::string("正在连接 ") + ssid, 30000);
|
||||
display->ShowNotification(std::string("连接 ") + ssid + "...", 30000);
|
||||
});
|
||||
wifi_station.OnConnected([this](const std::string& ssid) {
|
||||
auto display = Board::GetInstance().GetDisplay();
|
||||
|
||||
Reference in New Issue
Block a user