Support MQTT endpoint port

This commit is contained in:
Terrence
2025-04-21 06:54:50 +08:00
parent a6619dcdb9
commit c380617cca
6 changed files with 28 additions and 14 deletions

View File

@@ -490,7 +490,7 @@ void Application::Start() {
}
}
});
protocol_->Start();
bool protocol_started = protocol_->Start();
#if CONFIG_USE_AUDIO_PROCESSOR
audio_processor_.Initialize(codec, realtime_chat_enabled_);
@@ -556,12 +556,15 @@ void Application::Start() {
// Wait for the new version check to finish
xEventGroupWaitBits(event_group_, CHECK_NEW_VERSION_DONE_EVENT, pdTRUE, pdFALSE, portMAX_DELAY);
SetDeviceState(kDeviceStateIdle);
std::string message = std::string(Lang::Strings::VERSION) + ota_.GetCurrentVersion();
display->ShowNotification(message.c_str());
display->SetChatMessage("system", "");
// Play the success sound to indicate the device is ready
ResetDecoder();
PlaySound(Lang::Sounds::P3_SUCCESS);
if (protocol_started) {
std::string message = std::string(Lang::Strings::VERSION) + ota_.GetCurrentVersion();
display->ShowNotification(message.c_str());
display->SetChatMessage("system", "");
// Play the success sound to indicate the device is ready
ResetDecoder();
PlaySound(Lang::Sounds::P3_SUCCESS);
}
// Enter the main event loop
MainEventLoop();