1
0

- non functional

This commit is contained in:
Daniel Tartavel 2023-05-13 21:04:08 +02:00
parent 9d51646260
commit a032bc3f04
5 changed files with 12 additions and 7 deletions

View File

@ -4,7 +4,7 @@
using namespace std; using namespace std;
//int debugLevel = DEBUG | INFO | WARNING | ERROR; //int debugLevel = DEBUG | INFO | WARNING | ERROR;
QMap <QString, BackEnds> backends; QMap <QString, Plugins> plugins;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {

View File

@ -0,0 +1 @@
/home/daniel/develop/zigbee/build-zigatebackend-Qt_5_15_7_qt5-Debug/libzigatebackend.so.1.0.0

View File

@ -3,13 +3,13 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QtPlugin>
class ZigbeeManagerInterface class ZigbeeManagerInterface
{ {
public: public:
virtual ~ZigbeeManagerInterface() = default; virtual ~ZigbeeManagerInterface() = default;
virtual bool initBackend(); virtual bool initPlugin();
}; };
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -1,8 +1,10 @@
#include "zigbeemanager.h" #include "zigbeemanager.h"
#include "zigbeeManagerinterface.h"
#include <QDir> #include <QDir>
#include <QPluginLoader> #include <QPluginLoader>
using namespace std; using namespace std;
class ZigbeeManagerInterface;
ZigbeeManager::ZigbeeManager() ZigbeeManager::ZigbeeManager()
{ {
@ -27,7 +29,7 @@ bool ZigbeeManager::loadPlugins()
zigbeeManagerInterface = qobject_cast<ZigbeeManagerInterface *>(plugin); zigbeeManagerInterface = qobject_cast<ZigbeeManagerInterface *>(plugin);
if (zigbeeManagerInterface) if (zigbeeManagerInterface)
{ {
zigbeeManagerInterface->initBackend(); zigbeeManagerInterface->initPlugin();
return true; return true;
} }
pluginLoader.unload(); pluginLoader.unload();

View File

@ -18,6 +18,8 @@
//#include "library.h" //#include "library.h"
#include "zigbeeManagerinterface.h" #include "zigbeeManagerinterface.h"
class ZigbeeManagerInterface;
class ZigbeeManager : public QObject class ZigbeeManager : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -26,17 +28,17 @@ public:
ZigbeeManager(); ZigbeeManager();
private: private:
ZigbeeManagerInterface *zigbeeManagerInterface;
bool loadPlugins(); bool loadPlugins();
ZigbeeManagerInterface *zigbeeManagerInterface;
}; };
class BackEnds class Plugins
{ {
public: public:
QString name; QString name;
QString device; QString device;
QVariant backend; QVariant plugin;
}; };