add uuid to board

This commit is contained in:
Terrence
2025-02-11 16:56:23 +08:00
parent 2d718a0cbc
commit ac93e88d17
7 changed files with 77 additions and 1 deletions

View File

@@ -61,7 +61,11 @@ void Application::CheckNewVersion() {
ota_.SetPostData(board.GetJson());
while (true) {
if (ota_.CheckVersion()) {
bool success = ota_.CheckVersion();
if (ota_.HasActivationCode()) {
DisplayActivationCode();
}
if (success) {
if (ota_.HasNewVersion()) {
Alert("Info", "正在升级固件");
// Wait for the chat state to be idle
@@ -115,6 +119,13 @@ void Application::CheckNewVersion() {
}
}
void Application::DisplayActivationCode() {
ESP_LOGW(TAG, "Activation Message: %s", ota_.GetActivationMessage().c_str());
ESP_LOGW(TAG, "Activation Code: %s", ota_.GetActivationCode().c_str());
auto display = Board::GetInstance().GetDisplay();
display->ShowNotification(ota_.GetActivationMessage(), 30000);
}
void Application::Alert(const std::string& title, const std::string& message) {
ESP_LOGW(TAG, "Alert: %s, %s", title.c_str(), message.c_str());
auto display = Board::GetInstance().GetDisplay();