Added finalResult() -> send final message to ISMAS in any case.

This commit is contained in:
Gerhard Hoffmann 2023-08-11 12:19:10 +02:00
parent 769626581f
commit 4968942cc2
2 changed files with 24 additions and 0 deletions

View File

@ -762,6 +762,27 @@ QString IsmasClient::jsonParseFailed(int resultCode, QString reason, QString con
version.toStdString().c_str());
}
std::optional<QString> IsmasClient::finalResult(int resultCode, QString reason, QString const &version) {
m_progressInPercent = 0;
if (resultCode == RESULT_CODE::SUCCESS) {
return updateNewsToIsmas("U0002",
m_progressInPercent,
RESULT_CODE::SUCCESS,
"FINAL-UPDATE-RESULT",
"(re-)set WAIT state",
version.toStdString().c_str());
}
if (resultCode == RESULT_CODE::INSTALL_ERROR) {
return updateNewsToIsmas("U0003",
m_progressInPercent,
resultCode,
"FINAL-UPDATE-RESULT",
reason.toStdString().c_str(),
version.toStdString().c_str());
}
return std::nullopt;
}
QString IsmasClient::updateOfPSAFailed(int resultCode, QString step,
QString reason, QString const &version) {
return updateNewsToIsmas("U0003",

View File

@ -4,6 +4,8 @@
#include <QObject>
#include <QString>
#include <optional>
struct PSAInstalled {
struct Tariff {
QString name;
@ -159,6 +161,7 @@ public:
QString updateOfPSAFailed(int resultCode, QString step, QString reason, QString const &version = QString());
QString sanityCheckFailed(int resultCode, QString reason, QString const &version = QString());
QString jsonParseFailed(int resultCode, QString reason, QString const &version = QString());
std::optional<QString> finalResult(int resultCode, QString reason, QString const &version = QString());
QString updateOfPSASendVersion(PSAInstalled const &psa);