- non functional
This commit is contained in:
parent
9d51646260
commit
a032bc3f04
2
main.cpp
2
main.cpp
@ -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[])
|
||||||
{
|
{
|
||||||
|
1
plugins/libzigatebackend.so.1.0.0
Symbolic link
1
plugins/libzigatebackend.so.1.0.0
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/home/daniel/develop/zigbee/build-zigatebackend-Qt_5_15_7_qt5-Debug/libzigatebackend.so.1.0.0
|
@ -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
|
||||||
|
@ -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();
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user