From 744ad52c89c05df82d8bcf43b8393f9aadc5a4ab Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 18 Feb 2025 15:25:03 +0100 Subject: [PATCH] Start ATBUpdateSync --- Sync/Sync.pro | 16 +++++++++++++--- Sync/main.cpp | 22 ++++++++++++++++++++++ common/include/utils_internal.h | 4 ++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Sync/Sync.pro b/Sync/Sync.pro index c5e9a78..2cd4c06 100644 --- a/Sync/Sync.pro +++ b/Sync/Sync.pro @@ -1,6 +1,6 @@ QT += core -TARGET = update_sync_cust_repo +TARGET = ATBUpdateSync VERSION="1.0.0" win32 { @@ -64,9 +64,19 @@ contains( CONFIG, DesktopLinux ) { } SOURCES += \ - main.cpp + main.cpp \ + message_handler.cpp \ + ../common/src/utils_internal.cpp \ + ../common/src/command.cpp \ + sync_command.cpp -# HEADERS += \ + + +HEADERS += \ + message_handler.h \ + ../common/include/utils_internal.h \ + ../common/include/command.h \ + sync_command.h ########################################################################################## # for running program on target through QtCreator diff --git a/Sync/main.cpp b/Sync/main.cpp index 627d253..b07213e 100644 --- a/Sync/main.cpp +++ b/Sync/main.cpp @@ -9,6 +9,28 @@ #include #include +#include "message_handler.h" +#include "utils_internal.h" +#include "sync_command.h" + int main(int argc, char **argv) { + + QByteArray const value = qgetenv("LC_ALL"); + if (value.isEmpty() || value != "C") { + qputenv("LC_ALL", "C"); + } + + openlog("ATB-UPDATE-SYNC", LOG_PERROR | LOG_PID | LOG_CONS, LOG_USER); + + QCoreApplication a(argc, argv); + QCoreApplication::setApplicationName("ATBUpdateSync"); + QCoreApplication::setApplicationVersion(APP_VERSION); + + if (!messageHandlerInstalled()) { // change internal qt-QDebug-handling + atbInstallMessageHandler(nullptr); + //atbInstallMessageHandler(atbDebugOutput); + setDebugLevel(LOG_NOTICE); + } + return 0; } diff --git a/common/include/utils_internal.h b/common/include/utils_internal.h index f32ebf8..eaf3c75 100644 --- a/common/include/utils_internal.h +++ b/common/include/utils_internal.h @@ -26,6 +26,10 @@ namespace internal { static constexpr const char *UPDATE_DC_FIRMARE_SUCCESS{"success"}; static constexpr const char *OPKG_MARKER{""}; + static constexpr const char *SYNC_MARKER{""}; + static constexpr const char *DC_MARKER{""}; + static constexpr const char *GIT_MARKER{""}; + static constexpr const char *ISMAS_MARKER{""}; int read1stLineOfFile(QString fileName); QString customerRepoRoot();