Amde some preparations for sendLastVersion

This commit is contained in:
Gerhard Hoffmann 2023-12-17 16:25:31 +01:00
parent 18c7b656c3
commit dd591fdd23
2 changed files with 210 additions and 0 deletions

View File

@ -793,6 +793,152 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) {
return buf; return buf;
} }
#if 0
// prepare
QString IsmasClient::sendLastVersion(UPDATE_COMPONENT updateComponent,
PSAInstalled const &psa) {
static char buf[4096*2];
memset(buf, 0, sizeof(buf));
switch (updateComponent) {
case UPDATE_COMPONENT::TARIFF:
snprintf(buf, sizeof(buf)-1,
"{"
"\"VERSION_INFO\" : {"
"\"UPDATE_REASON\":\"%s\","
"\"CREATED\":\"%s\","
"\"GIT_COMMIT\":\"%s\""
"},"
"\"TARIFF\" : {"
"\"VERSION\" : \"%s\","
"\"PROJECT\" : \"%s\","
"\"ZONE\" : %d,"
"\"INFO\" : \"%s\","
"\"SIZE\" : %d\""
"},"
"}",
psa.tariff.versionInfo.reason.toStdString().c_str(),
psa.tariff.versionInfo.created.toStdString().c_str(),
psa.tariff.versionInfo.lastCommit.toStdString().c_str(),
psa.tariff.version.toStdString().c_str(),
psa.tariff.project.toStdString().c_str(),
psa.tariff.zone,
psa.tariff.info.toStdString().c_str(),
psa.tariff.size);
break;
case UPDATE_COMPONENT::SOFTWARE_ATBQT:
break;
case UPDATE_COMPONENT::SOFTWARE_APISM:
break;
case UPDATE_COMPONENT::SOFTWARE_ATB_UPDATE_TOOL:
break;
case UPDATE_COMPONENT::CONFIG_PTU5_CPU_SERIAL:
break;
case UPDATE_COMPONENT::CONFIG_DEVICE_CONTROLLER:
break;
case UPDATE_COMPONENT::CONFIG_PRINTER:
break;
case UPDATE_COMPONENT::CONFIG_BNA:
break;
case UPDATE_COMPONENT::PLUGIN_ATB_DEVICE_CONTROLLER:
break;
case UPDATE_COMPONENT::PLUGIN_INGENICO_CC:
break;
case UPDATE_COMPONENT::PLUGIN_MOBILISIS_CALC_PRICE:
break;
case UPDATE_COMPONENT::PLUGIN_MOBILISIS_CALC_PRICE_UI:
break;
case UPDATE_COMPONENT::PLUGIN_PRM_CALC_PRICE:
break;
case UPDATE_COMPONENT::PLUGIN_PRM_CALC_PRICE_UI:
break;
case UPDATE_COMPONENT::PLUGIN_TCP_ZVT_CC:
break;
case UPDATE_COMPONENT::OPKG_COMMANDS:
break;
case UPDATE_COMPONENT::HARDWARE_DEVICES:
break;
case UPDATE_COMPONENT::OS:
break;
case UPDATE_COMPONENT::DC2C_CASH_JSON:
break;
case UPDATE_COMPONENT::DC2C_CONF_JSON:
break;
case UPDATE_COMPONENT::DC2C_DEVICE_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT01_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT02_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT03_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT04_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT05_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT06_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT07_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT08_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT09_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT10_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT11_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT12_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT13_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT14_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT15_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT16_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT17_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT18_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT19_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT20_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT21_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT22_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT23_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT24_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT25_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT26_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT27_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT28_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT29_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT30_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT31_JSON:
break;
case UPDATE_COMPONENT::DC2C_PRINT32_JSON:
break;
}
qInfo() << buf;
return buf;
}
#endif
QString IsmasClient::updateOfPSAContinues(QString currentStage, QString IsmasClient::updateOfPSAContinues(QString currentStage,
QString currentStageInfo, QString currentStageInfo,
QString const &version) { QString const &version) {

View File

@ -14,6 +14,7 @@ struct PSAInstalled {
} versionInfo; } versionInfo;
struct Tariff { struct Tariff {
// VersionInfo versionInfo;
QString name; QString name;
QString version; QString version;
QString project; QString project;
@ -31,6 +32,7 @@ struct PSAInstalled {
} hw; } hw;
struct Opkg { struct Opkg {
// VersionInfo versionInfo;
int size; int size;
QString blob; QString blob;
QString lastCommit; QString lastCommit;
@ -38,6 +40,7 @@ struct PSAInstalled {
} opkg; } opkg;
struct DC { struct DC {
// VersionInfo versionInfo;
QString versionHW; QString versionHW;
QString versionSW; QString versionSW;
QString gitBlob; QString gitBlob;
@ -62,6 +65,7 @@ struct PSAInstalled {
} pluginVersion; } pluginVersion;
struct DC2C { struct DC2C {
// VersionInfo versionInfo;
QString name; QString name;
QString blob; QString blob;
int size; int size;
@ -194,8 +198,68 @@ public:
QString jsonParseFailed(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()); std::optional<QString> finalResult(int resultCode, QString reason, QString const &version = QString());
// legacy
QString updateOfPSASendVersion(PSAInstalled const &psa); QString updateOfPSASendVersion(PSAInstalled const &psa);
#if 0
enum class UPDATE_COMPONENT {
TARIFF,
SOFTWARE_ATBQT,
SOFTWARE_APISM,
SOFTWARE_ATB_UPDATE_TOOL,
CONFIG_PTU5_CPU_SERIAL,
CONFIG_DEVICE_CONTROLLER,
CONFIG_PRINTER,
CONFIG_BNA,
PLUGIN_ATB_DEVICE_CONTROLLER,
PLUGIN_INGENICO_CC,
PLUGIN_MOBILISIS_CALC_PRICE,
PLUGIN_MOBILISIS_CALC_PRICE_UI,
PLUGIN_PRM_CALC_PRICE,
PLUGIN_PRM_CALC_PRICE_UI,
PLUGIN_TCP_ZVT_CC,
OPKG_COMMANDS,
HARDWARE_DEVICES,
OS,
DC2C_CASH_JSON,
DC2C_CONF_JSON,
DC2C_DEVICE_JSON,
DC2C_PRINT01_JSON,
DC2C_PRINT02_JSON,
DC2C_PRINT03_JSON,
DC2C_PRINT04_JSON,
DC2C_PRINT05_JSON,
DC2C_PRINT06_JSON,
DC2C_PRINT07_JSON,
DC2C_PRINT08_JSON,
DC2C_PRINT09_JSON,
DC2C_PRINT10_JSON,
DC2C_PRINT11_JSON,
DC2C_PRINT12_JSON,
DC2C_PRINT13_JSON,
DC2C_PRINT14_JSON,
DC2C_PRINT15_JSON,
DC2C_PRINT16_JSON,
DC2C_PRINT17_JSON,
DC2C_PRINT18_JSON,
DC2C_PRINT19_JSON,
DC2C_PRINT20_JSON,
DC2C_PRINT21_JSON,
DC2C_PRINT22_JSON,
DC2C_PRINT23_JSON,
DC2C_PRINT24_JSON,
DC2C_PRINT25_JSON,
DC2C_PRINT26_JSON,
DC2C_PRINT27_JSON,
DC2C_PRINT28_JSON,
DC2C_PRINT29_JSON,
DC2C_PRINT30_JSON,
DC2C_PRINT31_JSON,
DC2C_PRINT32_JSON,
};
QString sendLastVersion(UPDATE_COMPONENT comp, PSAInstalled const &psa);
#endif
private: private:
static void printDebugMessage(int port, QString const &clientIP, int clientPort, static void printDebugMessage(int port, QString const &clientIP, int clientPort,
QString const &message); QString const &message);