From 750e7a13f7ad87a7dc7d2ee418235bc7a6da731b Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 11 Apr 2023 15:39:08 +0200 Subject: [PATCH] remove obsolete files --- bootloader.cpp | 0 bootloader.h | 0 commands_to_update_dc.cpp | 84 --------------------------------------- commands_to_update_dc.h | 24 ----------- handle_binary_dc_file.cpp | 0 handle_binary_dc_file.h | 0 load_dc_plugin.cpp | 40 ------------------- load_dc_plugin.h | 18 --------- serial.cpp | 33 --------------- serial.h | 22 ---------- 10 files changed, 221 deletions(-) delete mode 100644 bootloader.cpp delete mode 100644 bootloader.h delete mode 100644 commands_to_update_dc.cpp delete mode 100644 commands_to_update_dc.h delete mode 100644 handle_binary_dc_file.cpp delete mode 100644 handle_binary_dc_file.h delete mode 100644 load_dc_plugin.cpp delete mode 100644 load_dc_plugin.h delete mode 100644 serial.cpp delete mode 100644 serial.h diff --git a/bootloader.cpp b/bootloader.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/bootloader.h b/bootloader.h deleted file mode 100644 index e69de29..0000000 diff --git a/commands_to_update_dc.cpp b/commands_to_update_dc.cpp deleted file mode 100644 index bbc0712..0000000 --- a/commands_to_update_dc.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "commands_to_update_dc.h" -#include "plugins/interfaces.h" - -#include -#include -#include - -Command::Command(hwinf const *hw) - : m_hw(hw) - , m_serial(hw, 115200, "115200", "ttyUSB0") { - qDebug() << "opening serial..."; - m_serial.openSerial(); -} - -Command::~Command() { - qDebug() << "close serial..."; - m_serial.closeSerial(); - QCoreApplication::quit(); -} - -bool Command::startCmdSequence() { - QThread::sleep(3); - qDebug() << "updating dc-fw..."; - if (!resetDeviceController()) { - qCritical() << "resetDeviceController failed"; - return false; - } - - QThread::sleep(10); - return true; - - if (!enterBootloader()) { - // after max. 3 seconds start boot loader - qCritical() << "enterBootloader failed"; - return false; - } - - if (!isBootloaderRunning()) { - qCritical() << "isBootloaderRunning failed"; - return false; - } - - //if (!loadBinary()) { -// -// } - - // if (!sendBinary()) { -// -// } - - if (!exitBootloader()) { - qCritical() << "exitBootloader failed"; - return false; - } - - qDebug() << "updating dc-fw...done"; - return true; -} - -bool Command::resetDeviceController() { - qDebug() << __func__; - m_hw->dc_OrderToReset(); - return true; -} - -bool Command::enterBootloader() { -return false; -} - -bool Command::isBootloaderRunning() { -return false; -} - -bool Command::loadBinary() { -return false; -} - -bool Command::sendBinary() { -return false; -} - -bool Command::exitBootloader() { -return false; -} diff --git a/commands_to_update_dc.h b/commands_to_update_dc.h deleted file mode 100644 index a7fd360..0000000 --- a/commands_to_update_dc.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef COMMANDS_TO_UPDATE_DC_H_INCLUDED -#define COMMANDS_TO_UPDATE_DC_H_INCLUDED - -#include "serial.h" - -class hwinf; -class Command { - hwinf const *m_hw; - Serial m_serial; -public: - Command(hwinf const *hw); - ~Command(); - - bool startCmdSequence(); - - bool resetDeviceController(); - bool enterBootloader(); - bool isBootloaderRunning(); - bool loadBinary(); - bool sendBinary(); - bool exitBootloader(); -}; - -#endif // COMMANDS_TO_UPDATE_DC_H_INCLUDED diff --git a/handle_binary_dc_file.cpp b/handle_binary_dc_file.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/handle_binary_dc_file.h b/handle_binary_dc_file.h deleted file mode 100644 index e69de29..0000000 diff --git a/load_dc_plugin.cpp b/load_dc_plugin.cpp deleted file mode 100644 index d985750..0000000 --- a/load_dc_plugin.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "load_dc_plugin.h" - -#include -#include -#include -#include - -#include "plugins/interfaces.h" - -DCPlugin::DCPlugin() - : m_hw_interface(0) { -} - -DCPlugin::~DCPlugin() { -} - -hwinf const *DCPlugin::loadPlugin() { - QString pluginPath = QCoreApplication::applicationDirPath() + "/plugins/"; - QString pluginFileName = pluginPath + "libCashAgentLib.so"; - - QPluginLoader *pluginLoader = new QPluginLoader(pluginFileName); - - if (!pluginLoader->load()) { - qFatal(pluginLoader->errorString().toStdString().c_str()); - } - - qDebug() <<"loaded plugin: " << pluginLoader->fileName(); - - QObject *plugin = pluginLoader->instance(); - if (!plugin) { - qFatal("cannot load root component of plugin (hwinf ctor failing?"); - } - - // the plugin stays in memory until unloaded by the application - if ((m_hw_interface = qobject_cast(plugin)) == nullptr) { - qFatal("cannot create root component"); - } - - return m_hw_interface; -} diff --git a/load_dc_plugin.h b/load_dc_plugin.h deleted file mode 100644 index 1e7b0bd..0000000 --- a/load_dc_plugin.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef LOAD_DC_PLUGIN_H_INCLUDED -#define LOAD_DC_PLUGIN_H_INCLUDED - -#include -#include - -class hwinf; -class DCPlugin : public QObject { - Q_OBJECT - hwinf *m_hw_interface; -public: - DCPlugin(); - ~DCPlugin(); - - hwinf const *loadPlugin(); -}; - -#endif // LOAD_DC_PLUGIN_H_INCLUDED diff --git a/serial.cpp b/serial.cpp deleted file mode 100644 index e17a53c..0000000 --- a/serial.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "serial.h" -#include "plugins/interfaces.h" - -#include - -Serial::Serial(hwinf const *hwinf, uint32_t baudrate, QString baudrateStr, - QString comPort) - : m_hwinf(hwinf) - , m_baudrate(baudrate) - , m_baudrateStr(baudrateStr) - , m_comPort(comPort) { - -} - -bool Serial::testConnection() { - m_hwinf->dc_requTestResponse(); - return true; -} - -bool Serial::openSerial() { // 1: connect - // sollte einen bool zureuckgeben - m_baudrate = 5; - m_comPort = "ttyUSB0"; - qDebug() << "winComPort opening serial with: " << m_baudrate << " " << m_baudrateStr << " " << m_comPort; - m_hwinf->dc_openSerial(5, m_baudrateStr, m_comPort, 1); - //m_hwinf->dc_openSerial(m_baudrate, m_baudrateStr, m_comPort, 1); - return true; -} - -bool Serial::closeSerial() { - m_hwinf->dc_closeSerial(); - return true; -} diff --git a/serial.h b/serial.h deleted file mode 100644 index fcff1fc..0000000 --- a/serial.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef SERIAL_H_INCLUDED -#define SERIAL_H_INCLUDED - -#include -#include - -class hwinf; -class Serial { - hwinf const *m_hwinf; - uint32_t m_baudrate; - QString m_baudrateStr; - QString m_comPort; -public: - Serial(hwinf const *hwinf, uint32_t baudrate, QString baudrateStr, - QString comPort); - - bool openSerial(); - bool testConnection(); - bool closeSerial(); -}; - -#endif // SERIAL_H_INCLUDED