From c328761bc55763442c2b322a7f99ec1f451976c4 Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Mon, 16 May 2022 23:57:35 -0400 Subject: [PATCH] Tiny fixes in OTA updater --- otamanager.cpp | 1 + settings.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/otamanager.cpp b/otamanager.cpp index 69628c6..ab59bf7 100644 --- a/otamanager.cpp +++ b/otamanager.cpp @@ -29,6 +29,7 @@ otaManager::otaManager(QWidget *parent) : } unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch(); string_writeconfig("/external_root/opt/storage/update/last_sync", std::to_string(currentEpoch)); + QFile::remove("/run/can_ota_update"); otaManager::close(); } } ); diff --git a/settings.cpp b/settings.cpp index 91e0bfb..18dfb41 100644 --- a/settings.cpp +++ b/settings.cpp @@ -903,7 +903,12 @@ void settings::on_globalReadingSettingsCheckBox_toggled(bool checked) void settings::on_checkOtaUpdateBtn_clicked() { log("'Check for OTA update' button clicked", className); - launchOtaUpdater(); + if(testPing(true) == 0 or global::deviceID == "emu\n") { + launchOtaUpdater(); + } + else { + emit showToast("Wi-Fi connection error"); + } } void settings::openUpdateDialog() {