From a032bc3f043e27bdc51c291b3ed4ebc60c2ae58a Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sat, 13 May 2023 21:04:08 +0200 Subject: [PATCH] - non functional --- main.cpp | 2 +- plugins/libzigatebackend.so.1.0.0 | 1 + zigbeeManagerinterface.h | 4 ++-- zigbeemanager.cpp | 4 +++- zigbeemanager.h | 8 +++++--- 5 files changed, 12 insertions(+), 7 deletions(-) create mode 120000 plugins/libzigatebackend.so.1.0.0 diff --git a/main.cpp b/main.cpp index 309c392..664d5b8 100644 --- a/main.cpp +++ b/main.cpp @@ -4,7 +4,7 @@ using namespace std; //int debugLevel = DEBUG | INFO | WARNING | ERROR; -QMap backends; +QMap plugins; int main(int argc, char *argv[]) { diff --git a/plugins/libzigatebackend.so.1.0.0 b/plugins/libzigatebackend.so.1.0.0 new file mode 120000 index 0000000..4ab0585 --- /dev/null +++ b/plugins/libzigatebackend.so.1.0.0 @@ -0,0 +1 @@ +/home/daniel/develop/zigbee/build-zigatebackend-Qt_5_15_7_qt5-Debug/libzigatebackend.so.1.0.0 \ No newline at end of file diff --git a/zigbeeManagerinterface.h b/zigbeeManagerinterface.h index 5c3e18f..9a2772f 100644 --- a/zigbeeManagerinterface.h +++ b/zigbeeManagerinterface.h @@ -3,13 +3,13 @@ #include #include +#include class ZigbeeManagerInterface { public: virtual ~ZigbeeManagerInterface() = default; - virtual bool initBackend(); - + virtual bool initPlugin(); }; QT_BEGIN_NAMESPACE diff --git a/zigbeemanager.cpp b/zigbeemanager.cpp index e7d2317..f4ebb9a 100644 --- a/zigbeemanager.cpp +++ b/zigbeemanager.cpp @@ -1,8 +1,10 @@ #include "zigbeemanager.h" +#include "zigbeeManagerinterface.h" #include #include using namespace std; +class ZigbeeManagerInterface; ZigbeeManager::ZigbeeManager() { @@ -27,7 +29,7 @@ bool ZigbeeManager::loadPlugins() zigbeeManagerInterface = qobject_cast(plugin); if (zigbeeManagerInterface) { - zigbeeManagerInterface->initBackend(); + zigbeeManagerInterface->initPlugin(); return true; } pluginLoader.unload(); diff --git a/zigbeemanager.h b/zigbeemanager.h index 576608c..cf86290 100644 --- a/zigbeemanager.h +++ b/zigbeemanager.h @@ -18,6 +18,8 @@ //#include "library.h" #include "zigbeeManagerinterface.h" +class ZigbeeManagerInterface; + class ZigbeeManager : public QObject { Q_OBJECT @@ -26,17 +28,17 @@ public: ZigbeeManager(); private: + ZigbeeManagerInterface *zigbeeManagerInterface; bool loadPlugins(); - ZigbeeManagerInterface *zigbeeManagerInterface; }; -class BackEnds +class Plugins { public: QString name; QString device; - QVariant backend; + QVariant plugin; };