Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
8a564b9538
|
|||
|
d5e62e72d3
|
|||
|
0155d51d3d
|
|||
|
843ac23770
|
|||
|
c3b2db7797
|
|||
|
51640b70e9
|
|||
|
be84c96953
|
|||
|
24bf190c90
|
|||
|
b656b5eab6
|
|||
|
6681e61f59
|
|||
|
7ec6ab00b1
|
@@ -9,7 +9,7 @@ psa-tariff-directory="etc/psa_tariff/"
|
||||
|
||||
|
||||
[PLUGINS]
|
||||
plugin-name="libCAslave.so"
|
||||
plugin-name="libCAmaster.so"
|
||||
|
||||
[FLAGS]
|
||||
no-psa-hardware-update=false
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
SUBDIRS = DownloadDCFirmware DownloadDCJsonFiles UpdatePTUDevCtrl
|
||||
#SUBDIRS = DownloadDCFirmware DownloadDCJsonFiles UpdatePTUDevCtrl
|
||||
SUBDIRS = UpdatePTUDevCtrl
|
||||
|
||||
@@ -2,6 +2,9 @@ QT += core serialport
|
||||
|
||||
TARGET = ATBUpdateDC
|
||||
|
||||
include(../common.pri)
|
||||
|
||||
|
||||
VERSION="0.1.0"
|
||||
win32 {
|
||||
BUILD_DATE=$$system("date /t")
|
||||
@@ -98,6 +101,9 @@ OTHER_FILES += \
|
||||
../ATBUpdateTool.ini
|
||||
|
||||
|
||||
FORMS += \
|
||||
mainwindow.ui
|
||||
|
||||
##########################################################################################
|
||||
# for running program on target through QtCreator
|
||||
contains( CONFIG, PTU5 ) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QByteArray>
|
||||
|
||||
#include <QProcess>
|
||||
#include <QCommandLineParser>
|
||||
#include <QStandardPaths>
|
||||
#include <QSettings>
|
||||
#include <QDir>
|
||||
@@ -64,7 +65,9 @@ int main(int argc, char **argv) {
|
||||
setDebugLevel(LOG_NOTICE);
|
||||
}
|
||||
|
||||
/*
|
||||
//return 0;
|
||||
|
||||
/*
|
||||
CommandLineParser parser;
|
||||
parser.process(a);
|
||||
parser.readSettings();
|
||||
@@ -126,13 +129,21 @@ int main(int argc, char **argv) {
|
||||
printf(APP_EXTENDED_VERSION"\n");
|
||||
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 noaction = true;
|
||||
QString workingDir;
|
||||
QString libDir;
|
||||
QString libca;
|
||||
QString workingDir;
|
||||
|
||||
std::unique_ptr<QSettings> settings = internal::readSettings();
|
||||
|
||||
@@ -151,37 +162,37 @@ int main(int argc, char **argv) {
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
// etc/dc: located under mount-path
|
||||
std::optional<QString> mountPath = System::checkForUSBStick(psaDcDir);
|
||||
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 {
|
||||
|
||||
// ------------------- single command line argument is DC-firmware binary file -----------------
|
||||
QStringList args = a.arguments();
|
||||
if (args.size() != 2) {
|
||||
qCritical() << "ERROR: missing parameter <dc-firmware>";
|
||||
exit(1);
|
||||
if (debug) {
|
||||
qInfo() << "using customer repository" << psaRepoDir;
|
||||
}
|
||||
|
||||
std::unique_ptr<QString> c = internal::dcCandidateToInstall("/etc/dc/");
|
||||
if (c) {
|
||||
fi.setFile(*c);
|
||||
if (fi.exists() == false) {
|
||||
qCritical() << "dc2c.bin candidate" << *c << "does not exist. STOP.";
|
||||
return -1;
|
||||
}
|
||||
qInfo() << "dc2c.bin canditate" << fi.absoluteFilePath();
|
||||
}
|
||||
}
|
||||
|
||||
qCritical() << "------------------------------------------------------";
|
||||
qCritical() << "main: argument dc-firmware: " << args.at(1);
|
||||
qCritical() << "------------------------------------------------------";
|
||||
|
||||
fi.setFile(args.at(1));
|
||||
|
||||
if (!fi.isFile()) {
|
||||
qCritical() << "ERROR: parameter " << fi.absoluteFilePath() << " is not a file";
|
||||
exit(1);
|
||||
if (debug) {
|
||||
qInfo() << "downloading dc-firmware" << fi.absoluteFilePath();
|
||||
qInfo() << "dc-firmware size (bytes)" << fi.size();
|
||||
qInfo() << "dc-version" << Update::dcVersion(fi.absoluteFilePath());
|
||||
}
|
||||
|
||||
if (!fi.isReadable()) {
|
||||
qCritical() << "ERROR: parameter " << fi.absoluteFilePath() << " is not readable";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
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);
|
||||
u.run();
|
||||
|
||||
|
||||
@@ -397,7 +397,9 @@ int Update::run() {
|
||||
qInfo() << "<DC-VERSION>" << Update::dcVersion(m_dcFileName);
|
||||
}
|
||||
|
||||
m_hw->dc_autoRequest(false);
|
||||
if (!m_debug) {
|
||||
m_hw->dc_autoRequest(false);
|
||||
}
|
||||
|
||||
qInfo() << "DC auto request OFF";
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
QT += core
|
||||
QT += serialport network
|
||||
|
||||
include(../common.pri)
|
||||
|
||||
TARGET = ATBDownloadDCJsonFiles
|
||||
|
||||
VERSION="0.1.0"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
QT += core gui
|
||||
QT += widgets serialport network
|
||||
|
||||
include(../common.pri)
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = ATBUpdateTool
|
||||
@@ -150,7 +152,10 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# 1.5.7 : Add support for dynamic portrait / landscape.
|
||||
# 1.5.8 : Use EVENT_ID=<pid of update-tool> for CMD_EVENT.
|
||||
# 1.5.9 : Removed restart of Apism if ISMAS unreachable.
|
||||
VERSION="1.5.9"
|
||||
# 1.5.99 : Special version for 281/Szeged: remove all DC-library dependencies, as
|
||||
# DC-firmware in Szeged does not support uploading json-files or uploading
|
||||
# DC-firmware binaries.
|
||||
VERSION="1.5.99"
|
||||
# PLANNED TODOS:
|
||||
# 1: Das Repository wird repariert bwz. neu geklont. Unabhaengig vom WAIT.
|
||||
# 2: Wenn der WAIT-Button aktiv ist, dann wird ein Repository repariert (neu
|
||||
@@ -256,9 +261,6 @@ contains( CONFIG, PTU5_YOCTO ) {
|
||||
PTU5BASEPATH = /opt/devel/ptu5
|
||||
ARCH = PTU5
|
||||
DEFINES+=PTU5
|
||||
|
||||
LIBS += -lCAslave
|
||||
LIBS += -lCAmaster
|
||||
}
|
||||
contains( CONFIG, DesktopLinux ) {
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += serialport
|
||||
|
||||
@@ -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"
|
||||
|
||||
... 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
|
||||
|
||||
leads to the following warning/error message:
|
||||
|
||||
@@ -40,6 +40,7 @@ QPluginLoader Update::pluginLoader;
|
||||
|
||||
hwinf *Update::loadDCPlugin(QDir const &plugInDir, QString const &fname) {
|
||||
hwinf *hw = nullptr;
|
||||
#if 0
|
||||
if (plugInDir.exists()) {
|
||||
QString pluginLibName(fname);
|
||||
pluginLibName = plugInDir.absoluteFilePath(pluginLibName);
|
||||
@@ -74,6 +75,7 @@ hwinf *Update::loadDCPlugin(QDir const &plugInDir, QString const &fname) {
|
||||
qCritical() << "plugins directory" << plugInDir.absolutePath()
|
||||
<< "does not exist";
|
||||
}
|
||||
#endif
|
||||
return hw;
|
||||
}
|
||||
|
||||
@@ -117,6 +119,7 @@ Update::Update(Worker *worker,
|
||||
, m_dryRun(dryRun)
|
||||
, m_sys_areDCdataValid(false) {
|
||||
|
||||
#if 0
|
||||
if (!m_hw) {
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_hw == nullptr -> ca-slave plugin not loaded";
|
||||
} else {
|
||||
@@ -134,6 +137,7 @@ Update::Update(Worker *worker,
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << ") m_sys_areDCDataValid ..."
|
||||
<< m_sys_areDCdataValid;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Update::~Update() {
|
||||
@@ -606,6 +610,8 @@ QString Update::getFileVersion(QString const& jsonFileName) {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -679,14 +685,14 @@ bool Update::checkDownloadedJsonVersions(QStringList const& jsonFileNames) {
|
||||
qCritical() << "CANNOT FIND JSON-NR FOR" << fName;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
QMap<QString, QString>
|
||||
Update::getInstalledJsonVersions(QStringList const& jsonFileNames) {
|
||||
QMap<QString, QString> map;
|
||||
|
||||
#if 0
|
||||
if (!m_hw) {
|
||||
qCritical() << "(" << __func__ << ":" << __LINE__ << "):"
|
||||
<< "ERROR!!! m_hw == nullptr";
|
||||
@@ -786,6 +792,7 @@ Update::getInstalledJsonVersions(QStringList const& jsonFileNames) {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,9 +178,6 @@ QString Utils::zoneName(quint8 i) {
|
||||
//if (i < (sizeof(zName)/sizeof(char const *))) {
|
||||
// return zName[i];
|
||||
//}
|
||||
|
||||
Q_UNUSED(i)
|
||||
|
||||
return "---";
|
||||
}
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@ void Worker::privateUpdate() {
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
//return;
|
||||
|
||||
QString func(__PRETTY_FUNCTION__);
|
||||
|
||||
@@ -541,9 +541,10 @@ void Worker::privateUpdate() {
|
||||
// UPDATE THE PSA USING THE CHANGED FILES
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
if ((continueUpdate = downloadFilesToPSAHardware()) == false) {
|
||||
return;
|
||||
}
|
||||
// for 281/Szeged: skip uploading files to DeviceController
|
||||
//if ((continueUpdate = downloadFilesToPSAHardware()) == false) {
|
||||
// return;
|
||||
//}
|
||||
lst = QStringList(QString("DONE"));
|
||||
ISMAS(lst) << (GUI(lst) << (CONSOLE(lst) << UPDATE_STEP::DOWNLOAD_FILES_TO_PSA_HARDWARE_SUCCESS));
|
||||
|
||||
|
||||
1
common.pri
Normal file
1
common.pri
Normal file
@@ -0,0 +1 @@
|
||||
INCLUDEPATH += $$PWD/common/include
|
||||
1427
common/include/DeviceController/interfaces.h
Normal file
1427
common/include/DeviceController/interfaces.h
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user