Tiny fixes in OTA updater

This commit is contained in:
Nicolas Mailloux 2022-05-16 23:57:35 -04:00
parent fe88cc43e9
commit c328761bc5
2 changed files with 7 additions and 1 deletions

View file

@ -29,6 +29,7 @@ otaManager::otaManager(QWidget *parent) :
} }
unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch(); unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch();
string_writeconfig("/external_root/opt/storage/update/last_sync", std::to_string(currentEpoch)); string_writeconfig("/external_root/opt/storage/update/last_sync", std::to_string(currentEpoch));
QFile::remove("/run/can_ota_update");
otaManager::close(); otaManager::close();
} }
} ); } );

View file

@ -903,7 +903,12 @@ void settings::on_globalReadingSettingsCheckBox_toggled(bool checked)
void settings::on_checkOtaUpdateBtn_clicked() void settings::on_checkOtaUpdateBtn_clicked()
{ {
log("'Check for OTA update' button clicked", className); log("'Check for OTA update' button clicked", className);
if(testPing(true) == 0 or global::deviceID == "emu\n") {
launchOtaUpdater(); launchOtaUpdater();
}
else {
emit showToast("Wi-Fi connection error");
}
} }
void settings::openUpdateDialog() { void settings::openUpdateDialog() {