Compare commits

..

7 Commits

Author SHA1 Message Date
f37d6c9128 Merge branch 'pu/ATBUpdateDC_CommandLineParameter' 2026-02-16 16:30:27 +01:00
0464c2ec74 ATBDownloadDC: need single argument: bin-file name 2026-02-16 16:29:57 +01:00
a1ad4a6605 Resolve compiler warnings 2026-02-12 11:50:09 +01:00
ada6da5b5b Merge branch 'includeNewATBUpdateDC' 2026-02-11 10:30:53 +01:00
f7b3344292 main: use configuration for setting variables ...
-> remove wrong default values.
 -> remove dependency for certain host-names
2026-02-10 14:31:18 +01:00
12d65bf372 commandline_parser: add options ...
for sshKeyFile and StrictHostKeyChecking.
Set correct default values.
2026-02-10 14:31:11 +01:00
de1bf61e7c git-client: add note about GIT_SSH_COMMAND env variants 2026-02-10 14:31:02 +01:00
13 changed files with 45 additions and 1502 deletions

View File

@@ -9,7 +9,7 @@ psa-tariff-directory="etc/psa_tariff/"
[PLUGINS] [PLUGINS]
plugin-name="libCAmaster.so" plugin-name="libCAslave.so"
[FLAGS] [FLAGS]
no-psa-hardware-update=false no-psa-hardware-update=false

View File

@@ -1,4 +1,3 @@
TEMPLATE = subdirs TEMPLATE = subdirs
CONFIG += ordered CONFIG += ordered
#SUBDIRS = DownloadDCFirmware DownloadDCJsonFiles UpdatePTUDevCtrl SUBDIRS = DownloadDCFirmware DownloadDCJsonFiles UpdatePTUDevCtrl
SUBDIRS = UpdatePTUDevCtrl

View File

@@ -2,9 +2,6 @@ QT += core serialport
TARGET = ATBUpdateDC TARGET = ATBUpdateDC
include(../common.pri)
VERSION="0.1.0" VERSION="0.1.0"
win32 { win32 {
BUILD_DATE=$$system("date /t") BUILD_DATE=$$system("date /t")
@@ -101,9 +98,6 @@ OTHER_FILES += \
../ATBUpdateTool.ini ../ATBUpdateTool.ini
FORMS += \
mainwindow.ui
########################################################################################## ##########################################################################################
# for running program on target through QtCreator # for running program on target through QtCreator
contains( CONFIG, PTU5 ) { contains( CONFIG, PTU5 ) {

View File

@@ -4,7 +4,6 @@
#include <QByteArray> #include <QByteArray>
#include <QProcess> #include <QProcess>
#include <QCommandLineParser>
#include <QStandardPaths> #include <QStandardPaths>
#include <QSettings> #include <QSettings>
#include <QDir> #include <QDir>
@@ -65,9 +64,7 @@ int main(int argc, char **argv) {
setDebugLevel(LOG_NOTICE); setDebugLevel(LOG_NOTICE);
} }
//return 0; /*
/*
CommandLineParser parser; CommandLineParser parser;
parser.process(a); parser.process(a);
parser.readSettings(); parser.readSettings();
@@ -129,21 +126,13 @@ int main(int argc, char **argv) {
printf(APP_EXTENDED_VERSION"\n"); printf(APP_EXTENDED_VERSION"\n");
return 0; return 0;
} }
*/
QString const &customerRepo
= QDir::cleanPath(workingDir + QDir::separator() + QString("customer_%1").arg(customerNr));
*/
QString const &psaDcDir = internal::customerRepoDcDir();
QString const &psaRepoRootDir = internal::customerRepoRoot();
QString const &psaRepoDir = internal::customerRepoDir();
QString const &branchName = internal::branchName();
bool debug = false; bool debug = false;
bool noaction = true; bool noaction = true;
QString workingDir;
QString libDir; QString libDir;
QString libca; QString libca;
QString workingDir;
std::unique_ptr<QSettings> settings = internal::readSettings(); std::unique_ptr<QSettings> settings = internal::readSettings();
@@ -162,37 +151,37 @@ int main(int argc, char **argv) {
settings->endGroup(); settings->endGroup();
} }
// etc/dc: located under mount-path
std::optional<QString> mountPath = System::checkForUSBStick(psaDcDir);
QFileInfo fi; QFileInfo fi;
if (mountPath.has_value()) {
fi.setFile(mountPath.value(), System::getDCFileOnUsbStick(mountPath.value()));
} else
if ((mountPath = System::checkForSDCard(psaDcDir)).has_value()) {
fi.setFile(mountPath.value(), System::getDCFileOnSDCard(mountPath.value()));
} else {
if (debug) { // ------------------- single command line argument is DC-firmware binary file -----------------
qInfo() << "using customer repository" << psaRepoDir; QStringList args = a.arguments();
if (args.size() != 2) {
qCritical() << "ERROR: missing parameter <dc-firmware>";
exit(1);
} }
std::unique_ptr<QString> c = internal::dcCandidateToInstall("/etc/dc/"); qCritical() << "------------------------------------------------------";
if (c) { qCritical() << "main: argument dc-firmware: " << args.at(1);
fi.setFile(*c); qCritical() << "------------------------------------------------------";
if (fi.exists() == false) {
qCritical() << "dc2c.bin candidate" << *c << "does not exist. STOP."; fi.setFile(args.at(1));
return -1;
} if (!fi.isFile()) {
qInfo() << "dc2c.bin canditate" << fi.absoluteFilePath(); qCritical() << "ERROR: parameter " << fi.absoluteFilePath() << " is not a file";
} exit(1);
} }
if (debug) { if (!fi.isReadable()) {
qInfo() << "downloading dc-firmware" << fi.absoluteFilePath(); qCritical() << "ERROR: parameter " << fi.absoluteFilePath() << " is not readable";
qInfo() << "dc-firmware size (bytes)" << fi.size(); exit(1);
qInfo() << "dc-version" << Update::dcVersion(fi.absoluteFilePath());
} }
qCritical() << "------------------------------------------------------";
qCritical() << "uploading dc-firmware" << fi.absoluteFilePath();
qCritical() << "dc-firmware size (bytes)" << fi.size();
qCritical() << "dc-version" << Update::dcVersion(fi.absoluteFilePath());
qCritical() << "------------------------------------------------------";
Update u(fi.absoluteFilePath(), libca, debug, noaction); Update u(fi.absoluteFilePath(), libca, debug, noaction);
u.run(); u.run();

View File

@@ -397,9 +397,7 @@ int Update::run() {
qInfo() << "<DC-VERSION>" << Update::dcVersion(m_dcFileName); qInfo() << "<DC-VERSION>" << Update::dcVersion(m_dcFileName);
} }
if (!m_debug) {
m_hw->dc_autoRequest(false); m_hw->dc_autoRequest(false);
}
qInfo() << "DC auto request OFF"; qInfo() << "DC auto request OFF";

View File

@@ -1,8 +1,6 @@
QT += core QT += core
QT += serialport network QT += serialport network
include(../common.pri)
TARGET = ATBDownloadDCJsonFiles TARGET = ATBDownloadDCJsonFiles
VERSION="0.1.0" VERSION="0.1.0"

View File

@@ -1,8 +1,6 @@
QT += core gui QT += core gui
QT += widgets serialport network QT += widgets serialport network
include(../common.pri)
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = ATBUpdateTool TARGET = ATBUpdateTool
@@ -152,10 +150,7 @@ DEFINES += QT_DEPRECATED_WARNINGS
# 1.5.7 : Add support for dynamic portrait / landscape. # 1.5.7 : Add support for dynamic portrait / landscape.
# 1.5.8 : Use EVENT_ID=<pid of update-tool> for CMD_EVENT. # 1.5.8 : Use EVENT_ID=<pid of update-tool> for CMD_EVENT.
# 1.5.9 : Removed restart of Apism if ISMAS unreachable. # 1.5.9 : Removed restart of Apism if ISMAS unreachable.
# 1.5.99 : Special version for 281/Szeged: remove all DC-library dependencies, as VERSION="1.5.9"
# DC-firmware in Szeged does not support uploading json-files or uploading
# DC-firmware binaries.
VERSION="1.5.99"
# PLANNED TODOS: # PLANNED TODOS:
# 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT. # 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT.
# 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu # 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu
@@ -261,6 +256,9 @@ contains( CONFIG, PTU5_YOCTO ) {
PTU5BASEPATH = /opt/devel/ptu5 PTU5BASEPATH = /opt/devel/ptu5
ARCH = PTU5 ARCH = PTU5
DEFINES+=PTU5 DEFINES+=PTU5
LIBS += -lCAslave
LIBS += -lCAmaster
} }
contains( CONFIG, DesktopLinux ) { contains( CONFIG, DesktopLinux ) {
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport greaterThan(QT_MAJOR_VERSION, 4): QT += serialport

View File

@@ -405,7 +405,7 @@ std::optional<QString> GitClient::gitPull() {
export GIT_SSH_COMMAND="ssh -i /opt/app/tools/atbupdate/.keys/id_ed25519_ptuConfig -o StrictHostKeyChecking=no" export GIT_SSH_COMMAND="ssh -i /opt/app/tools/atbupdate/.keys/id_ed25519_ptuConfig -o StrictHostKeyChecking=no"
... or use separate known_hosts file: ... or use separate known_hosts file:
export GIT_SSH_COMMAND="ssh -i /mypath/.keys/id_ed25519 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/opt/app/tools/atbupdate/.keys/known_hosts export GIT_SSH_COMMAND="ssh -i /mypath/.keys/id_ed25519 -o StrictHostKeyChecking=yes -o UserKnownHostsFile=/opt/app/tools/atbupdate/.keys/known_hosts"
git pull git pull
leads to the following warning/error message: leads to the following warning/error message:

View File

@@ -40,7 +40,6 @@ QPluginLoader Update::pluginLoader;
hwinf *Update::loadDCPlugin(QDir const &plugInDir, QString const &fname) { hwinf *Update::loadDCPlugin(QDir const &plugInDir, QString const &fname) {
hwinf *hw = nullptr; hwinf *hw = nullptr;
#if 0
if (plugInDir.exists()) { if (plugInDir.exists()) {
QString pluginLibName(fname); QString pluginLibName(fname);
pluginLibName = plugInDir.absoluteFilePath(pluginLibName); pluginLibName = plugInDir.absoluteFilePath(pluginLibName);
@@ -75,7 +74,6 @@ hwinf *Update::loadDCPlugin(QDir const &plugInDir, QString const &fname) {
qCritical() << "plugins directory" << plugInDir.absolutePath() qCritical() << "plugins directory" << plugInDir.absolutePath()
<< "does not exist"; << "does not exist";
} }
#endif
return hw; return hw;
} }
@@ -119,7 +117,6 @@ Update::Update(Worker *worker,
, m_dryRun(dryRun) , m_dryRun(dryRun)
, m_sys_areDCdataValid(false) { , m_sys_areDCdataValid(false) {
#if 0
if (!m_hw) { if (!m_hw) {
qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_hw == nullptr -> ca-slave plugin not loaded"; qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_hw == nullptr -> ca-slave plugin not loaded";
} else { } else {
@@ -137,7 +134,6 @@ Update::Update(Worker *worker,
qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..." qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..."
<< m_sys_areDCdataValid; << m_sys_areDCdataValid;
} }
#endif
} }
Update::~Update() { Update::~Update() {
@@ -610,8 +606,6 @@ QString Update::getFileVersion(QString const& jsonFileName) {
} }
bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) { bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) {
// note: 2026-02-09: this method is not used!
#if 0
for (QStringList::size_type i=0; i < jsonFileNames.size(); ++i) { for (QStringList::size_type i=0; i < jsonFileNames.size(); ++i) {
@@ -685,14 +679,14 @@ bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) {
qCritical() << "CANNOT FIND JSON-NR FOR" << fName; qCritical() << "CANNOT FIND JSON-NR FOR" << fName;
} }
} }
#endif
return false; return false;
} }
QMap<QString, QString> QMap<QString, QString>
Update::getInstalledJsonVersions(QStringList const& jsonFileNames) { Update::getInstalledJsonVersions(QStringList const& jsonFileNames) {
QMap<QString, QString> map; QMap<QString, QString> map;
#if 0
if (!m_hw) { if (!m_hw) {
qCritical() << "(" << __func__ << ":" << __LINE__ << "):" qCritical() << "(" << __func__ << ":" << __LINE__ << "):"
<< "ERROR!!! m_hw == nullptr"; << "ERROR!!! m_hw == nullptr";
@@ -792,7 +786,6 @@ Update::getInstalledJsonVersions(QStringList const& jsonFileNames) {
} }
} }
#endif
return map; return map;
} }

View File

@@ -178,6 +178,9 @@ QString Utils::zoneName(quint8 i) {
//if (i < (sizeof(zName)/sizeof(char const *))) { //if (i < (sizeof(zName)/sizeof(char const *))) {
// return zName[i]; // return zName[i];
//} //}
Q_UNUSED(i)
return "---"; return "---";
} }

View File

@@ -290,7 +290,7 @@ void Worker::privateUpdate() {
return; return;
} }
//return; return;
QString func(__PRETTY_FUNCTION__); QString func(__PRETTY_FUNCTION__);
@@ -541,10 +541,9 @@ void Worker::privateUpdate() {
// UPDATE THE PSA USING THE CHANGED FILES // UPDATE THE PSA USING THE CHANGED FILES
// //
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// for 281/Szeged: skip uploading files to DeviceController if ((continueUpdate = downloadFilesToPSAHardware()) == false) {
//if ((continueUpdate = downloadFilesToPSAHardware()) == false) { return;
// return; }
//}
lst = QStringList(QString("DONE")); lst = QStringList(QString("DONE"));
ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS)); ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS));

View File

@@ -1 +0,0 @@
INCLUDEPATH += $$PWD/common/include

File diff suppressed because it is too large Load Diff