From be4ee5c14d56d1814370e6c7fd8342c12848e6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 31 Mar 2014 20:33:30 +0200 Subject: [PATCH] hive -> guh --- CMakeLists.txt | 15 -------- Hive.pro | 11 ------ doc/allmodules.qdoc | 4 +-- doc/{hive.qdoc => guh.qdoc} | 16 ++++----- doc/guhcore.qdoc | 7 ++++ doc/{hiveserver.qdoc => guhserver.qdoc} | 6 ++-- doc/hivecore.qdoc | 7 ---- doc/{libhive.qdoc => libguh.qdoc} | 4 +-- guh.pro | 11 ++++++ {libhive => libguh}/action.cpp | 2 +- {libhive => libguh}/action.h | 0 {libhive => libguh}/actiontype.cpp | 2 +- {libhive => libguh}/actiontype.h | 0 {libhive => libguh}/device.cpp | 2 +- {libhive => libguh}/device.h | 0 {libhive => libguh}/deviceclass.cpp | 2 +- {libhive => libguh}/deviceclass.h | 0 {libhive => libguh}/devicemanager.cpp | 10 +++--- {libhive => libguh}/devicemanager.h | 0 {libhive => libguh}/deviceplugin.cpp | 8 ++--- {libhive => libguh}/deviceplugin.h | 4 +-- {libhive => libguh}/driver.cpp | 0 {libhive => libguh}/driver.h | 0 {libhive => libguh}/event.cpp | 2 +- {libhive => libguh}/event.h | 0 {libhive => libguh}/eventtype.cpp | 2 +- {libhive => libguh}/eventtype.h | 0 {libhive => libguh}/gpio.cpp | 2 +- {libhive => libguh}/gpio.h | 0 libhive/libhive.pro => libguh/libguh.pro | 2 +- {libhive => libguh}/radio433.cpp | 2 +- {libhive => libguh}/radio433.h | 0 {libhive => libguh}/state.cpp | 2 +- {libhive => libguh}/state.h | 0 {libhive => libguh}/statetype.cpp | 2 +- {libhive => libguh}/statetype.h | 0 libhive/CMakeLists.txt | 14 -------- plugins/deviceplugins/conrad/conrad.pro | 2 +- .../deviceplugins/conrad/devicepluginconrad.h | 2 +- plugins/deviceplugins/elro/devicepluginelro.h | 2 +- plugins/deviceplugins/elro/elro.pro | 2 +- .../intertechno/devicepluginintertechno.h | 2 +- .../deviceplugins/intertechno/intertechno.pro | 2 +- .../meisteranker/devicepluginmeisteranker.h | 2 +- .../meisteranker/meisteranker.pro | 2 +- .../wifidetector/devicepluginwifidetector.cpp | 2 +- .../wifidetector/devicepluginwifidetector.h | 4 +-- .../wifidetector/wifidetector.pro | 2 +- plugins/plugins.pri | 4 +-- run_on_device.sh | 8 ++--- server/CMakeLists.txt | 17 ---------- server/{hivecore.cpp => guhcore.cpp} | 34 +++++++++---------- server/{hivecore.h => guhcore.h} | 8 ++--- server/jsonrpc/actionhandler.cpp | 4 +-- server/jsonrpc/devicehandler.cpp | 16 ++++----- server/jsonrpc/jsonrpcserver.cpp | 2 +- server/jsonrpc/ruleshandler.cpp | 8 ++--- server/main.cpp | 6 ++-- server/ruleengine.cpp | 12 +++---- server/server.pri | 4 +-- server/server.pro | 16 ++++----- tests/auto/auto.pro | 10 +++--- tests/auto/testjsonrpc.cpp | 10 +++--- .../devicepluginmockdevice.cpp | 2 +- .../mockdeviceplugin/devicepluginmockdevice.h | 4 +-- .../mockdeviceplugin/mockdeviceplugin.pro | 2 +- 66 files changed, 142 insertions(+), 188 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 Hive.pro rename doc/{hive.qdoc => guh.qdoc} (53%) create mode 100644 doc/guhcore.qdoc rename doc/{hiveserver.qdoc => guhserver.qdoc} (60%) delete mode 100644 doc/hivecore.qdoc rename doc/{libhive.qdoc => libguh.qdoc} (74%) create mode 100644 guh.pro rename {libhive => libguh}/action.cpp (98%) rename {libhive => libguh}/action.h (100%) rename {libhive => libguh}/actiontype.cpp (98%) rename {libhive => libguh}/actiontype.h (100%) rename {libhive => libguh}/device.cpp (99%) rename {libhive => libguh}/device.h (100%) rename {libhive => libguh}/deviceclass.cpp (99%) rename {libhive => libguh}/deviceclass.h (100%) rename {libhive => libguh}/devicemanager.cpp (97%) rename {libhive => libguh}/devicemanager.h (100%) rename {libhive => libguh}/deviceplugin.cpp (96%) rename {libhive => libguh}/deviceplugin.h (92%) rename {libhive => libguh}/driver.cpp (100%) rename {libhive => libguh}/driver.h (100%) rename {libhive => libguh}/event.cpp (98%) rename {libhive => libguh}/event.h (100%) rename {libhive => libguh}/eventtype.cpp (98%) rename {libhive => libguh}/eventtype.h (100%) rename {libhive => libguh}/gpio.cpp (99%) rename {libhive => libguh}/gpio.h (100%) rename libhive/libhive.pro => libguh/libguh.pro (97%) rename {libhive => libguh}/radio433.cpp (99%) rename {libhive => libguh}/radio433.h (100%) rename {libhive => libguh}/state.cpp (98%) rename {libhive => libguh}/state.h (100%) rename {libhive => libguh}/statetype.cpp (98%) rename {libhive => libguh}/statetype.h (100%) delete mode 100644 libhive/CMakeLists.txt delete mode 100644 server/CMakeLists.txt rename server/{hivecore.cpp => guhcore.cpp} (62%) rename server/{hivecore.h => guhcore.h} (76%) diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 052f4c5f..00000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.8.9) - -project(Hive C CXX) - -set(CMAKE_AUTOMOC ON) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-permissive -pedantic -Wall -Wextra -fPIC") - -include(FindPkgConfig) - -find_package(Qt5Core) - -add_subdirectory(libhive) -add_subdirectory(server) - diff --git a/Hive.pro b/Hive.pro deleted file mode 100644 index 7c486705..00000000 --- a/Hive.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE=subdirs - -SUBDIRS += libhive server plugins tests - -server.depends = libhive plugins -plugins.depends = libhive -tests.depends = libhive - -doc.depends = libhive server -doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf -QMAKE_EXTRA_TARGETS += doc diff --git a/doc/allmodules.qdoc b/doc/allmodules.qdoc index 86c5937e..c6ac2395 100644 --- a/doc/allmodules.qdoc +++ b/doc/allmodules.qdoc @@ -3,8 +3,8 @@ \title All Modules \table 80% - \row \li \l{libhive} \li Common data types and plugin interfaces - \row \li \l{Hive server} \li The Hive server daemon implementation + \row \li \l{libguh} \li Common data types and plugin interfaces + \row \li \l{guh server} \li The guh server daemon implementation \endtable */ diff --git a/doc/hive.qdoc b/doc/guh.qdoc similarity index 53% rename from doc/hive.qdoc rename to doc/guh.qdoc index 7a52e9be..749ba962 100644 --- a/doc/hive.qdoc +++ b/doc/guh.qdoc @@ -1,30 +1,30 @@ /*! \page index.html - \title Hive Developer Documentation + \title guh Developer Documentation \section1 Summary - The Hive backend service consists of three main modules: + The guh backend service consists of three main modules: \list - \li \l{libhive} + \li \l{libguh} \list - \li \l{Types}{Types used in the hive system} + \li \l{Types}{Types used in the guh system} \li \l{Device Plugins}{The Device Plugin API} \endlist - \li \l{Hive server} + \li \l{guh server} \list - \li \l{Hive Core} + \li \l{guh Core} \li \l{JSONRPC Interface} \li \l{Rules} \endlist \li \l{Plugins}. \list - \li \l{RF 433 MHz} (TODO: is actually in libhive) + \li \l{RF 433 MHz} (TODO: is actually in libguh) \endlist \endlist \section2 Quicklinks \list - \li \l{All Hive Classes} + \li \l{All guh Classes} \endlist */ diff --git a/doc/guhcore.qdoc b/doc/guhcore.qdoc new file mode 100644 index 00000000..46343155 --- /dev/null +++ b/doc/guhcore.qdoc @@ -0,0 +1,7 @@ +/*! + \page guhcore-index.html + \title guh Core + + \annotatedlist core +*/ + diff --git a/doc/hiveserver.qdoc b/doc/guhserver.qdoc similarity index 60% rename from doc/hiveserver.qdoc rename to doc/guhserver.qdoc index a3de57b2..ae8eba78 100644 --- a/doc/hiveserver.qdoc +++ b/doc/guhserver.qdoc @@ -1,10 +1,10 @@ /*! \module server - \title Hive server - The Hive server is the instance that communicates with the hardware and provides a JSONRPC interface + \title guh server + The guh server is the instance that communicates with the hardware and provides a JSONRPC interface for communicating with the UI. It consists of those parts: - \section3 Hive core + \section3 guh core \annotatedlist core \section3 JSRONRPC Interface diff --git a/doc/hivecore.qdoc b/doc/hivecore.qdoc deleted file mode 100644 index 554aa762..00000000 --- a/doc/hivecore.qdoc +++ /dev/null @@ -1,7 +0,0 @@ -/*! - \page hivecore-index.html - \title Hive Core - - \annotatedlist core -*/ - diff --git a/doc/libhive.qdoc b/doc/libguh.qdoc similarity index 74% rename from doc/libhive.qdoc rename to doc/libguh.qdoc index 3d814b57..bcfcab9c 100644 --- a/doc/libhive.qdoc +++ b/doc/libguh.qdoc @@ -1,6 +1,6 @@ /*! - \module libhive - \title libhive + \module libguh + \title libguh \section1 Types \annotatedlist types diff --git a/guh.pro b/guh.pro new file mode 100644 index 00000000..c790e036 --- /dev/null +++ b/guh.pro @@ -0,0 +1,11 @@ +TEMPLATE=subdirs + +SUBDIRS += libguh server plugins tests + +server.depends = libguh plugins +plugins.depends = libguh +tests.depends = libguh + +doc.depends = libguh server +doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf +QMAKE_EXTRA_TARGETS += doc diff --git a/libhive/action.cpp b/libguh/action.cpp similarity index 98% rename from libhive/action.cpp rename to libguh/action.cpp index 23263d15..0c4c4a41 100644 --- a/libhive/action.cpp +++ b/libguh/action.cpp @@ -3,7 +3,7 @@ \brief Holds information required to execute an action described by a \l{ActionType}. \ingroup types - \inmodule libhive + \inmodule libguh It is bound to a \l{Device} and an \l{ActionType} and holds the parameters for the execution of the action. diff --git a/libhive/action.h b/libguh/action.h similarity index 100% rename from libhive/action.h rename to libguh/action.h diff --git a/libhive/actiontype.cpp b/libguh/actiontype.cpp similarity index 98% rename from libhive/actiontype.cpp rename to libguh/actiontype.cpp index 965bb883..3c862c0a 100644 --- a/libhive/actiontype.cpp +++ b/libguh/actiontype.cpp @@ -3,7 +3,7 @@ \brief Describes an \l{Action} for a \l{Device}. \ingroup types - \inmodule libhive + \inmodule libguh ActionTypes are contained in \l{DeviceClass} templates returned by \l{DevicePlugin}{DevicePlugins} in order to describe the hardware supported diff --git a/libhive/actiontype.h b/libguh/actiontype.h similarity index 100% rename from libhive/actiontype.h rename to libguh/actiontype.h diff --git a/libhive/device.cpp b/libguh/device.cpp similarity index 99% rename from libhive/device.cpp rename to libguh/device.cpp index 33887429..11ac0bac 100644 --- a/libhive/device.cpp +++ b/libguh/device.cpp @@ -3,7 +3,7 @@ \brief A Device represents a installed and configured hardware device. \ingroup devices - \inmodule libhive + \inmodule libguh This class holds the values for configured devices. It is associated with a \{DeviceClass} which can be used to get more details about the device. diff --git a/libhive/device.h b/libguh/device.h similarity index 100% rename from libhive/device.h rename to libguh/device.h diff --git a/libhive/deviceclass.cpp b/libguh/deviceclass.cpp similarity index 99% rename from libhive/deviceclass.cpp rename to libguh/deviceclass.cpp index 0440f762..8a44c462 100644 --- a/libhive/deviceclass.cpp +++ b/libguh/deviceclass.cpp @@ -3,7 +3,7 @@ \brief Describes \l{Device}{Devices}. \ingroup devices - \inmodule libhive + \inmodule libguh It holds information general information about devices and their vendors and describes what actions, events and states a device supports. As this is diff --git a/libhive/deviceclass.h b/libguh/deviceclass.h similarity index 100% rename from libhive/deviceclass.h rename to libguh/deviceclass.h diff --git a/libhive/devicemanager.cpp b/libguh/devicemanager.cpp similarity index 97% rename from libhive/devicemanager.cpp rename to libguh/devicemanager.cpp index 341cadb0..2a4df2d5 100644 --- a/libhive/devicemanager.cpp +++ b/libguh/devicemanager.cpp @@ -3,7 +3,7 @@ \brief The main entry point when interacting with \l{Device}{Devices} \ingroup devices - \inmodule libhive + \inmodule libguh The DeviceManager holds all information about supported and configured Devices in the system. @@ -50,7 +50,7 @@ /*! \fn void DeviceManager::emitEvent(const Event &event) The DeviceManager will emit a \l{Event} described in \a event whenever a Device - creates one. Normally only \l{HiveCore} should connect to this and execute actions + creates one. Normally only \l{GuhCore} should connect to this and execute actions after checking back with the \{RulesEngine}. Exceptions might be monitoring interfaces or similar, but you should never directly react to this in a \l{DevicePlugin}. */ @@ -69,8 +69,8 @@ #include #include -/*! Constructs the DeviceManager with the given \a parent. There should only be one DeviceManager in the system created by \l{HiveCore}. - Use \c HiveCore::instance()->deviceManager() instead to access the DeviceManager. +/*! Constructs the DeviceManager with the given \a parent. There should only be one DeviceManager in the system created by \l{GuhCore}. + Use \c GuhCore::instance()->deviceManager() instead to access the DeviceManager. */ DeviceManager::DeviceManager(QObject *parent) : QObject(parent), @@ -288,7 +288,7 @@ void DeviceManager::timerEvent() DeviceClass deviceClass = m_supportedDevices.value(device->deviceClassId()); DevicePlugin *plugin = m_devicePlugins.value(deviceClass.pluginId()); if (plugin->requiredHardware().testFlag(HardwareResourceTimer)) { - plugin->hiveTimer(); + plugin->guhTimer(); } } } diff --git a/libhive/devicemanager.h b/libguh/devicemanager.h similarity index 100% rename from libhive/devicemanager.h rename to libguh/devicemanager.h diff --git a/libhive/deviceplugin.cpp b/libguh/deviceplugin.cpp similarity index 96% rename from libhive/deviceplugin.cpp rename to libguh/deviceplugin.cpp index 31d2db9d..ebd414f9 100644 --- a/libhive/deviceplugin.cpp +++ b/libguh/deviceplugin.cpp @@ -3,7 +3,7 @@ \brief This is the base class interface for device plugins. \ingroup devices -\inmodule libhive +\inmodule libguh When implementing a new plugin, start by subclassing this and implementing the following pure virtual methods: \l{DevicePlugin::pluginName()}, \l{DevicePlugin::pluginId()}, @@ -29,7 +29,7 @@ pure virtual methods: \l{DevicePlugin::pluginName()}, \l{DevicePlugin::pluginId( /*! \fn DeviceManager::HardwareResources DevicePlugin::requiredHardware() const Return flags describing the common hardware resources required by this plugin. - \sa DevicePlugin::transmitData(), DevicePlugin::radioData(), DevicePlugin::hiveTimer() + \sa DevicePlugin::transmitData(), DevicePlugin::radioData(), DevicePlugin::guhTimer() */ /*! @@ -39,7 +39,7 @@ pure virtual methods: \l{DevicePlugin::pluginName()}, \l{DevicePlugin::pluginId( */ /*! - \fn void DevicePlugin::hiveTimer() + \fn void DevicePlugin::guhTimer() If the plugin has requested the timer using \l{DevicePlugin::requiredHardware()}, this slot will be called on timer events. */ @@ -54,7 +54,7 @@ pure virtual methods: \l{DevicePlugin::pluginName()}, \l{DevicePlugin::pluginId( \fn void DevicePlugin::emitEvent(const Event &event) To produce a new event in the system, create a new \l{Event} and emit it with \a event. Usually events are emitted in response to incoming data or other other events happening, - such as \l{DevicePlugin::radioData()} or \l{DevicePlugin::hiveTimer()}. Find a configured + such as \l{DevicePlugin::radioData()} or \l{DevicePlugin::guhTimer()}. Find a configured \l{Device} from the \l{DeviceManager} and get its \l{EventType}{EventTypes}, then create a \l{Event} complying to that \l{EventType} and emit it here. */ diff --git a/libhive/deviceplugin.h b/libguh/deviceplugin.h similarity index 92% rename from libhive/deviceplugin.h rename to libguh/deviceplugin.h index de701925..8dab661f 100644 --- a/libhive/deviceplugin.h +++ b/libguh/deviceplugin.h @@ -28,7 +28,7 @@ public: // Hardware input virtual void radioData(QList rawData) {Q_UNUSED(rawData)} - virtual void hiveTimer() {} + virtual void guhTimer() {} virtual QVariantMap configuration() const; virtual void setConfiguration(const QVariantMap &configuration); @@ -52,6 +52,6 @@ private: friend class DeviceManager; }; -Q_DECLARE_INTERFACE(DevicePlugin, "org.hiveyourhome.DevicePlugin") +Q_DECLARE_INTERFACE(DevicePlugin, "org.guhyourhome.DevicePlugin") #endif diff --git a/libhive/driver.cpp b/libguh/driver.cpp similarity index 100% rename from libhive/driver.cpp rename to libguh/driver.cpp diff --git a/libhive/driver.h b/libguh/driver.h similarity index 100% rename from libhive/driver.h rename to libguh/driver.h diff --git a/libhive/event.cpp b/libguh/event.cpp similarity index 98% rename from libhive/event.cpp rename to libguh/event.cpp index a069b299..5acfca2f 100644 --- a/libhive/event.cpp +++ b/libguh/event.cpp @@ -3,7 +3,7 @@ \brief Holds information required to emit a event described by a \l{EventType}. \ingroup types - \inmodule libhive + \inmodule libguh It is bound to a \l{Device} and a \l{EventType} and holds the parameters for the event that happened. diff --git a/libhive/event.h b/libguh/event.h similarity index 100% rename from libhive/event.h rename to libguh/event.h diff --git a/libhive/eventtype.cpp b/libguh/eventtype.cpp similarity index 98% rename from libhive/eventtype.cpp rename to libguh/eventtype.cpp index f40c858a..548616dd 100644 --- a/libhive/eventtype.cpp +++ b/libguh/eventtype.cpp @@ -3,7 +3,7 @@ \brief Describes a \l{Event} for a \l{Device}. \ingroup types - \inmodule libhive + \inmodule libguh \sa Event */ diff --git a/libhive/eventtype.h b/libguh/eventtype.h similarity index 100% rename from libhive/eventtype.h rename to libguh/eventtype.h diff --git a/libhive/gpio.cpp b/libguh/gpio.cpp similarity index 99% rename from libhive/gpio.cpp rename to libguh/gpio.cpp index f8bf5c01..9e9c60ea 100644 --- a/libhive/gpio.cpp +++ b/libguh/gpio.cpp @@ -2,7 +2,7 @@ \class Gpio \brief The Gpio class helps to interact with the gpio pins of the Raspberry Pi. - \inmodule libhive + \inmodule libguh The Raspberry Pi offers lower-level interfaces (GPIO's) intended to connect more directly with chips and subsystem modules. General Purpose Input/Output (a.k.a. GPIO) is a generic diff --git a/libhive/gpio.h b/libguh/gpio.h similarity index 100% rename from libhive/gpio.h rename to libguh/gpio.h diff --git a/libhive/libhive.pro b/libguh/libguh.pro similarity index 97% rename from libhive/libhive.pro rename to libguh/libguh.pro index d54a750d..5fd703e1 100644 --- a/libhive/libhive.pro +++ b/libguh/libguh.pro @@ -1,4 +1,4 @@ -TARGET = hive +TARGET = guh TEMPLATE = lib CONFIG += c++11 diff --git a/libhive/radio433.cpp b/libguh/radio433.cpp similarity index 99% rename from libhive/radio433.cpp rename to libguh/radio433.cpp index b7c9700e..256cfb99 100644 --- a/libhive/radio433.cpp +++ b/libguh/radio433.cpp @@ -4,7 +4,7 @@ \l{http://tech.jolowe.se/home-automation-rf-protocols/} - \inmodule libhive + \inmodule libguh */ diff --git a/libhive/radio433.h b/libguh/radio433.h similarity index 100% rename from libhive/radio433.h rename to libguh/radio433.h diff --git a/libhive/state.cpp b/libguh/state.cpp similarity index 98% rename from libhive/state.cpp rename to libguh/state.cpp index 9f60e074..a1f968c6 100644 --- a/libhive/state.cpp +++ b/libguh/state.cpp @@ -3,7 +3,7 @@ \brief Holds the parameters of a State of a \l{Device}. \ingroup types - \inmodule libhive + \inmodule libguh States hold the state values for devices. A State is associated to a \l{Device} by the \l{State::deviceId()} and represents the value of a state described in a \l{StateType} diff --git a/libhive/state.h b/libguh/state.h similarity index 100% rename from libhive/state.h rename to libguh/state.h diff --git a/libhive/statetype.cpp b/libguh/statetype.cpp similarity index 98% rename from libhive/statetype.cpp rename to libguh/statetype.cpp index e4b6c353..64ec7476 100644 --- a/libhive/statetype.cpp +++ b/libguh/statetype.cpp @@ -3,7 +3,7 @@ \brief Describes a \l{State} for a \l{Device}. \ingroup types - \inmodule libhive + \inmodule libguh \sa State */ diff --git a/libhive/statetype.h b/libguh/statetype.h similarity index 100% rename from libhive/statetype.h rename to libguh/statetype.h diff --git a/libhive/CMakeLists.txt b/libhive/CMakeLists.txt deleted file mode 100644 index 08c9354b..00000000 --- a/libhive/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} -) - -set(libhive_SRCS - device.cpp - deviceclass.cpp - deviceplugin.cpp -) - -add_library(libhive ${libhive_SRCS}) - -qt5_use_modules(libhive Network) - diff --git a/plugins/deviceplugins/conrad/conrad.pro b/plugins/deviceplugins/conrad/conrad.pro index 7e2fd045..f36b1587 100644 --- a/plugins/deviceplugins/conrad/conrad.pro +++ b/plugins/deviceplugins/conrad/conrad.pro @@ -1,6 +1,6 @@ include (../../plugins.pri) -TARGET = $$qtLibraryTarget(hive_devicepluginconrad) +TARGET = $$qtLibraryTarget(guh_devicepluginconrad) SOURCES += \ devicepluginconrad.cpp diff --git a/plugins/deviceplugins/conrad/devicepluginconrad.h b/plugins/deviceplugins/conrad/devicepluginconrad.h index d91e59eb..50426acf 100644 --- a/plugins/deviceplugins/conrad/devicepluginconrad.h +++ b/plugins/deviceplugins/conrad/devicepluginconrad.h @@ -7,7 +7,7 @@ class DevicePluginConrad : public DevicePlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginconrad.json") + Q_PLUGIN_METADATA(IID "org.guhyourhome.DevicePlugin" FILE "devicepluginconrad.json") Q_INTERFACES(DevicePlugin) public: diff --git a/plugins/deviceplugins/elro/devicepluginelro.h b/plugins/deviceplugins/elro/devicepluginelro.h index ee5e47df..5f50216b 100644 --- a/plugins/deviceplugins/elro/devicepluginelro.h +++ b/plugins/deviceplugins/elro/devicepluginelro.h @@ -7,7 +7,7 @@ class DevicePluginElro : public DevicePlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginelro.json") + Q_PLUGIN_METADATA(IID "org.guhyourhome.DevicePlugin" FILE "devicepluginelro.json") Q_INTERFACES(DevicePlugin) public: diff --git a/plugins/deviceplugins/elro/elro.pro b/plugins/deviceplugins/elro/elro.pro index 8ea5b3b3..c52dfa87 100644 --- a/plugins/deviceplugins/elro/elro.pro +++ b/plugins/deviceplugins/elro/elro.pro @@ -1,6 +1,6 @@ include(../../plugins.pri) -TARGET = $$qtLibraryTarget(hive_devicepluginelro) +TARGET = $$qtLibraryTarget(guh_devicepluginelro) SOURCES += \ devicepluginelro.cpp diff --git a/plugins/deviceplugins/intertechno/devicepluginintertechno.h b/plugins/deviceplugins/intertechno/devicepluginintertechno.h index 55962352..a936ae25 100644 --- a/plugins/deviceplugins/intertechno/devicepluginintertechno.h +++ b/plugins/deviceplugins/intertechno/devicepluginintertechno.h @@ -7,7 +7,7 @@ class DevicePluginIntertechno : public DevicePlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginintertechno.json") + Q_PLUGIN_METADATA(IID "org.guhyourhome.DevicePlugin" FILE "devicepluginintertechno.json") Q_INTERFACES(DevicePlugin) public: diff --git a/plugins/deviceplugins/intertechno/intertechno.pro b/plugins/deviceplugins/intertechno/intertechno.pro index b7aaca21..29b39836 100644 --- a/plugins/deviceplugins/intertechno/intertechno.pro +++ b/plugins/deviceplugins/intertechno/intertechno.pro @@ -1,6 +1,6 @@ include (../../plugins.pri) -TARGET = $$qtLibraryTarget(hive_devicepluginintertechno) +TARGET = $$qtLibraryTarget(guh_devicepluginintertechno) SOURCES += \ devicepluginintertechno.cpp diff --git a/plugins/deviceplugins/meisteranker/devicepluginmeisteranker.h b/plugins/deviceplugins/meisteranker/devicepluginmeisteranker.h index c1bbe39f..82c805a5 100644 --- a/plugins/deviceplugins/meisteranker/devicepluginmeisteranker.h +++ b/plugins/deviceplugins/meisteranker/devicepluginmeisteranker.h @@ -8,7 +8,7 @@ class DevicePluginMeisterAnker : public DevicePlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginmeisteranker.json") + Q_PLUGIN_METADATA(IID "org.guhyourhome.DevicePlugin" FILE "devicepluginmeisteranker.json") Q_INTERFACES(DevicePlugin) public: diff --git a/plugins/deviceplugins/meisteranker/meisteranker.pro b/plugins/deviceplugins/meisteranker/meisteranker.pro index 483fb17e..3a6a5729 100644 --- a/plugins/deviceplugins/meisteranker/meisteranker.pro +++ b/plugins/deviceplugins/meisteranker/meisteranker.pro @@ -1,6 +1,6 @@ include(../../plugins.pri) -TARGET = $$qtLibraryTarget(hive_devicepluginmeisteranker) +TARGET = $$qtLibraryTarget(guh_devicepluginmeisteranker) SOURCES += \ devicepluginmeisteranker.cpp diff --git a/plugins/deviceplugins/wifidetector/devicepluginwifidetector.cpp b/plugins/deviceplugins/wifidetector/devicepluginwifidetector.cpp index 94c3ccd7..4286b19e 100644 --- a/plugins/deviceplugins/wifidetector/devicepluginwifidetector.cpp +++ b/plugins/deviceplugins/wifidetector/devicepluginwifidetector.cpp @@ -74,7 +74,7 @@ QUuid DevicePluginWifiDetector::pluginId() const return pluginUuid; } -void DevicePluginWifiDetector::hiveTimer() +void DevicePluginWifiDetector::guhTimer() { QProcess *p = new QProcess(this); connect(p, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processFinished(int,QProcess::ExitStatus))); diff --git a/plugins/deviceplugins/wifidetector/devicepluginwifidetector.h b/plugins/deviceplugins/wifidetector/devicepluginwifidetector.h index 1192b5c6..3d09cf2d 100644 --- a/plugins/deviceplugins/wifidetector/devicepluginwifidetector.h +++ b/plugins/deviceplugins/wifidetector/devicepluginwifidetector.h @@ -9,7 +9,7 @@ class DevicePluginWifiDetector : public DevicePlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginwifidetector.json") + Q_PLUGIN_METADATA(IID "org.guhyourhome.DevicePlugin" FILE "devicepluginwifidetector.json") Q_INTERFACES(DevicePlugin) public: @@ -21,7 +21,7 @@ public: QString pluginName() const override; QUuid pluginId() const override; - void hiveTimer() override; + void guhTimer() override; private slots: void processFinished(int exitCode, QProcess::ExitStatus exitStatus); diff --git a/plugins/deviceplugins/wifidetector/wifidetector.pro b/plugins/deviceplugins/wifidetector/wifidetector.pro index 7d95d0a2..9c718e83 100644 --- a/plugins/deviceplugins/wifidetector/wifidetector.pro +++ b/plugins/deviceplugins/wifidetector/wifidetector.pro @@ -1,6 +1,6 @@ include(../../plugins.pri) -TARGET = $$qtLibraryTarget(hive_devicepluginwifidetector) +TARGET = $$qtLibraryTarget(guh_devicepluginwifidetector) SOURCES += \ devicepluginwifidetector.cpp diff --git a/plugins/plugins.pri b/plugins/plugins.pri index 8acff450..8173be8e 100644 --- a/plugins/plugins.pri +++ b/plugins/plugins.pri @@ -1,6 +1,6 @@ TEMPLATE = lib CONFIG += plugin static c++11 -INCLUDEPATH += ../../../libhive -LIBS += -L../../../libhive -lhive +INCLUDEPATH += ../../../libguh +LIBS += -L../../../libguh -lguh diff --git a/run_on_device.sh b/run_on_device.sh index d3859902..116682e1 100755 --- a/run_on_device.sh +++ b/run_on_device.sh @@ -1,10 +1,10 @@ #!/bin/sh -CODE_DIR=Hive +CODE_DIR=guh BUILD_DIR=builddir USER=root USER_ID=0 -PASSWORD=hive -BINARY=hive +PASSWORD=guh +BINARY=guh TARGET_IP=${TARGET_IP-10.10.10.125} TARGET_SSH_PORT=22 TARGET_DEBUG_PORT=3768 @@ -57,7 +57,7 @@ build() { } run() { - exec_with_ssh "LD_LIBRARY_PATH=$CODE_DIR/$BUILD_DIR/libhive $CODE_DIR/$BUILD_DIR/server/$BINARY" + exec_with_ssh "LD_LIBRARY_PATH=$CODE_DIR/$BUILD_DIR/libguh $CODE_DIR/$BUILD_DIR/server/$BINARY" } set -- `getopt -n$0 -u -a --longoptions="setup,gdbhelp" "sgh" "$@"` diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt deleted file mode 100644 index 87d8ecd0..00000000 --- a/server/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/libhive -) - -set(hive_SRCS - main.cpp - hivecore.cpp - jsonrpcserver.cpp - tcpserver.cpp - radio433.cpp -) - -add_executable(hive ${hive_SRCS}) -target_link_libraries(hive libhive) - -qt5_use_modules(hive Network) diff --git a/server/hivecore.cpp b/server/guhcore.cpp similarity index 62% rename from server/hivecore.cpp rename to server/guhcore.cpp index b491c135..787a1f19 100644 --- a/server/hivecore.cpp +++ b/server/guhcore.cpp @@ -1,47 +1,47 @@ /*! - \class HiveCore - \brief The main entry point for the Hive Server and the place where all the messages are dispatched. + \class GuhCore + \brief The main entry point for the Guh Server and the place where all the messages are dispatched. \ingroup core \inmodule server - HiveCore is a singleton instance and the main entry point of the Hive daemon. It is responsible to + GuhCore is a singleton instance and the main entry point of the Guh daemon. It is responsible to instantiate, set up and connect all the other components. */ -#include "hivecore.h" +#include "guhcore.h" #include "jsonrpcserver.h" #include "devicemanager.h" #include "ruleengine.h" #include -HiveCore* HiveCore::s_instance = 0; +GuhCore* GuhCore::s_instance = 0; -/*! Returns a pointer to the single \l{HiveCore} instance.*/ -HiveCore *HiveCore::instance() +/*! Returns a pointer to the single \l{GuhCore} instance.*/ +GuhCore *GuhCore::instance() { if (!s_instance) { - s_instance = new HiveCore(); + s_instance = new GuhCore(); } return s_instance; } -/*! Returns a pointer to the \l{DeviceManager} instance owned by HiveCore.*/ -DeviceManager *HiveCore::deviceManager() const +/*! Returns a pointer to the \l{DeviceManager} instance owned by GuhCore.*/ +DeviceManager *GuhCore::deviceManager() const { return m_deviceManager; } -/*! Returns a pointer to the \l{RuleEngine} instance owned by HiveCore.*/ -RuleEngine *HiveCore::ruleEngine() const +/*! Returns a pointer to the \l{RuleEngine} instance owned by GuhCore.*/ +RuleEngine *GuhCore::ruleEngine() const { return m_ruleEngine; } -/*! Constructs HiveCore with the given \a parent. This is private. - Use \l{HiveCore::instance()} to access the single instance.*/ -HiveCore::HiveCore(QObject *parent) : +/*! Constructs GuhCore with the given \a parent. This is private. + Use \l{GuhCore::instance()} to access the single instance.*/ +GuhCore::GuhCore(QObject *parent) : QObject(parent) { @@ -60,13 +60,13 @@ HiveCore::HiveCore(QObject *parent) : qDebug() << "*****************************************"; m_jsonServer = new JsonRPCServer(this); - connect(m_deviceManager, &DeviceManager::emitEvent, this, &HiveCore::gotSignal); + connect(m_deviceManager, &DeviceManager::emitEvent, this, &GuhCore::gotSignal); } /*! Connected to the DeviceManager's emitEvent signal. Events received in here will be evaluated by the \l{RuleEngine} and the according \l{Action}{Actions} are executed.*/ -void HiveCore::gotSignal(const Event &event) +void GuhCore::gotSignal(const Event &event) { foreach (const Action &action, m_ruleEngine->evaluateEvent(event)) { m_deviceManager->executeAction(action); diff --git a/server/hivecore.h b/server/guhcore.h similarity index 76% rename from server/hivecore.h rename to server/guhcore.h index d8f5d6f8..bdde32f7 100644 --- a/server/hivecore.h +++ b/server/guhcore.h @@ -10,18 +10,18 @@ class JsonRPCServer; class DeviceManager; class RuleEngine; -class HiveCore : public QObject +class GuhCore : public QObject { Q_OBJECT public: - static HiveCore* instance(); + static GuhCore* instance(); DeviceManager* deviceManager() const; RuleEngine *ruleEngine() const; private: - explicit HiveCore(QObject *parent = 0); - static HiveCore *s_instance; + explicit GuhCore(QObject *parent = 0); + static GuhCore *s_instance; JsonRPCServer *m_jsonServer; DeviceManager *m_deviceManager; diff --git a/server/jsonrpc/actionhandler.cpp b/server/jsonrpc/actionhandler.cpp index 77532d15..c53a6ff3 100644 --- a/server/jsonrpc/actionhandler.cpp +++ b/server/jsonrpc/actionhandler.cpp @@ -1,7 +1,7 @@ #include "actionhandler.h" #include "devicemanager.h" -#include "hivecore.h" +#include "guhcore.h" #include "action.h" #include @@ -42,7 +42,7 @@ QVariantMap ActionHandler::ExecuteAction(const QVariantMap ¶ms) QVariantMap returns; - DeviceManager::DeviceError error = HiveCore::instance()->deviceManager()->executeAction(action); + DeviceManager::DeviceError error = GuhCore::instance()->deviceManager()->executeAction(action); switch (error) { case DeviceManager::DeviceErrorNoError: diff --git a/server/jsonrpc/devicehandler.cpp b/server/jsonrpc/devicehandler.cpp index 595dcd64..bf5036c1 100644 --- a/server/jsonrpc/devicehandler.cpp +++ b/server/jsonrpc/devicehandler.cpp @@ -1,7 +1,7 @@ #include "devicehandler.h" #include "deviceclass.h" -#include "hivecore.h" +#include "guhcore.h" #include "devicemanager.h" #include "deviceplugin.h" @@ -85,7 +85,7 @@ QVariantMap DeviceHandler::GetSupportedDevices(const QVariantMap ¶ms) const Q_UNUSED(params) QVariantMap returns; QVariantList supportedDeviceList; - foreach (const DeviceClass &deviceClass, HiveCore::instance()->deviceManager()->supportedDevices()) { + foreach (const DeviceClass &deviceClass, GuhCore::instance()->deviceManager()->supportedDevices()) { supportedDeviceList.append(JsonTypes::packDeviceClass(deviceClass)); } returns.insert("deviceClasses", supportedDeviceList); @@ -97,7 +97,7 @@ QVariantMap DeviceHandler::GetPlugins(const QVariantMap ¶ms) const Q_UNUSED(params) QVariantMap returns; QVariantList plugins; - foreach (DevicePlugin *plugin, HiveCore::instance()->deviceManager()->plugins()) { + foreach (DevicePlugin *plugin, GuhCore::instance()->deviceManager()->plugins()) { QVariantMap pluginMap; pluginMap.insert("id", plugin->pluginId()); pluginMap.insert("name", plugin->pluginName()); @@ -112,7 +112,7 @@ QVariantMap DeviceHandler::SetPluginParams(const QVariantMap ¶ms) { QUuid pluginId = params.value("pluginId").toUuid(); QVariantMap pluginParams = params.value("pluginParams").toMap(); - HiveCore::instance()->deviceManager()->plugin(pluginId)->setConfiguration(pluginParams); + GuhCore::instance()->deviceManager()->plugin(pluginId)->setConfiguration(pluginParams); return QVariantMap(); } @@ -120,7 +120,7 @@ QVariantMap DeviceHandler::AddConfiguredDevice(const QVariantMap ¶ms) { QUuid deviceClass = params.value("deviceClassId").toUuid(); QVariantMap deviceParams = params.value("deviceParams").toMap(); - DeviceManager::DeviceError status = HiveCore::instance()->deviceManager()->addConfiguredDevice(deviceClass, deviceParams); + DeviceManager::DeviceError status = GuhCore::instance()->deviceManager()->addConfiguredDevice(deviceClass, deviceParams); QVariantMap returns; switch(status) { case DeviceManager::DeviceErrorNoError: @@ -150,7 +150,7 @@ QVariantMap DeviceHandler::GetConfiguredDevices(const QVariantMap ¶ms) const Q_UNUSED(params) QVariantMap returns; QVariantList configuredDeviceList; - foreach (Device *device, HiveCore::instance()->deviceManager()->configuredDevices()) { + foreach (Device *device, GuhCore::instance()->deviceManager()->configuredDevices()) { configuredDeviceList.append(JsonTypes::packDevice(device)); } returns.insert("devices", configuredDeviceList); @@ -162,7 +162,7 @@ QVariantMap DeviceHandler::GetEventTypes(const QVariantMap ¶ms) const QVariantMap returns; QVariantList eventList; - DeviceClass deviceClass = HiveCore::instance()->deviceManager()->findDeviceClass(params.value("deviceClassId").toUuid()); + DeviceClass deviceClass = GuhCore::instance()->deviceManager()->findDeviceClass(params.value("deviceClassId").toUuid()); foreach (const EventType &eventType, deviceClass.events()) { eventList.append(JsonTypes::packEventType(eventType)); } @@ -175,7 +175,7 @@ QVariantMap DeviceHandler::GetActionTypes(const QVariantMap ¶ms) const QVariantMap returns; QVariantList actionList; - DeviceClass deviceClass = HiveCore::instance()->deviceManager()->findDeviceClass(params.value("deviceClassId").toUuid()); + DeviceClass deviceClass = GuhCore::instance()->deviceManager()->findDeviceClass(params.value("deviceClassId").toUuid()); foreach (const ActionType &actionType, deviceClass.actions()) { actionList.append(JsonTypes::packActionType(actionType)); } diff --git a/server/jsonrpc/jsonrpcserver.cpp b/server/jsonrpc/jsonrpcserver.cpp index bf2a2996..ea74de4a 100644 --- a/server/jsonrpc/jsonrpcserver.cpp +++ b/server/jsonrpc/jsonrpcserver.cpp @@ -8,7 +8,7 @@ #endif #include "jsonhandler.h" -#include "hivecore.h" +#include "guhcore.h" #include "devicemanager.h" #include "deviceplugin.h" #include "deviceclass.h" diff --git a/server/jsonrpc/ruleshandler.cpp b/server/jsonrpc/ruleshandler.cpp index 13c84176..0e9b6790 100644 --- a/server/jsonrpc/ruleshandler.cpp +++ b/server/jsonrpc/ruleshandler.cpp @@ -1,6 +1,6 @@ #include "ruleshandler.h" -#include "hivecore.h" +#include "guhcore.h" #include "ruleengine.h" #include @@ -45,7 +45,7 @@ QVariantMap RulesHandler::GetRules(const QVariantMap ¶ms) Q_UNUSED(params) QVariantList rulesList; - foreach (const Rule &rule, HiveCore::instance()->ruleEngine()->rules()) { + foreach (const Rule &rule, GuhCore::instance()->ruleEngine()->rules()) { qDebug() << "got rule" << rule.id(); QVariantMap ruleMap = JsonTypes::packRule(rule); rulesList.append(ruleMap); @@ -82,7 +82,7 @@ QVariantMap RulesHandler::AddRule(const QVariantMap ¶ms) return returns; } - switch(HiveCore::instance()->ruleEngine()->addRule(event, actions)) { + switch(GuhCore::instance()->ruleEngine()->addRule(event, actions)) { case RuleEngine::RuleErrorNoError: returns.insert("success", true); break; @@ -105,7 +105,7 @@ QVariantMap RulesHandler::RemoveRule(const QVariantMap ¶ms) { QVariantMap returns; QUuid ruleId = params.value("ruleId").toUuid(); - switch (HiveCore::instance()->ruleEngine()->removeRule(ruleId)) { + switch (GuhCore::instance()->ruleEngine()->removeRule(ruleId)) { case RuleEngine::RuleErrorNoError: returns.insert("success", true); break; diff --git a/server/main.cpp b/server/main.cpp index d8198f9f..54bded4e 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include @@ -13,9 +13,9 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); - a.setOrganizationName("hiveyourhome"); + a.setOrganizationName("guhyourhome"); - HiveCore::instance(); + GuhCore::instance(); return a.exec(); } diff --git a/server/ruleengine.cpp b/server/ruleengine.cpp index ea5e65ae..898818ca 100644 --- a/server/ruleengine.cpp +++ b/server/ruleengine.cpp @@ -34,7 +34,7 @@ #include "ruleengine.h" -#include "hivecore.h" +#include "guhcore.h" #include "devicemanager.h" #include "device.h" @@ -45,7 +45,7 @@ #include /*! Constructs the RuleEngine with the given \a parent. Although it wouldn't harm to have multiple RuleEngines, there is one - instance available from \l{HiveCore}. This one should be used instead of creating multiple ones. + instance available from \l{GuhCore}. This one should be used instead of creating multiple ones. */ RuleEngine::RuleEngine(QObject *parent) : QObject(parent) @@ -104,7 +104,7 @@ QList RuleEngine::evaluateEvent(const Event &event) bool statesMatching = true; qDebug() << "checking states"; foreach (const State &state, m_rules.at(i).states()) { - Device *device = HiveCore::instance()->deviceManager()->findConfiguredDevice(state.deviceId()); + Device *device = GuhCore::instance()->deviceManager()->findConfiguredDevice(state.deviceId()); if (!device) { qWarning() << "Device referenced in rule cannot be found"; break; @@ -136,14 +136,14 @@ RuleEngine::RuleError RuleEngine::addRule(const Event &event, const QList &states, const QList &actions) { qDebug() << "adding rule: Event:" << event.eventTypeId() << "with" << actions.count() << "actions"; - DeviceClass eventDeviceClass = HiveCore::instance()->deviceManager()->findDeviceClassforEvent(event.eventTypeId()); + DeviceClass eventDeviceClass = GuhCore::instance()->deviceManager()->findDeviceClassforEvent(event.eventTypeId()); - Device *device = HiveCore::instance()->deviceManager()->findConfiguredDevice(event.deviceId()); + Device *device = GuhCore::instance()->deviceManager()->findConfiguredDevice(event.deviceId()); if (!device) { qWarning() << "Cannot create rule. No configured device for eventTypeId" << event.eventTypeId(); return RuleErrorDeviceNotFound; } - DeviceClass deviceClass = HiveCore::instance()->deviceManager()->findDeviceClass(device->deviceClassId()); + DeviceClass deviceClass = GuhCore::instance()->deviceManager()->findDeviceClass(device->deviceClassId()); qDebug() << "found deviceClass" << deviceClass.name(); bool eventTypeFound = false; diff --git a/server/server.pri b/server/server.pri index 6d9ce447..d5f6904d 100644 --- a/server/server.pri +++ b/server/server.pri @@ -1,4 +1,4 @@ -SOURCES += $$top_srcdir/server/hivecore.cpp \ +SOURCES += $$top_srcdir/server/guhcore.cpp \ $$top_srcdir/server/tcpserver.cpp \ $$top_srcdir/server/ruleengine.cpp \ $$top_srcdir/server/rule.cpp \ @@ -9,7 +9,7 @@ SOURCES += $$top_srcdir/server/hivecore.cpp \ $$top_srcdir/server/jsonrpc/ruleshandler.cpp \ $$top_srcdir/server/jsonrpc/actionhandler.cpp -HEADERS += $$top_srcdir/server/hivecore.h \ +HEADERS += $$top_srcdir/server/guhcore.h \ $$top_srcdir/server/tcpserver.h \ $$top_srcdir/server/ruleengine.h \ $$top_srcdir/server/rule.h \ diff --git a/server/server.pro b/server/server.pro index b35ab1cf..7addd09e 100644 --- a/server/server.pro +++ b/server/server.pro @@ -1,7 +1,7 @@ -TARGET = hive +TARGET = guh TEMPLATE = app -INCLUDEPATH += ../libhive jsonrpc +INCLUDEPATH += ../libguh jsonrpc target.path = /usr/bin INSTALLS += target @@ -9,14 +9,14 @@ INSTALLS += target QT += network CONFIG += c++11 -LIBS += -L$$top_builddir/libhive/ -lhive +LIBS += -L$$top_builddir/libguh/ -lguh include(server.pri) SOURCES += main.cpp # FIXME: Drop this and link them dynamically -LIBS += -L../plugins/deviceplugins/elro/ -lhive_devicepluginelro -LIBS += -L../plugins/deviceplugins/intertechno/ -lhive_devicepluginintertechno -LIBS += -L../plugins/deviceplugins/meisteranker/ -lhive_devicepluginmeisteranker -LIBS += -L../plugins/deviceplugins/wifidetector/ -lhive_devicepluginwifidetector -LIBS += -L../plugins/deviceplugins/conrad -lhive_devicepluginconrad +LIBS += -L../plugins/deviceplugins/elro/ -lguh_devicepluginelro +LIBS += -L../plugins/deviceplugins/intertechno/ -lguh_devicepluginintertechno +LIBS += -L../plugins/deviceplugins/meisteranker/ -lguh_devicepluginmeisteranker +LIBS += -L../plugins/deviceplugins/wifidetector/ -lguh_devicepluginwifidetector +LIBS += -L../plugins/deviceplugins/conrad -lguh_devicepluginconrad diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 0776ec59..72fe3f3f 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,11 +1,11 @@ -TARGET = hivetests +TARGET = guhtests QT += testlib network CONFIG += testcase c++11 DEFINES += TESTING_ENABLED -INCLUDEPATH += $$top_srcdir/server/ $$top_srcdir/server/jsonrpc $$top_srcdir/libhive $$top_srcdir/tests/auto/ -LIBS += -L$$top_builddir/libhive/ -lhive -QMAKE_LFLAGS += -Wl,--rpath=$$top_builddir/libhive +INCLUDEPATH += $$top_srcdir/server/ $$top_srcdir/server/jsonrpc $$top_srcdir/libguh $$top_srcdir/tests/auto/ +LIBS += -L$$top_builddir/libguh/ -lguh +QMAKE_LFLAGS += -Wl,--rpath=$$top_builddir/libguh include($$top_srcdir/server/server.pri) @@ -14,4 +14,4 @@ SOURCES += testjsonrpc.cpp \ HEADERS += mocktcpserver.h -LIBS += -L../mocks/mockdeviceplugin/ -lhive_devicepluginmockdevice +LIBS += -L../mocks/mockdeviceplugin/ -lguh_devicepluginmockdevice diff --git a/tests/auto/testjsonrpc.cpp b/tests/auto/testjsonrpc.cpp index 6d67615b..5e7f3d34 100644 --- a/tests/auto/testjsonrpc.cpp +++ b/tests/auto/testjsonrpc.cpp @@ -1,4 +1,4 @@ -#include "hivecore.h" +#include "guhcore.h" #include "devicemanager.h" #include "mocktcpserver.h" @@ -33,17 +33,17 @@ private: void TestJSONRPC::initTestcase() { - QCoreApplication::instance()->setOrganizationName("hiveyourhome-test"); + QCoreApplication::instance()->setOrganizationName("guhyourhome-test"); qDebug() << "creating core"; - HiveCore::instance(); + GuhCore::instance(); qDebug() << "creating spy"; // Wait for the DeviceManager to signal that it has loaded plugins and everything - QSignalSpy spy(HiveCore::instance()->deviceManager(), SIGNAL(loaded())); + QSignalSpy spy(GuhCore::instance()->deviceManager(), SIGNAL(loaded())); QVERIFY(spy.isValid()); QVERIFY(spy.wait()); - // If Hive should create more than one TcpServer at some point, this needs to be updated. + // If Guh should create more than one TcpServer at some point, this needs to be updated. QCOMPARE(MockTcpServer::servers().count(), 1); m_mockTcpServer = MockTcpServer::servers().first(); m_clientId = QUuid::createUuid(); diff --git a/tests/mocks/mockdeviceplugin/devicepluginmockdevice.cpp b/tests/mocks/mockdeviceplugin/devicepluginmockdevice.cpp index 90aa681a..66b00c14 100644 --- a/tests/mocks/mockdeviceplugin/devicepluginmockdevice.cpp +++ b/tests/mocks/mockdeviceplugin/devicepluginmockdevice.cpp @@ -74,7 +74,7 @@ QUuid DevicePluginMockDevice::pluginId() const return pluginUuid; } -void DevicePluginMockDevice::hiveTimer() +void DevicePluginMockDevice::guhTimer() { } diff --git a/tests/mocks/mockdeviceplugin/devicepluginmockdevice.h b/tests/mocks/mockdeviceplugin/devicepluginmockdevice.h index 8b1c0255..4fbaed45 100644 --- a/tests/mocks/mockdeviceplugin/devicepluginmockdevice.h +++ b/tests/mocks/mockdeviceplugin/devicepluginmockdevice.h @@ -7,7 +7,7 @@ class DevicePluginMockDevice: public DevicePlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.hiveyourhome.DevicePlugin" FILE "devicepluginmockdevice.json") + Q_PLUGIN_METADATA(IID "org.guhyourhome.DevicePlugin" FILE "devicepluginmockdevice.json") Q_INTERFACES(DevicePlugin) public: @@ -19,7 +19,7 @@ public: QString pluginName() const override; QUuid pluginId() const override; - void hiveTimer() override; + void guhTimer() override; }; diff --git a/tests/mocks/mockdeviceplugin/mockdeviceplugin.pro b/tests/mocks/mockdeviceplugin/mockdeviceplugin.pro index 8fb5ccaf..e9da6a4e 100644 --- a/tests/mocks/mockdeviceplugin/mockdeviceplugin.pro +++ b/tests/mocks/mockdeviceplugin/mockdeviceplugin.pro @@ -1,6 +1,6 @@ include($$top_srcdir/plugins/plugins.pri) -TARGET = $$qtLibraryTarget(hive_devicepluginmockdevice) +TARGET = $$qtLibraryTarget(guh_devicepluginmockdevice) SOURCES += \ devicepluginmockdevice.cpp