diff --git a/serial.cpp b/serial.cpp index bd03dfa..3de7bf6 100644 --- a/serial.cpp +++ b/serial.cpp @@ -1,10 +1,10 @@ #include "serial.h" #include -#include "zigatebackend.h" +#include "zigateplugin.h" #include //extern QApplication a; -extern ZigateBackend zigateBkd; +extern ZigatePlugin zigateBkd; using namespace std; diff --git a/zigateInit.cpp b/zigateInit.cpp index 08c5020..248b8b0 100644 --- a/zigateInit.cpp +++ b/zigateInit.cpp @@ -1,15 +1,15 @@ -#include "zigatebackend.h" +#include "zigateplugin.h" #include "serial.h" - +#include "zigbeeManagerinterface.h" #include -extern ZigateBackend zigateBkd; +extern ZigatePlugin zigateBkd; extern SerialManager serialManager; extern QHash responseListIndex; using namespace std; -bool ZigateBackend::initBackend() +bool ZigatePlugin::initPlugin() { bool returnCode = false; QString var; diff --git a/zigatebackend_global.h b/zigatebackend_global.h deleted file mode 100644 index 24e8a56..0000000 --- a/zigatebackend_global.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef ZIGATEBACKEND_GLOBAL_H -#define ZIGATEBACKEND_GLOBAL_H - -#include - -#if defined(ZIGATEBACKEND_LIBRARY) -# define ZIGATEBACKEND_EXPORT Q_DECL_EXPORT -#else -# define ZIGATEBACKEND_EXPORT Q_DECL_IMPORT -#endif - -#endif // ZIGATEBACKEND_GLOBAL_H diff --git a/zigatecmd.cpp b/zigatecmd.cpp index eced250..5bc4e23 100644 --- a/zigatecmd.cpp +++ b/zigatecmd.cpp @@ -1,10 +1,10 @@ -#include "zigatebackend.h" +#include "zigateplugin.h" #include #include using namespace std; -bool ZigateBackend::resetCoordinator() +bool ZigatePlugin::resetCoordinator() { bool returnCode = false; @@ -15,452 +15,452 @@ bool ZigateBackend::resetCoordinator() return returnCode; } -void ZigateBackend::getVersion() +void ZigatePlugin::getVersion() { sendCmd("0010", ""); } /* -bool ZigateBackend::setHeartBeat() +bool ZigatePlugin::setHeartBeat() { } -bool ZigateBackend::getNetworkState() +bool ZigatePlugin::getNetworkState() { } -bool ZigateBackend::erasePersistentData() +bool ZigatePlugin::erasePersistentData() { } -bool ZigateBackend::factoryNewReset() +bool ZigatePlugin::factoryNewReset() { } -bool ZigateBackend::permitJoin() +bool ZigatePlugin::permitJoin() { } -bool ZigateBackend::setExpendedPANID() +bool ZigatePlugin::setExpendedPANID() { } -bool ZigateBackend::setChannelMask() +bool ZigatePlugin::setChannelMask() { } -bool ZigateBackend::setSecurityStateKey() +bool ZigatePlugin::setSecurityStateKey() { } -bool ZigateBackend::setDeviceType() +bool ZigatePlugin::setDeviceType() { } -bool ZigateBackend::startNetwork() +bool ZigatePlugin::startNetwork() { } -bool ZigateBackend::startNetworkScan() +bool ZigatePlugin::startNetworkScan() { } -bool ZigateBackend::removeDevice() +bool ZigatePlugin::removeDevice() { } -bool ZigateBackend::enablePermissionsControlledJoins() +bool ZigatePlugin::enablePermissionsControlledJoins() { } -bool ZigateBackend::authenticateDevice() +bool ZigatePlugin::authenticateDevice() { } -bool ZigateBackend::outOfBandCommissioningDataRequest() +bool ZigatePlugin::outOfBandCommissioningDataRequest() { } -bool ZigateBackend::userDescriptorSet() +bool ZigatePlugin::userDescriptorSet() { } -bool ZigateBackend::userDescriptorRequest() +bool ZigatePlugin::userDescriptorRequest() { } -bool ZigateBackend::bind() +bool ZigatePlugin::bind() { } -bool ZigateBackend::unbind() +bool ZigatePlugin::unbind() { } -bool ZigateBackend::complexDescriptorRequest() +bool ZigatePlugin::complexDescriptorRequest() { } -bool ZigateBackend::networkAddressRequest() +bool ZigatePlugin::networkAddressRequest() { } -bool ZigateBackend::iEEEAddressRequest() +bool ZigatePlugin::iEEEAddressRequest() { } -bool ZigateBackend::nodeDescriptorRequest() +bool ZigatePlugin::nodeDescriptorRequest() { } -bool ZigateBackend::simpleDescriptorRequest() +bool ZigatePlugin::simpleDescriptorRequest() { } -bool ZigateBackend::powerDescriptorRequest() +bool ZigatePlugin::powerDescriptorRequest() { } -bool ZigateBackend::activeEndpointRequest() +bool ZigatePlugin::activeEndpointRequest() { } -bool ZigateBackend::matchDescriptorRequest() +bool ZigatePlugin::matchDescriptorRequest() { } -bool ZigateBackend::managementLeaveRequest() +bool ZigatePlugin::managementLeaveRequest() { } -bool ZigateBackend::permitJoiningRequest() +bool ZigatePlugin::permitJoiningRequest() { } -bool ZigateBackend::managementNetworkUpdateRequest() +bool ZigatePlugin::managementNetworkUpdateRequest() { } -bool ZigateBackend::systemServerDiscoveryRequest() +bool ZigatePlugin::systemServerDiscoveryRequest() { } -bool ZigateBackend::managementLQIRequest() +bool ZigatePlugin::managementLQIRequest() { } -bool ZigateBackend::addGroup() +bool ZigatePlugin::addGroup() { } -bool ZigateBackend::viewGroup() +bool ZigatePlugin::viewGroup() { } -bool ZigateBackend::getGroupMembership() +bool ZigatePlugin::getGroupMembership() { } -bool ZigateBackend::removeGroup() +bool ZigatePlugin::removeGroup() { } -bool ZigateBackend::removeAllGroups() +bool ZigatePlugin::removeAllGroups() { } -bool ZigateBackend::addGroupIfIdentify() +bool ZigatePlugin::addGroupIfIdentify() { } -bool ZigateBackend::identifySend() +bool ZigatePlugin::identifySend() { } -bool ZigateBackend::identifyQuery() +bool ZigatePlugin::identifyQuery() { } -bool ZigateBackend::moveToLevel() +bool ZigatePlugin::moveToLevel() { } -bool ZigateBackend::moveToLevelWithWithoutOnOoff() +bool ZigatePlugin::moveToLevelWithWithoutOnOoff() { } -bool ZigateBackend::moveStep() +bool ZigatePlugin::moveStep() { } -bool ZigateBackend::moveStopMove() +bool ZigatePlugin::moveStopMove() { } -bool ZigateBackend::moveStopWithOnOff() +bool ZigatePlugin::moveStopWithOnOff() { } -bool ZigateBackend::onOffWithNEffects() +bool ZigatePlugin::onOffWithNEffects() { } -bool ZigateBackend::onOffWithEffects() +bool ZigatePlugin::onOffWithEffects() { } -bool ZigateBackend::onOffTimedSend() +bool ZigatePlugin::onOffTimedSend() { } -bool ZigateBackend::onOffTimed() +bool ZigatePlugin::onOffTimed() { } -bool ZigateBackend::onOffWithEffectsSend() +bool ZigatePlugin::onOffWithEffectsSend() { } -bool ZigateBackend::viewScene() +bool ZigatePlugin::viewScene() { } -bool ZigateBackend::addScene() +bool ZigatePlugin::addScene() { } -bool ZigateBackend::removeScene() +bool ZigatePlugin::removeScene() { } -bool ZigateBackend::removeAllScenes() +bool ZigatePlugin::removeAllScenes() { } -bool ZigateBackend::storeScene() +bool ZigatePlugin::storeScene() { } -bool ZigateBackend::recallScene() +bool ZigatePlugin::recallScene() { } -bool ZigateBackend::sceneMembershipRequest() +bool ZigatePlugin::sceneMembershipRequest() { } -bool ZigateBackend::addEnhancedScene() +bool ZigatePlugin::addEnhancedScene() { } -bool ZigateBackend::viewEnhancedHostToNodeScene() +bool ZigatePlugin::viewEnhancedHostToNodeScene() { } -bool ZigateBackend::copyScene() +bool ZigatePlugin::copyScene() { } -bool ZigateBackend::moveToHue() +bool ZigatePlugin::moveToHue() { } -bool ZigateBackend::moveHue() +bool ZigatePlugin::moveHue() { } -bool ZigateBackend::stepHue() +bool ZigatePlugin::stepHue() { } -bool ZigateBackend::moveToSaturation() +bool ZigatePlugin::moveToSaturation() { } -bool ZigateBackend::moveSaturation() +bool ZigatePlugin::moveSaturation() { } -bool ZigateBackend::stepSaturation() +bool ZigatePlugin::stepSaturation() { } -bool ZigateBackend::moveToHueAndSaturation() +bool ZigatePlugin::moveToHueAndSaturation() { } -bool ZigateBackend::moveToColour() +bool ZigatePlugin::moveToColour() { } -bool ZigateBackend::moveColour() +bool ZigatePlugin::moveColour() { } -bool ZigateBackend::stepColour() +bool ZigatePlugin::stepColour() { } -bool ZigateBackend::enhancedMoveToHue() +bool ZigatePlugin::enhancedMoveToHue() { } -bool ZigateBackend::enhancedMoveHue() +bool ZigatePlugin::enhancedMoveHue() { } -bool ZigateBackend::enhancedStepHue() +bool ZigatePlugin::enhancedStepHue() { } -bool ZigateBackend::enhancedMoveToHueAndSaturation() +bool ZigatePlugin::enhancedMoveToHueAndSaturation() { } -bool ZigateBackend::colourLoopSet() +bool ZigatePlugin::colourLoopSet() { } -bool ZigateBackend::stopMoveStep() +bool ZigatePlugin::stopMoveStep() { } -bool ZigateBackend::moveToColourTemperature() +bool ZigatePlugin::moveToColourTemperature() { } -bool ZigateBackend::moveColourTemperature() +bool ZigatePlugin::moveColourTemperature() { } -bool ZigateBackend::stepColourTemperature() +bool ZigatePlugin::stepColourTemperature() { } -bool ZigateBackend::initiateTouchlink() +bool ZigatePlugin::initiateTouchlink() { } -bool ZigateBackend::touchLinkFactoryResetTarget() +bool ZigatePlugin::touchLinkFactoryResetTarget() { } -bool ZigateBackend::identifyTriggerEffect() +bool ZigatePlugin::identifyTriggerEffect() { } -bool ZigateBackend::lockUnlockDoor() +bool ZigatePlugin::lockUnlockDoor() { } -bool ZigateBackend::readAttributerequest() +bool ZigatePlugin::readAttributerequest() { } -bool ZigateBackend::writeAttributeRequest() +bool ZigatePlugin::writeAttributeRequest() { } -bool ZigateBackend::configureReportingRequest() +bool ZigatePlugin::configureReportingRequest() { } -bool ZigateBackend::attributeDiscoveryRequest() +bool ZigatePlugin::attributeDiscoveryRequest() { } -bool ZigateBackend::iASZoneEnrollResponse() +bool ZigatePlugin::iASZoneEnrollResponse() { } -bool ZigateBackend::rawAPSDataRequest() +bool ZigatePlugin::rawAPSDataRequest() { } diff --git a/zigatebackend.cpp b/zigateplugin.cpp similarity index 95% rename from zigatebackend.cpp rename to zigateplugin.cpp index a8751ce..e437615 100644 --- a/zigatebackend.cpp +++ b/zigateplugin.cpp @@ -1,4 +1,4 @@ -#include "zigatebackend.h" +#include "zigateplugin.h" #include #include #include "serial.h" @@ -6,17 +6,17 @@ SerialManager serialManager; using namespace std; -ZigateBackend zigateBkd; +ZigatePlugin zigateBkd; -ZigateBackend::ZigateBackend() +ZigatePlugin::ZigatePlugin() { } -ZigateBackend::~ZigateBackend() +ZigatePlugin::~ZigatePlugin() { } -QByteArray ZigateBackend::checksum(QByteArray msgType, QByteArray length, QByteArray datas) +QByteArray ZigatePlugin::checksum(QByteArray msgType, QByteArray length, QByteArray datas) { quint16 temp = 0; int i; @@ -38,7 +38,7 @@ QByteArray ZigateBackend::checksum(QByteArray msgType, QByteArray length, QByteA return QByteArray::number(temp, 16); } -QByteArray ZigateBackend::transcode(QByteArray datas) +QByteArray ZigatePlugin::transcode(QByteArray datas) { QByteArray msg = ""; int i; @@ -62,7 +62,7 @@ QByteArray ZigateBackend::transcode(QByteArray datas) return msg; } -QByteArray ZigateBackend::unTranscode(QByteArray datas) +QByteArray ZigatePlugin::unTranscode(QByteArray datas) { QByteArray result; int i; @@ -92,7 +92,7 @@ QByteArray ZigateBackend::unTranscode(QByteArray datas) return result; } -void ZigateBackend::sendCmd(QByteArray cmd, QByteArray datas) +void ZigatePlugin::sendCmd(QByteArray cmd, QByteArray datas) { QByteArray msg; QByteArray len; @@ -117,7 +117,7 @@ void ZigateBackend::sendCmd(QByteArray cmd, QByteArray datas) //this->interpretResult(this->dataRead); } -void ZigateBackend::interpretResult(QByteArray payload) +void ZigatePlugin::interpretResult(QByteArray payload) { uint tab = 0; int length = 0; diff --git a/zigatebackend.h b/zigateplugin.h similarity index 97% rename from zigatebackend.h rename to zigateplugin.h index a6883b2..c1b348e 100644 --- a/zigatebackend.h +++ b/zigateplugin.h @@ -1,5 +1,5 @@ -#ifndef ZIGATEBACKEND_H -#define ZIGATEBACKEND_H +#ifndef ZIGATEPLUGIN_H +#define ZIGATEPLUGIN_H #define DEVICE_ANNOUNCE "004D" #define STATUS_RETURNED "8000" @@ -109,21 +109,21 @@ void dataIndicationManager(Response *); class ZigbeeMgr; -class ZigateBackend : public QObject, ZigbeeManagerInterface +class ZigatePlugin : public QObject, ZigbeeManagerInterface { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.zigbeemanager" FILE "zigatebackend.json") + Q_PLUGIN_METADATA(IID "org.zigbeemanager" FILE "zigateplugin.json") Q_INTERFACES(ZigbeeManagerInterface) public slots: void interpretResult(QByteArray); public: - ZigateBackend(); - ~ZigateBackend(); + ZigatePlugin(); + ~ZigatePlugin(); - bool initBackend(); + bool initPlugin(); QByteArray checksum(QByteArray msgType, QByteArray length, QByteArray datas); QByteArray transcode(QByteArray datas); QByteArray unTranscode(QByteArray datas); @@ -333,4 +333,4 @@ class ZigateBackend : public QObject, ZigbeeManagerInterface }; -#endif // ZIGATEBACKEND_H +#endif // ZIGATEPLUGIN_H diff --git a/zigatebackend.json b/zigateplugin.json similarity index 100% rename from zigatebackend.json rename to zigateplugin.json diff --git a/zigatebackend.pro b/zigateplugin.pro similarity index 84% rename from zigatebackend.pro rename to zigateplugin.pro index 4636924..5cffc3d 100644 --- a/zigatebackend.pro +++ b/zigateplugin.pro @@ -7,7 +7,7 @@ QT += KConfigCore KConfigGui QT += KCoreAddons TEMPLATE = lib -DEFINES += ZIGATEBACKEND_LIBRARY +DEFINES += ZIGATEPLUGIN_LIBRARY CONFIG += c++17 @@ -16,19 +16,19 @@ CONFIG += c++17 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ - zigatebackend.cpp \ + zigateplugin.cpp \ zigatecmd.cpp \ zigateInit.cpp \ library.cpp \ serial.cpp \ HEADERS += \ - zigatebackend.h \ + zigateplugin.h \ version.h \ responseClasses.h \ library.h \ serial.h \ - zigbeeManagerBackends.h \ + zigbeeManagerPlugins.h \ zigbeeManagerinterface.h # Default rules for deployment. @@ -38,4 +38,4 @@ unix { !isEmpty(target.path): INSTALLS += target DISTFILES += \ - zigatebackend.json + zigateplugin.json diff --git a/zigbeeManagerPlugins.h b/zigbeeManagerPlugins.h new file mode 100644 index 0000000..3d50804 --- /dev/null +++ b/zigbeeManagerPlugins.h @@ -0,0 +1,12 @@ +#ifndef ZIGBEEMANAGERPLUGINS_H +#define ZIGBEEMANAGERPLUGINS_H + +#include + +#if defined(ZIGBEEMANAGERPLUGINS_H) +# define ZIGBEEMANAGERPLUGINS_EXPORT Q_DECL_EXPORT +#else +# define ZIGBEEMANAGERPLUGINS_EXPORT Q_DECL_IMPORT +#endif + +#endif // ZIGBEEMANAGERPLUGINS_H