docs guh -> nymea
This commit is contained in:
parent
b46f6f3968
commit
79cc563eb0
14
README.md
14
README.md
@ -1,19 +1,19 @@
|
|||||||
# guh
|
# nymea
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
|
|
||||||
*guh* (/[guːh]/ - pronounced German and sounds like "*goo*") is an open source IoT (Internet of Things) server, which allows to control a lot of different devices from many different manufacturers. With the powerful rule engine you are able to connect any device available in the system and create individual scenes and behaviors for your environment.
|
*nymea* is an open source IoT (Internet of Things) server, which allows to control a lot of different devices from many different manufacturers. With the powerful rule engine you are able to connect any device available in the system and create individual scenes and behaviors for your environment.
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
In order to getting started with *guh* and find information you can take a look at following links:
|
In order to getting started with *nymea* and find information you can take a look at following links:
|
||||||
|
|
||||||
* A detailed description how to install and getting started with the *guh* can be found in the
|
* A detailed description how to install and getting started with the *nymea* can be found in the
|
||||||
|
|
||||||
[guh | github wiki](https://github.com/guh/guh/wiki).
|
[nymea | github wiki](https://github.com/guh/guh/wiki).
|
||||||
|
|
||||||
* A detailed documentation of the source code can be found in the
|
* A detailed documentation of the source code can be found in the
|
||||||
|
|
||||||
[guh | developer documentation](https://developers.guh.io).
|
[nymea | developer documentation](https://doc.nymea.io).
|
||||||
|
|
||||||
|
|
||||||
## Donate
|
## Donate
|
||||||
@ -24,5 +24,5 @@ We are grateful for any help!
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
--------------------------------------------
|
--------------------------------------------
|
||||||
> guh is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License.
|
> nymea is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License.
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
\page classes.html
|
\page classes.html
|
||||||
\title All guh Classes
|
\title All nymea Classes
|
||||||
|
|
||||||
\generatelist classes
|
\generatelist classes
|
||||||
\generatelist overviews
|
\generatelist overviews
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
/*!
|
/*!
|
||||||
\page allmodules.html
|
\page allmodules.html
|
||||||
\title All guh Modules
|
\title All nymea Modules
|
||||||
|
|
||||||
\table 80%
|
\table 80%
|
||||||
\row \li \l{guhserver} \li The guh server daemon implementation
|
\row \li \l{nymeaserver} \li The nymea server daemon implementation
|
||||||
\row \li \l{libguh} \li Common data types and plugin interfaces
|
\row \li \l{libnymea} \li Common data types and plugin interfaces
|
||||||
\row \li \l{Plugins} \li The device plugins of the guh server
|
\row \li \l{Plugins} \li The device plugins of the nymea server
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
\generatelist legalese-command
|
\generatelist legalese-command
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
/*!
|
/*!
|
||||||
\page api.html
|
\page api.html
|
||||||
\title Overview of guh API's
|
\title Overview of nymea API's
|
||||||
|
|
||||||
The guh server provides two different API's:
|
The nymea server provides two different API's:
|
||||||
\list
|
\list
|
||||||
\li \l{JSON-RPC API}{JSON-RPC}
|
\li \l{JSON-RPC API}{JSON-RPC}
|
||||||
\li \l{https://github.com/guh/guh/wiki/REST-API}{REST}
|
\li \l{https://github.com/guh/guh/wiki/REST-API}{REST}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The \l{https://github.com/guh/guh/wiki/REST-API}{REST API} is accessable on the \l{guhserver::WebServer}{WebServer}. The JSON-RPC API can be accessed from the \l {guhserver::TcpServer}{TcpServer} and the \l {guhserver::WebSocketServer}{WebSocketServer} interface. The command line interface \b {\tt guh-cli} communicates with the \l {guhserver::TcpServer}{TcpServer} and \l {JSON-RPC API}. The \b {\tt guh-webinterface} uses the \l{guhserver::WebServer}{WebServer} with the \l{https://github.com/guh/guh/wiki/REST-API}{REST-API} and catches notifications from the \l {guhserver::WebSocketServer}{WebSocketServer}.
|
The \l{https://github.com/guh/guh/wiki/REST-API}{REST API} is accessable on the \l{nymeaserver::WebServer}{WebServer}. The JSON-RPC API can be accessed from the \l {nymeaserver::TcpServer}{TcpServer} and the \l {nymeaserver::WebSocketServer}{WebSocketServer} interface. The command line interface \b {\tt nymea-cli} communicates with the \l {nymeaserver::TcpServer}{TcpServer} and \l {JSON-RPC API}. The \b {\tt nymea-webinterface} uses the \l{nymeaserver::WebServer}{WebServer} with the \l{https://github.com/guh/guh/wiki/REST-API}{REST-API} and catches notifications from the \l {nymeaserver::WebSocketServer}{WebSocketServer}.
|
||||||
|
|
||||||
\image api-overview.png
|
\image api-overview.png
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
\page coap-overview.html
|
\page coap-overview.html
|
||||||
\title CoAP
|
\title CoAP
|
||||||
|
|
||||||
In order to interact with a CoAP (Constrained Application Protocol) server guh provides following classes:
|
In order to interact with a CoAP (Constrained Application Protocol) server nymea provides following classes:
|
||||||
|
|
||||||
\annotatedlist coap
|
\annotatedlist coap
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
include(html-template.qdocconf)
|
include(html-template.qdocconf)
|
||||||
|
|
||||||
project = guh - developer
|
project = nymea - developer
|
||||||
description = Developer documentation!
|
description = Developer documentation!
|
||||||
|
|
||||||
dita.metadata.default.author = Simon Stürz
|
dita.metadata.default.author = Simon Stürz
|
||||||
@ -22,7 +22,7 @@ outputencoding = UTF-8
|
|||||||
sourceencoding = UTF-8
|
sourceencoding = UTF-8
|
||||||
|
|
||||||
syntaxhighlighting = true
|
syntaxhighlighting = true
|
||||||
versionsym = GUH_VERSION_STRING
|
versionsym = NYMEA_VERSION_STRING
|
||||||
|
|
||||||
headerdirs = ..
|
headerdirs = ..
|
||||||
headers.fileextensions = "*.h"
|
headers.fileextensions = "*.h"
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
\page deviceplugins.html
|
\page deviceplugins.html
|
||||||
\title Device Plugins
|
\title Device Plugins
|
||||||
|
|
||||||
\brief This is the API for implementing guh device plugins.
|
\brief This is the API for implementing nymea device plugins.
|
||||||
|
|
||||||
When creating a device plugin, start by subclassing \l{DevicePlugin} and filling
|
When creating a device plugin, start by subclassing \l{DevicePlugin} and filling
|
||||||
in information for the pure virtual methods.
|
in information for the pure virtual methods.
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
/*!
|
/*!
|
||||||
\page getting-started-plugins.html
|
\page getting-started-plugins.html
|
||||||
\title Getting Started
|
\title Getting Started
|
||||||
\brief Understanding the basic concept of guh plugins
|
\brief Understanding the basic concept of nymea plugins
|
||||||
|
|
||||||
\b{\unicode{0x2192} \underline{\l{https://www.youtube.com/watch?v=B8oqItKCcgU}{Video for this tutorial}}}
|
\b{\unicode{0x2192} \underline{\l{https://www.youtube.com/watch?v=B8oqItKCcgU}{Video for this tutorial}}}
|
||||||
|
|
||||||
Plugins in guh are used to exand the functionalitys and capabilitys of the guh server. A plugin is basically a shared library, which will be loaded dynamically from the guh server during the start up process. Each plugin has a \e name, a \e uuid and a list of supported \e vendors which will be visible in the system once the plugin is loaded. Each of thouse \l{Vendor}{Vendors} contains a list of supported \l{DeviceClass}{DeviceClasses}. A \l{DeviceClass} describes how the supported \l{Device} looks like, how it will be created (\l{DeviceClass::CreateMethod}{CreateMethod}), how the setup (\l{DeviceClass::SetupMethod}{SetupMethod}) looks like and what you can do with the \l{Device}.
|
Plugins in nymea are used to exand the functionalitys and capabilitys of the nymea server. A plugin is basically a shared library, which will be loaded dynamically from the nymea server during the start up process. Each plugin has a \e name, a \e uuid and a list of supported \e vendors which will be visible in the system once the plugin is loaded. Each of thouse \l{Vendor}{Vendors} contains a list of supported \l{DeviceClass}{DeviceClasses}. A \l{DeviceClass} describes how the supported \l{Device} looks like, how it will be created (\l{DeviceClass::CreateMethod}{CreateMethod}), how the setup (\l{DeviceClass::SetupMethod}{SetupMethod}) looks like and what you can do with the \l{Device}.
|
||||||
|
|
||||||
\section1 Devices
|
\section1 Devices
|
||||||
A device in guh can represent a real device, a gateway or even a service like weather. When you want to represent you own device / service in guh, you should try to abstract that device and think in terms like:
|
A device in nymea can represent a real device, a gateway or even a service like weather. When you want to represent you own device / service in nymea, you should try to abstract that device and think in terms like:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li \l{ParamType}{ParamTypes} \unicode{0x2192} A \l{Device} can have \l{Param}{Params}, which will be needed to set up the device (like IP addresses or device configurations) and give information for the user like name or location. The \l{ParamType} represents the description of an actual \l{Param}.
|
\li \l{ParamType}{ParamTypes} \unicode{0x2192} A \l{Device} can have \l{Param}{Params}, which will be needed to set up the device (like IP addresses or device configurations) and give information for the user like name or location. The \l{ParamType} represents the description of an actual \l{Param}.
|
||||||
@ -20,10 +20,10 @@
|
|||||||
The \l{DeviceClass} represents the description of an actual \l{Device}.
|
The \l{DeviceClass} represents the description of an actual \l{Device}.
|
||||||
|
|
||||||
\section1 Hardware resources
|
\section1 Hardware resources
|
||||||
The \e libguh provides a list of \l{Hardware Resources}{HardwareResources}, which can be used in every plugin. When sou start writing a plugin, you need to know which resource you will need. Each resource provides it's own interface for a \l{DevicePlugin}. In the plugin you don't have to take care about the resource.
|
The \e libnymea provides a list of \l{Hardware Resources}{HardwareResources}, which can be used in every plugin. When sou start writing a plugin, you need to know which resource you will need. Each resource provides it's own interface for a \l{DevicePlugin}. In the plugin you don't have to take care about the resource.
|
||||||
|
|
||||||
\section1 Getting started with a plugin
|
\section1 Getting started with a plugin
|
||||||
In order to show how a plugin ist structured here is an example of the most minimalistic device plugin possible for the guh system.
|
In order to show how a plugin ist structured here is an example of the most minimalistic device plugin possible for the nymea system.
|
||||||
|
|
||||||
For an easier start we provide a set of plugin templates which can be used for your own plugin and to have a basic for the tutorials described in this documentation. You can get the templates with following command:
|
For an easier start we provide a set of plugin templates which can be used for your own plugin and to have a basic for the tutorials described in this documentation. You can get the templates with following command:
|
||||||
|
|
||||||
@ -56,7 +56,7 @@
|
|||||||
\code
|
\code
|
||||||
include(plugins.pri)
|
include(plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(guh_devicepluginminimal)
|
TARGET = $$qtLibraryTarget(nymea_devicepluginminimal)
|
||||||
|
|
||||||
message("Building $$deviceplugin$${TARGET}.so")
|
message("Building $$deviceplugin$${TARGET}.so")
|
||||||
|
|
||||||
@ -69,15 +69,15 @@
|
|||||||
|
|
||||||
The \b TARGET parameter definens the name of the resulting plugin lib file and should should have following name structure:
|
The \b TARGET parameter definens the name of the resulting plugin lib file and should should have following name structure:
|
||||||
|
|
||||||
\tt {guh_deviceplugin\b<pluginName>}
|
\tt {nymea_deviceplugin\b<pluginName>}
|
||||||
|
|
||||||
In this example the pluginname is \e minimal, which means the lib file name will be \e guh_devicepluginminimal.so. You can check the name of the plugin in the "Project Messages" (\tt{alt + 6} in Qt Creator).
|
In this example the pluginname is \e minimal, which means the lib file name will be \e nymea_devicepluginminimal.so. You can check the name of the plugin in the "Project Messages" (\tt{alt + 6} in Qt Creator).
|
||||||
|
|
||||||
The \b SOURCES and \b HEADERS variables define the \tt .cpp and \tt .h files of your plugin like in any other Qt project.
|
The \b SOURCES and \b HEADERS variables define the \tt .cpp and \tt .h files of your plugin like in any other Qt project.
|
||||||
|
|
||||||
|
|
||||||
\section3 plugins.pri
|
\section3 plugins.pri
|
||||||
The \tt plugins.pri file contains all relevant definitions and configuration to build a plugin. Each plugin must contain this file and \underline{should not} be changed. In this file the precompiler \b guh-generateplugininfo will be called.
|
The \tt plugins.pri file contains all relevant definitions and configuration to build a plugin. Each plugin must contain this file and \underline{should not} be changed. In this file the precompiler \b nymea-generateplugininfo will be called.
|
||||||
\code
|
\code
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += plugin
|
CONFIG += plugin
|
||||||
@ -87,19 +87,19 @@
|
|||||||
QMAKE_CXXFLAGS += -Werror -std=c++11
|
QMAKE_CXXFLAGS += -Werror -std=c++11
|
||||||
QMAKE_LFLAGS += -std=c++11
|
QMAKE_LFLAGS += -std=c++11
|
||||||
|
|
||||||
INCLUDEPATH += /usr/include/guh
|
INCLUDEPATH += /usr/include/nymea
|
||||||
LIBS += -lguh
|
LIBS += -lnymea
|
||||||
|
|
||||||
infofile.output = plugininfo.h
|
infofile.output = plugininfo.h
|
||||||
infofile.commands = /usr/bin/guh-generateplugininfo ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
|
infofile.commands = /usr/bin/nymea-generateplugininfo ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
|
||||||
infofile.depends = /usr/bin/guh-generateplugininfo
|
infofile.depends = /usr/bin/nymea-generateplugininfo
|
||||||
infofile.CONFIG = no_link
|
infofile.CONFIG = no_link
|
||||||
JSONFILES = deviceplugin"$$TARGET".json
|
JSONFILES = deviceplugin"$$TARGET".json
|
||||||
infofile.input = JSONFILES
|
infofile.input = JSONFILES
|
||||||
|
|
||||||
QMAKE_EXTRA_COMPILERS += infofile
|
QMAKE_EXTRA_COMPILERS += infofile
|
||||||
|
|
||||||
target.path = /usr/lib/guh/plugins/
|
target.path = /usr/lib/nymea/plugins/
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
@ -111,7 +111,7 @@
|
|||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\section3 devicepluginminimal.json
|
\section3 devicepluginminimal.json
|
||||||
The properties of a plugin will be definend with in the \tt JSON file containing all needed information for guh to load it. The name convention fot the json file is:
|
The properties of a plugin will be definend with in the \tt JSON file containing all needed information for nymea to load it. The name convention fot the json file is:
|
||||||
|
|
||||||
\tt {deviceplugin\b{<pluginName>}.json}
|
\tt {deviceplugin\b{<pluginName>}.json}
|
||||||
|
|
||||||
@ -172,7 +172,7 @@
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PLUGIN_METADATA(IID "guru.guh.DevicePlugin" FILE "devicepluginminimal.json")
|
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginminimal.json")
|
||||||
Q_INTERFACES(DevicePlugin)
|
Q_INTERFACES(DevicePlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
/*!
|
|
||||||
\namespace guhserver
|
|
||||||
\brief The namespace for the guh server.
|
|
||||||
\inmodule core
|
|
||||||
|
|
||||||
This namespace represents the whole guh server. This prevents duplicated class names in plugin and core.
|
|
||||||
*/
|
|
||||||
@ -2,5 +2,7 @@
|
|||||||
\page hardware.html
|
\page hardware.html
|
||||||
\title Hardware Resources
|
\title Hardware Resources
|
||||||
|
|
||||||
|
\brief This is the list of nymea hardware resources.
|
||||||
|
|
||||||
\annotatedlist hardware
|
\annotatedlist hardware
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -29,7 +29,7 @@ HTML.headerstyles = \
|
|||||||
" <link rel=\"icon\" type=\"image/png\" href=\"favicon-32x32.png\" sizes=\"32x32\" /> \n" \
|
" <link rel=\"icon\" type=\"image/png\" href=\"favicon-32x32.png\" sizes=\"32x32\" /> \n" \
|
||||||
" <link rel=\"icon\" type=\"image/png\" href=\"favicon-16x16.png\" sizes=\"16x16\" /> \n" \
|
" <link rel=\"icon\" type=\"image/png\" href=\"favicon-16x16.png\" sizes=\"16x16\" /> \n" \
|
||||||
" <link rel=\"icon\" type=\"image/png\" href=\"favicon-128.png\" sizes=\"128x128\" /> \n" \
|
" <link rel=\"icon\" type=\"image/png\" href=\"favicon-128.png\" sizes=\"128x128\" /> \n" \
|
||||||
" <meta name=\"guh\" content=\" \"/> \n" \
|
" <meta name=\"nymea\" content=\" \"/> \n" \
|
||||||
" <meta name=\"msapplication-TileColor\" content=\"#FFFFFF\" /> \n" \
|
" <meta name=\"msapplication-TileColor\" content=\"#FFFFFF\" /> \n" \
|
||||||
" <meta name=\"msapplication-TileImage\" content=\"mstile-144x144.png\" /> \n" \
|
" <meta name=\"msapplication-TileImage\" content=\"mstile-144x144.png\" /> \n" \
|
||||||
" <meta name=\"msapplication-square70x70logo\" content=\"mstile-70x70.png\" /> \n" \
|
" <meta name=\"msapplication-square70x70logo\" content=\"mstile-70x70.png\" /> \n" \
|
||||||
|
|||||||
@ -2,21 +2,21 @@ include(html-styles.qdocconf)
|
|||||||
|
|
||||||
HTML.postheader = \
|
HTML.postheader = \
|
||||||
"<div class=\"header\">\n" \
|
"<div class=\"header\">\n" \
|
||||||
" <nav class=\"guh-navbar-container guh-margin guh-navbar\">\n" \
|
" <nav class=\"nymea-navbar-container nymea-margin nymea-navbar\">\n" \
|
||||||
" <div class=\"guh-navbar-center\">\n" \
|
" <div class=\"nymea-navbar-center\">\n" \
|
||||||
" <div class=\"guh-navbar-center-left\">\n" \
|
" <div class=\"nymea-navbar-center-left\">\n" \
|
||||||
" <div>\n" \
|
" <div>\n" \
|
||||||
" <ul class=\"guh-navbar-nav\">\n" \
|
" <ul class=\"nymea-navbar-nav\">\n" \
|
||||||
" <li><a href=\"index.html\">Home</a></li>\n" \
|
" <li><a href=\"index.html\">Home</a></li>\n" \
|
||||||
" <li><a href=\"guhserver.html\">Server</a></li>\n" \
|
" <li><a href=\"nymeaserver.html\">Server</a></li>\n" \
|
||||||
" <li><a href=\"libguh-module.html\">Lib</a></li>\n" \
|
" <li><a href=\"libnymea-module.html\">Lib</a></li>\n" \
|
||||||
" </ul>\n" \
|
" </ul>\n" \
|
||||||
" </div>\n" \
|
" </div>\n" \
|
||||||
" </div>\n" \
|
" </div>\n" \
|
||||||
" <a href=\"index.html\" class=\"indexref guh-logo\"><img src=\"images/main-logo.svg\" class=\"guh-main-logo\"/></a>\n" \
|
" <a href=\"index.html\" class=\"indexref nymea-logo\"><img src=\"images/main-logo.svg\" class=\"nymea-main-logo\"/></a>\n" \
|
||||||
" <div class=\"guh-navbar-center-right\">\n" \
|
" <div class=\"nymea-navbar-center-right\">\n" \
|
||||||
" <div>\n" \
|
" <div>\n" \
|
||||||
" <ul class=\"guh-navbar-nav\">\n" \
|
" <ul class=\"nymea-navbar-nav\">\n" \
|
||||||
" <li><a href=\"plugins.html\">Plugins</a></li>\n" \
|
" <li><a href=\"plugins.html\">Plugins</a></li>\n" \
|
||||||
" <li><a href=\"api.html\">API</a></li>\n" \
|
" <li><a href=\"api.html\">API</a></li>\n" \
|
||||||
" <li><a href=\"write-plugins.html\">Write Plugins</a></li>\n" \
|
" <li><a href=\"write-plugins.html\">Write Plugins</a></li>\n" \
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
The JSON RPC interface represents a TCP socket connection using plaintext string communication.
|
The JSON RPC interface represents a TCP socket connection using plaintext string communication.
|
||||||
Messages are exchanged using the JSON format. Please note that this is not a REST API as the
|
Messages are exchanged using the JSON format. Please note that this is not a REST API as the
|
||||||
transport channel is not based on HTTP. It is an internal RPC mechanism to allow communication
|
transport channel is not based on HTTP. It is an internal RPC mechanism to allow communication
|
||||||
between the guh Server and the main controller interface. This communication socket is not meant
|
between the nymea Server and the main controller interface. This communication socket is not meant
|
||||||
to be exported to the outside of the of the systen as it allows arbitrary commands to manipulate
|
to be exported to the outside of the of the systen as it allows arbitrary commands to manipulate
|
||||||
the system.
|
the system.
|
||||||
|
|
||||||
@ -36,7 +36,7 @@
|
|||||||
\section1 Communicating with the server
|
\section1 Communicating with the server
|
||||||
The server listens by default on TCP port 2222 for incoming TCP connections. It will respond to incoming connections with a some information about the server. Telnet can be used to issue commands for testing.
|
The server listens by default on TCP port 2222 for incoming TCP connections. It will respond to incoming connections with a some information about the server. Telnet can be used to issue commands for testing.
|
||||||
|
|
||||||
An example how to communicate with the API using telnet on the same host where the guh server
|
An example how to communicate with the API using telnet on the same host where the nymea server
|
||||||
is running:
|
is running:
|
||||||
\code
|
\code
|
||||||
$ telnet localhost 2222
|
$ telnet localhost 2222
|
||||||
@ -48,7 +48,7 @@
|
|||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"protocol version": 28,
|
"protocol version": 28,
|
||||||
"server": "guh JSONRPC interface",
|
"server": "nymea JSONRPC interface",
|
||||||
"version": "0.6.0"
|
"version": "0.6.0"
|
||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
/*!
|
/*!
|
||||||
\module libguh
|
\module libnymea
|
||||||
\title The guh library
|
\title The nymea library
|
||||||
|
|
||||||
\chapter Types of libguh
|
\chapter Types of libnymea
|
||||||
\annotatedlist guh-types
|
\annotatedlist nymea-types
|
||||||
|
|
||||||
\chapter Device Plugins
|
\chapter Device Plugins
|
||||||
\annotatedlist devices
|
\annotatedlist devices
|
||||||
@ -1,7 +1,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\page license.html
|
\page license.html
|
||||||
\title License
|
\title License
|
||||||
\brief The license agreement of guh
|
\brief The license agreement of nymea
|
||||||
|
|
||||||
Copyright 2013-2018 Simon Stürz <simon.stuerz@guh.io>.
|
Copyright 2013-2018 Simon Stürz <simon.stuerz@guh.io>.
|
||||||
|
|
||||||
|
|||||||
28
doc/main.css
28
doc/main.css
@ -614,7 +614,7 @@ div.table {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar {
|
.nymea-navbar {
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -626,11 +626,11 @@ div.table {
|
|||||||
border-bottom: 1px solid #dbdbdb;
|
border-bottom: 1px solid #dbdbdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-margin {
|
.nymea-margin {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-logo {
|
.nymea-logo {
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -648,13 +648,13 @@ div.table {
|
|||||||
margin: 0 45px;
|
margin: 0 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-main-logo {
|
.nymea-main-logo {
|
||||||
height: 85px;
|
height: 85px;
|
||||||
min-height: 85px;
|
min-height: 85px;
|
||||||
max-height: 85px;
|
max-height: 85px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-center {
|
.nymea-navbar-center {
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -663,7 +663,7 @@ div.table {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-center:only-child {
|
.nymea-navbar-center:only-child {
|
||||||
-ms-flex-wrap: wrap;
|
-ms-flex-wrap: wrap;
|
||||||
-webkit-flex-wrap: wrap;
|
-webkit-flex-wrap: wrap;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@ -672,7 +672,7 @@ div.table {
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-nav {
|
.nymea-navbar-nav {
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -681,20 +681,20 @@ div.table {
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-nav li {
|
.nymea-navbar-nav li {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* Required for text-overflow to do anything */
|
/* Required for text-overflow to do anything */
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-nav li:after {
|
.nymea-navbar-nav li:after {
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-nav > li > a {
|
.nymea-navbar-nav > li > a {
|
||||||
color: #676767;
|
color: #676767;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
@ -736,12 +736,12 @@ div.header + li {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-center-left, .guh-navbar-center-right {
|
.nymea-navbar-center-left, .nymea-navbar-center-right {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-center-left > *, .guh-navbar-center-right > * {
|
.nymea-navbar-center-left > *, .nymea-navbar-center-right > * {
|
||||||
display: -ms-flexbox;
|
display: -ms-flexbox;
|
||||||
display: -webkit-flex;
|
display: -webkit-flex;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -750,11 +750,11 @@ div.header + li {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-center-left {
|
.nymea-navbar-center-left {
|
||||||
right: 100%;
|
right: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.guh-navbar-center-right {
|
.nymea-navbar-center-right {
|
||||||
left: 100%;
|
left: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,37 +2,37 @@
|
|||||||
\page index.html
|
\page index.html
|
||||||
|
|
||||||
\section1 Overview
|
\section1 Overview
|
||||||
The guh daemon consists of three main modules:
|
The nymea daemon consists of three main modules:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li \l{guhserver}{The guh server}
|
\li \l{nymeaserver}{The nymea server}
|
||||||
\list
|
\list
|
||||||
\li \l{guhserver}{The guh server namespace}
|
\li \l{nymeaserver}{The nymea server namespace}
|
||||||
\li \l{Rules}{The Rule Engine}
|
\li \l{Rules}{The Rule Engine}
|
||||||
\li \l{Server classes}{The server classes}
|
\li \l{Server classes}{The server classes}
|
||||||
\li \l{Logging classes}{The Log Engine classes}
|
\li \l{Logging classes}{The Log Engine classes}
|
||||||
\endlist
|
\endlist
|
||||||
\li \l{libguh}{The guh library}
|
\li \l{libnymea}{The nymea library}
|
||||||
\list
|
\list
|
||||||
\li \l{Types of libguh}
|
\li \l{Types of libnymea}
|
||||||
\li \l{Device Plugins}{The Device Plugin API}
|
\li \l{Device Plugins}{The Device Plugin API}
|
||||||
\li \l{Hardware Resources}{Hardware resources available for plugins}
|
\li \l{Hardware Resources}{Hardware resources available for plugins}
|
||||||
\li \l{GuhSettings}{Settings API of guh}
|
\li \l{NymeaSettings}{Settings API of nymea}
|
||||||
\li \l{Type Utils}{Global types of guh (Type Utils)}
|
\li \l{Type Utils}{Global types of nymea (Type Utils)}
|
||||||
\li \l{CoAP}{The CoAP API}
|
\li \l{CoAP}{The CoAP API}
|
||||||
\endlist
|
\endlist
|
||||||
\li \l{Plugins}{The guh plugins}
|
\li \l{Plugins}{The nymea plugins}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 API's
|
\section1 API's
|
||||||
The guh daemon provides two API's:
|
The nymea daemon provides two API's:
|
||||||
\list
|
\list
|
||||||
\li \l{JSON-RPC API}{JSON-RPC}
|
\li \l{JSON-RPC API}{JSON-RPC}
|
||||||
\li \l{https://github.com/guh/guh/wiki/REST-API}{REST}
|
\li \l{https://github.com/guh/guh/wiki/REST-API}{REST}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Write your own plugin
|
\section1 Write your own plugin
|
||||||
Here you can find some tutorials for developing and working with guh:
|
Here you can find some tutorials for developing and working with nymea:
|
||||||
\list
|
\list
|
||||||
\li \l{Set up the build environment}
|
\li \l{Set up the build environment}
|
||||||
\li \l{Getting started}
|
\li \l{Getting started}
|
||||||
@ -47,10 +47,10 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Quicklinks
|
\section1 Quicklinks
|
||||||
Overview of all classes and modules in guh
|
Overview of all classes and modules in nymea
|
||||||
\list
|
\list
|
||||||
\li \l{All guh Classes}
|
\li \l{All nymea Classes}
|
||||||
\li \l{All guh Modules}
|
\li \l{All nymea Modules}
|
||||||
\endlist
|
\endlist
|
||||||
*/
|
*/
|
||||||
|
|
||||||
7
doc/nymeaserver.qdoc
Normal file
7
doc/nymeaserver.qdoc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/*!
|
||||||
|
\namespace nymeaserver
|
||||||
|
\brief The namespace for the nymea server.
|
||||||
|
\inmodule core
|
||||||
|
|
||||||
|
This namespace represents the whole nymea server. This prevents duplicated class names in plugin and core.
|
||||||
|
*/
|
||||||
@ -3,12 +3,12 @@
|
|||||||
\title The plugin JSON File
|
\title The plugin JSON File
|
||||||
\brief Description of the plugin JSON file structure.
|
\brief Description of the plugin JSON file structure.
|
||||||
|
|
||||||
Each \l{DevicePlugin}{Plugin} in guh will be defined in the corresponding JSON file. You can find information how to read JSON \l{http://json.org/}{here}. This file will be loaded from the \l{DeviceManager} to define the plugin and the corresponding DeviceClasses internal.
|
Each \l{DevicePlugin}{Plugin} in nymea will be defined in the corresponding JSON file. You can find information how to read JSON \l{http://json.org/}{here}. This file will be loaded from the \l{DeviceManager} to define the plugin and the corresponding DeviceClasses internal.
|
||||||
|
|
||||||
|
|
||||||
\section1 The \b {\tt guh-generateplugininfo} precompiler
|
\section1 The \b {\tt nymea-generateplugininfo} precompiler
|
||||||
|
|
||||||
The \tt {\b guh-generateplugininfo} precompiler will parse this file and generates a \tt plugininfo.h and a \tt extern-plugininfo.h file containing the definitions of:
|
The \tt {\b nymea-generateplugininfo} precompiler will parse this file and generates a \tt plugininfo.h and a \tt extern-plugininfo.h file containing the definitions of:
|
||||||
\list
|
\list
|
||||||
\li \l{PluginId}: <\e pluginId \unicode{0x2192} the defined UUID for the \l{DevicePlugin}.
|
\li \l{PluginId}: <\e pluginId \unicode{0x2192} the defined UUID for the \l{DevicePlugin}.
|
||||||
\li \l{VendorId}: <\e idName>VendorId \unicode{0x2192} the defined UUID for the corresponding \l{Vendor}.
|
\li \l{VendorId}: <\e idName>VendorId \unicode{0x2192} the defined UUID for the corresponding \l{Vendor}.
|
||||||
@ -91,7 +91,7 @@
|
|||||||
qCWarning(dcExample) << "Warning the world!";
|
qCWarning(dcExample) << "Warning the world!";
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Please start allways with a capital letter i.e. \tt {"idName": "Example"}. The logging category allowes you to categorise the debug output. It can be configured with the \tt -d argument of guhd (see \tt {$ man guhd}).
|
Please start allways with a capital letter i.e. \tt {"idName": "Example"}. The logging category allowes you to categorise the debug output. It can be configured with the \tt -d argument of nymead (see \tt {$ man nymead}).
|
||||||
\li - \underline{\e id:} The actual uuid (\l{PluginId}) of the plugin \unicode{0x2192} \l{DevicePlugin::pluginId()}
|
\li - \underline{\e id:} The actual uuid (\l{PluginId}) of the plugin \unicode{0x2192} \l{DevicePlugin::pluginId()}
|
||||||
\li - \underline{\e paramTypes:} Optionl: A list of \l{ParamType}{ParamTypes} which define the paramters of this plugin \unicode{0x2192} \l{DevicePlugin::configuration()} (see section "\l{The ParamType definition}").
|
\li - \underline{\e paramTypes:} Optionl: A list of \l{ParamType}{ParamTypes} which define the paramters of this plugin \unicode{0x2192} \l{DevicePlugin::configuration()} (see section "\l{The ParamType definition}").
|
||||||
\li - \underline{\e vendors:} The list of \l{Vendor}{Vendors} objects (see section "\l{The Vendor definition}");
|
\li - \underline{\e vendors:} The list of \l{Vendor}{Vendors} objects (see section "\l{The Vendor definition}");
|
||||||
@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
|
|
||||||
\section2 The Vendor definition
|
\section2 The Vendor definition
|
||||||
A plugin can support more then one \l{Vendor}, so the parameter \e vendors in the plugin definition is a list. Each element of this list represents a \l{Vendor} in guh.
|
A plugin can support more then one \l{Vendor}, so the parameter \e vendors in the plugin definition is a list. Each element of this list represents a \l{Vendor} in nymea.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 The DeviceClass definition
|
\section2 The DeviceClass definition
|
||||||
A \l{Vendor} can support more then one \l{DeviceClass}, so the parameter \e deviceClasses in the vendor definition is a list. Each element of this list represents a \l{DeviceClass} in guh.
|
A \l{Vendor} can support more then one \l{DeviceClass}, so the parameter \e deviceClasses in the vendor definition is a list. Each element of this list represents a \l{DeviceClass} in nymea.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
}
|
}
|
||||||
@ -278,7 +278,7 @@
|
|||||||
|
|
||||||
|
|
||||||
\section2 The StateType definition
|
\section2 The StateType definition
|
||||||
A \l{DeviceClass} can have a list of \l{StateType}{StateTypes} which allow you to represent a state of a device. A \l{State} can be changed/updated in the plugin code. If you change a state in the plugin using \l{Device::setStateValue()} an \l{Event} will generate automatically in the \l{guhserver::GuhCore}. This \l{Event} has the same uuid (\l{EventTypeId}) like the \l{State} which created the "<stateName> changed" \l{Event}. The event will have exactly one \l{Param}, which has the same properties like the \l{StateType} value and contains the new value.
|
A \l{DeviceClass} can have a list of \l{StateType}{StateTypes} which allow you to represent a state of a device. A \l{State} can be changed/updated in the plugin code. If you change a state in the plugin using \l{Device::setStateValue()} an \l{Event} will generate automatically in the \l{nymeaserver::NymeaCore}. This \l{Event} has the same uuid (\l{EventTypeId}) like the \l{State} which created the "<stateName> changed" \l{Event}. The event will have exactly one \l{Param}, which has the same properties like the \l{StateType} value and contains the new value.
|
||||||
|
|
||||||
A \l{StateType} has following parameters:
|
A \l{StateType} has following parameters:
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ This mechanism was created to ensure that the \l{EventType} and \l{ActionType} w
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 The ActionType definition
|
\section2 The ActionType definition
|
||||||
A \l{DeviceClass} can have more then one \l{ActionType}, so the parameter \e actionTypes in the \l{DeviceClass} definition is a list. Each element of this list represents an \l{ActionType} in guh.
|
A \l{DeviceClass} can have more then one \l{ActionType}, so the parameter \e actionTypes in the \l{DeviceClass} definition is a list. Each element of this list represents an \l{ActionType} in nymea.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
}
|
}
|
||||||
@ -424,7 +424,7 @@ This mechanism was created to ensure that the \l{EventType} and \l{ActionType} w
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 The EventType definition
|
\section2 The EventType definition
|
||||||
A \l{DeviceClass} can have more then one \l{EventType}, so the parameter \e eventTypes in the \l{DeviceClass} definition is a list. Each element of this list represents an \l{EventType} in guh.
|
A \l{DeviceClass} can have more then one \l{EventType}, so the parameter \e eventTypes in the \l{DeviceClass} definition is a list. Each element of this list represents an \l{EventType} in nymea.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,17 +4,17 @@
|
|||||||
|
|
||||||
Here you can find the current list of supported plugins sorted by the corresponding package.
|
Here you can find the current list of supported plugins sorted by the corresponding package.
|
||||||
|
|
||||||
\section2 The default \tt{guh-plugins} package:
|
\section2 The default \tt{nymea-plugins} package:
|
||||||
\annotatedlist guh-plugins
|
\annotatedlist nymea-plugins
|
||||||
|
|
||||||
\section2 The \tt{guh-plugins-merkur} package:
|
\section2 The \tt{nymea-plugins-merkur} package:
|
||||||
\annotatedlist guh-plugins-merkur
|
\annotatedlist nymea-plugins-merkur
|
||||||
|
|
||||||
\section2 The \tt{guh-plugins-maker} package:
|
\section2 The \tt{nymea-plugins-maker} package:
|
||||||
\annotatedlist guh-plugins-maker
|
\annotatedlist nymea-plugins-maker
|
||||||
|
|
||||||
\section2 The \tt{guh-tests} package plugins:
|
\section2 The \tt{nymea-tests} package plugins:
|
||||||
\annotatedlist guh-tests
|
\annotatedlist nymea-tests
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -6,17 +6,17 @@
|
|||||||
|
|
||||||
\section1 Introduction
|
\section1 Introduction
|
||||||
|
|
||||||
Rules define all the logic in guh.
|
Rules define all the logic in nymea.
|
||||||
A rule is composed by a set of \l{Event}{Events}, \l{State}{States} and \l{Action}{Actions}.
|
A rule is composed by a set of \l{Event}{Events}, \l{State}{States} and \l{Action}{Actions}.
|
||||||
|
|
||||||
This diagram shows how rules are composed and interpreted by
|
This diagram shows how rules are composed and interpreted by
|
||||||
the \l{guhserver::RuleEngine}.
|
the \l{nymeaserver::RuleEngine}.
|
||||||
|
|
||||||
\image Rules_definition.svg "Rules definition"
|
\image Rules_definition.svg "Rules definition"
|
||||||
|
|
||||||
A basic concept of a \l{guhserver::Rule} is the trigger path. This is the path that defines when a \l{guhserver::Rule}
|
A basic concept of a \l{nymeaserver::Rule} is the trigger path. This is the path that defines when a \l{nymeaserver::Rule}
|
||||||
is triggered for evaluation. Each element added on a trigger path (either red or blue) has the possibility to trigger the
|
is triggered for evaluation. Each element added on a trigger path (either red or blue) has the possibility to trigger the
|
||||||
\l{guhserver::RuleEngine} to evaluate the complete rule and ultimately execute the defined \l{Action}{Actions} if the
|
\l{nymeaserver::RuleEngine} to evaluate the complete rule and ultimately execute the defined \l{Action}{Actions} if the
|
||||||
whole rule evaluates to true. Once the trigger path has been left (i.e. a black arrow is followed),
|
whole rule evaluates to true. Once the trigger path has been left (i.e. a black arrow is followed),
|
||||||
subsequent elements will still be evaluated when the rule is triggered, but they won't trigger the
|
subsequent elements will still be evaluated when the rule is triggered, but they won't trigger the
|
||||||
evaluation themselves.
|
evaluation themselves.
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
/*!
|
/*!
|
||||||
\page build-environment.html
|
\page build-environment.html
|
||||||
\title Set up the build environment
|
\title Set up the build environment
|
||||||
\brief This tutorial shows you how to set up the build environment for developing guh.
|
\brief This tutorial shows you how to set up the build environment for developing nymea.
|
||||||
|
|
||||||
\b{\unicode{0x2192} \underline{\l{https://www.youtube.com/watch?v=7a_k0C1Ib1A}{Video for this tutorial}}}
|
\b{\unicode{0x2192} \underline{\l{https://www.youtube.com/watch?v=7a_k0C1Ib1A}{Video for this tutorial}}}
|
||||||
|
|
||||||
Assuming you are working on an Ubuntu system here are the steps how to set up the build environment. Basically you can choose your prefered SDK but all tutorials are based on the Qt Creator and we recommand to use that one. You can also use the Ubuntu SDK, which is basically a modified Qt Creator.
|
Assuming you are working on an Ubuntu system here are the steps how to set up the build environment. Basically you can choose your prefered SDK but all tutorials are based on the Qt Creator and we recommand to use that one. You can also use the Ubuntu SDK, which is basically a modified Qt Creator.
|
||||||
|
|
||||||
\note Please take care that you are using the Qt version from the system for building. The guh server will allways be built with the official Qt version for the appropriate system version. The plugin \underline{must} have the same version like the guh server.
|
\note Please take care that you are using the Qt version from the system for building. The nymea server will allways be built with the official Qt version for the appropriate system version. The plugin \underline{must} have the same version like the nymea server.
|
||||||
|
|
||||||
\section2 Install Qt
|
\section2 Install Qt
|
||||||
In the first step you need to install the Qt libraries:
|
In the first step you need to install the Qt libraries:
|
||||||
@ -16,26 +16,26 @@
|
|||||||
$ sudo apt-get install qtcreator qt5-default qtbase5-dev python dpkg-dev debhelper hardening-wrapper
|
$ sudo apt-get install qtcreator qt5-default qtbase5-dev python dpkg-dev debhelper hardening-wrapper
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\section2 Install guh dependencys
|
\section2 Install nymea dependencys
|
||||||
|
|
||||||
You can find a good instructions how to install the guh repository on your system here:
|
You can find a good instructions how to install the nymea repository on your system here:
|
||||||
|
|
||||||
\b {\unicode{0x2192}} \l{https://github.com/guh/guh/wiki/Install}{guh install wiki}
|
\b {\unicode{0x2192}} \l{https://github.com/guh/guh/wiki/Install}{nymea install wiki}
|
||||||
|
|
||||||
For example, if you are working on Ubuntu 15.04 Vivid, you can create a source list file and add the guh repository like this:
|
For example, if you are working on Ubuntu 15.04 Vivid, you can create a source list file and add the nymea repository like this:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ sudo nano /etc/apt/sources.list.d/guh.list
|
$ sudo nano /etc/apt/sources.list.d/nymea.list
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Copy following 3 lines in the \tt /etc/apt/sources.list.d/guh.list file, save and close it
|
Copy following 3 lines in the \tt /etc/apt/sources.list.d/nymea.list file, save and close it
|
||||||
\code
|
\code
|
||||||
## guh repo
|
## nymea repo
|
||||||
deb http://repo.guh.guru vivid main
|
deb http://repo.nymea.io xenial main
|
||||||
deb-src http://repo.guh.guru vivid main
|
deb-src http://repo.nymea.io xenial main
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Now you need to add the public key of the \e guh-repository to your key list with following command:
|
Now you need to add the public key of the \e nymea-repository to your key list with following command:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 6B9376B0
|
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 6B9376B0
|
||||||
@ -47,18 +47,18 @@
|
|||||||
$ sudo apt-get update
|
$ sudo apt-get update
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Now you are ready to install the guh packages:
|
Now you are ready to install the nymea packages:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ sudo apt-get install guh guh-webinterface guh-cli guh-doc libguh1-dev
|
$ sudo apt-get install nymea nymea-webinterface nymea-cli nymea-doc libnymea1-dev
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li \underline{\e guh} \unicode{0x2192} the \tt guh package is a meta package and will install the \tt guhd, \tt libguh1 and \tt guh-plugins package so you can start the guh daemon.
|
\li \underline{\e nymea} \unicode{0x2192} the \tt nymea package is a meta package and will install the \tt nymead, \tt libnymea1 and \tt nymea-plugins package so you can start the nymea daemon.
|
||||||
\li \underline{\e guh-webinterface} \unicode{0x2192} the \tt guh-webinterface package will install the webinterface for guh, which is accessable on \l{http://localhost:3333}.
|
\li \underline{\e nymea-webinterface} \unicode{0x2192} the \tt nymea-webinterface package will install the webinterface for nymea, which is accessable on \l{http://localhost:3333}.
|
||||||
\li \underline{\e guh-cli} \unicode{0x2192} the \tt guh-cli package will install the command line interface for the guh JSON-RPC API. You can find more infomation \l{https://github.com/guh/guh/wiki/guh-cli}{here}.
|
\li \underline{\e nymea-cli} \unicode{0x2192} the \tt nymea-cli package will install the command line interface for the nymea JSON-RPC API. You can find more infomation \l{https://github.com/guh/guh/wiki/guh-cli}{here}.
|
||||||
\li \underline{\e guh-doc} \unicode{0x2192} the \tt guh-doc package will install the offline documentation on your system (this homepage). You can access the documentation in your brwoser with \l{file:///usr/share/doc/guh/html/index.html}{file:///usr/share/doc/guh/html/index.html}.
|
\li \underline{\e nymea-doc} \unicode{0x2192} the \tt nymea-doc package will install the offline documentation on your system (this homepage). You can access the documentation in your brwoser with \l{file:///usr/share/doc/nymea/html/index.html}{file:///usr/share/doc/nymea/html/index.html}.
|
||||||
\li \underline{\e libguh1-dev} \unicode{0x2192} the \tt libguh1-dev package brings all development files of guh (header files and lib) which will be needed to write a plugin.
|
\li \underline{\e libnymea1-dev} \unicode{0x2192} the \tt libnymea1-dev package brings all development files of nymea (header files and lib) which will be needed to write a plugin.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
Once you have successfully installed everything you are ready for \l{Getting started}.
|
Once you have successfully installed everything you are ready for \l{Getting started}.
|
||||||
|
|||||||
@ -3,20 +3,20 @@
|
|||||||
\title Testing your plugin
|
\title Testing your plugin
|
||||||
\brief This page describes how to test your plugin that you've just created
|
\brief This page describes how to test your plugin that you've just created
|
||||||
|
|
||||||
In order to make guhd load your plugin, you have 2 options. Either install it into the system or make guhd load it from your plugin build directory.
|
In order to make nymead load your plugin, you have 2 options. Either install it into the system or make nymead load it from your plugin build directory.
|
||||||
|
|
||||||
To install the plugin into the system, run
|
To install the plugin into the system, run
|
||||||
\code
|
\code
|
||||||
$ make install
|
$ make install
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
To make guhd load the plugin from the plugins build directory, run guhd with an environment variable exported
|
To make nymead load the plugin from the plugins build directory, run nymead with an environment variable exported
|
||||||
\code
|
\code
|
||||||
$ GUH_PLUGINS_DIR=/path/to/plugin/ guhd
|
$ NYMEA_PLUGINS_DIR=/path/to/plugin/ nymead
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
In order to easier debug things, it is advised to enable debug output for the device manager and your plugin. E.g.
|
In order to easier debug things, it is advised to enable debug output for the device manager and your plugin. E.g.
|
||||||
\code
|
\code
|
||||||
$ GUH_PLUGINS_DIR=/path/to/plugin guhd -d DeviceManager,YourPlugin
|
$ NYMEA_PLUGINS_DIR=/path/to/plugin nymead -d DeviceManager,YourPlugin
|
||||||
\endcode
|
\endcode
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -29,38 +29,38 @@
|
|||||||
|
|
||||||
devicepluginminimal.o
|
devicepluginminimal.o
|
||||||
extern-plugininfo.h
|
extern-plugininfo.h
|
||||||
libguh_devicepluginminimal.so
|
libnymea_devicepluginminimal.so
|
||||||
Makefile
|
Makefile
|
||||||
moc_devicepluginminimal.cpp
|
moc_devicepluginminimal.cpp
|
||||||
moc_devicepluginminimal.o
|
moc_devicepluginminimal.o
|
||||||
plugininfo.h
|
plugininfo.h
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
As you can see there are two new header files: the \tt plugininfo.h and \tt extern-plugininfo.h . Thouse files were generated by the \tt {\b guh-generateplugininfo} and contain the uuid definitions of from the \tt devicepluginminimal.json file. You can find out more about thouse files in \l{The plugin JSON File} documentation.
|
As you can see there are two new header files: the \tt plugininfo.h and \tt extern-plugininfo.h . Thouse files were generated by the \tt {\b nymea-generateplugininfo} and contain the uuid definitions of from the \tt devicepluginminimal.json file. You can find out more about thouse files in \l{The plugin JSON File} documentation.
|
||||||
|
|
||||||
The \b {\tt libguh_devicepluginminimal.so} file is our fresh compiled deviceplugin.
|
The \b {\tt libnymea_devicepluginminimal.so} file is our fresh compiled deviceplugin.
|
||||||
|
|
||||||
\section1 Install the plugin
|
\section1 Install the plugin
|
||||||
|
|
||||||
I you have installed guh using the repository (see \l{Set up the build environment}) you will find the installed plugins here:
|
I you have installed nymea using the repository (see \l{Set up the build environment}) you will find the installed plugins here:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
/usr/lib/guh/plugins/
|
/usr/lib/nymea/plugins/
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
This is the directory where we have to install the \b {\tt libguh_devicepluginminimal.so} file. You have two possibilities to install the new plugin. For bouth methods you need \tt root permissions:
|
This is the directory where we have to install the \b {\tt libnymea_devicepluginminimal.so} file. You have two possibilities to install the new plugin. For bouth methods you need \tt root permissions:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Install using \b {\tt make}:
|
\li Install using \b {\tt make}:
|
||||||
\code
|
\code
|
||||||
$ cd build-minimal-Desktop-Debug/
|
$ cd build-minimal-Desktop-Debug/
|
||||||
$ sudo make install
|
$ sudo make install
|
||||||
install -m 755 -p "libguh_devicepluginminimal.so" "/usr/lib/guh/plugins/libguh_devicepluginminimal.so"
|
install -m 755 -p "libnymea_devicepluginminimal.so" "/usr/lib/nymea/plugins/libnymea_devicepluginminimal.so"
|
||||||
\endcode
|
\endcode
|
||||||
\li Copy the file manually:
|
\li Copy the file manually:
|
||||||
\code
|
\code
|
||||||
$ cd build-minimal-Desktop-Debug/
|
$ cd build-minimal-Desktop-Debug/
|
||||||
$ sudo cp libguh_devicepluginminimal.so /usr/lib/guh/plugins/
|
$ sudo cp libnymea_devicepluginminimal.so /usr/lib/nymea/plugins/
|
||||||
\endcode
|
\endcode
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@ -68,49 +68,49 @@
|
|||||||
|
|
||||||
\section1 Test the plugin
|
\section1 Test the plugin
|
||||||
|
|
||||||
If order to test the new plugin we need to restart the guh daemon. Please make shore there is only one instance of guh running on your system, otherwise one of the daemons will colide with the ports of the other one. Once you have installed the \b {\tt libguh_devicepluginminimal.so} file you need a clean start of the guh daemon.
|
If order to test the new plugin we need to restart the nymea daemon. Please make shore there is only one instance of nymea running on your system, otherwise one of the daemons will colide with the ports of the other one. Once you have installed the \b {\tt libnymea_devicepluginminimal.so} file you need a clean start of the nymea daemon.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guhd -n
|
$ nymead -n
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
If you want to see the debug output of the \b {\tt libguh_devicepluginminimal.so} you can start \tt guhd with the parameter \tt -d :
|
If you want to see the debug output of the \b {\tt libnymea_devicepluginminimal.so} you can start \tt nymead with the parameter \tt -d :
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guhd -n -d Minimal
|
$ nymead -n -d Minimal
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
With this command the debug category will be enabled for this plugin. By default the debug categorie of a plugin is disabled, to keep the STDOUT clean and readable. With the \tt -d parameter of \b {\tt guhd} you can specify which categorie you want to see. The categorie name will be defined in the \tt idName parameter of the plugin object in \l{The Plugin JSON file}.
|
With this command the debug category will be enabled for this plugin. By default the debug categorie of a plugin is disabled, to keep the STDOUT clean and readable. With the \tt -d parameter of \b {\tt nymead} you can specify which categorie you want to see. The categorie name will be defined in the \tt idName parameter of the plugin object in \l{The Plugin JSON file}.
|
||||||
|
|
||||||
Now you can use any guh client application to examin the new plugin and device. Since the application \b {\tt guh-cli} (guh command line interface) was developed for developers, I will show you how this works with the \b {\tt guh-cli}.
|
Now you can use any nymea client application to examin the new plugin and device. Since the application \b {\tt nymea-cli} (nymea command line interface) was developed for developers, I will show you how this works with the \b {\tt nymea-cli}.
|
||||||
|
|
||||||
\note You can open two terminal tabs. In the first one you can start \tt guhd with the \tt -n parameter to see the debug output. In the second one you can start \b {\tt guh-cli} to interact with the server and test your plugin. You can find the documentation for \b {\tt guh-cli} \l{https://github.com/guh/guh/wiki/guh-cli}{here}.
|
\note You can open two terminal tabs. In the first one you can start \tt nymead with the \tt -n parameter to see the debug output. In the second one you can start \b {\tt nymea-cli} to interact with the server and test your plugin. You can find the documentation for \b {\tt nymea-cli} \l{https://github.com/guh/guh/wiki/guh-cli}{here}.
|
||||||
|
|
||||||
|
|
||||||
\section2 guh-cli
|
\section2 nymea-cli
|
||||||
|
|
||||||
The guh command line interface \b {\tt guh-cli} is an admin tool for testing \l{Plugins}, the \l{JSON-RPC API} and core functionalities of guh. It communicates with the guh daemon using the \l{JSON-RPC API} over the \l{guhserver::TcpServer}{TcpServer}.
|
The nymea command line interface \b {\tt nymea-cli} is an admin tool for testing \l{Plugins}, the \l{JSON-RPC API} and core functionalities of nymea. It communicates with the nymea daemon using the \l{JSON-RPC API} over the \l{nymeaserver::TcpServer}{TcpServer}.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guh-cli
|
$ nymea-cli
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\section3 Add a new device
|
\section3 Add a new device
|
||||||
|
|
||||||
Here is an example how to \e {Add a new device} with \b {\tt guh-cli}. This steps should give you a feeling how the setup process works from the client to the method in the \l{DevicePlugin}.
|
Here is an example how to \e {Add a new device} with \b {\tt nymea-cli}. This steps should give you a feeling how the setup process works from the client to the method in the \l{DevicePlugin}.
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Open guh-cli and enter the \b "Devices" menue:
|
\li Open nymea-cli and enter the \b "Devices" menue:
|
||||||
\image guh-cli.png "guh-cli"
|
\image nymea-cli.png "nymea-cli"
|
||||||
\li Select the \b {"Add a new device"} menue:
|
\li Select the \b {"Add a new device"} menue:
|
||||||
\image guh-cli_devices_add-device.png "Add a new device"
|
\image nymea-cli_devices_add-device.png "Add a new device"
|
||||||
\li Select the \b {"Minimal vendor"} from the \l{Vendor}{Vendors} list. Take a look at \l{The Plugin JSON file} \unicode{0x2192} \l{The Vendor definition} to see where this will be definend.
|
\li Select the \b {"Minimal vendor"} from the \l{Vendor}{Vendors} list. Take a look at \l{The Plugin JSON file} \unicode{0x2192} \l{The Vendor definition} to see where this will be definend.
|
||||||
\image guh-cli_devices_add-device_minimal-1.png "Select vendor"
|
\image nymea-cli_devices_add-device_minimal-1.png "Select vendor"
|
||||||
\li Select the \b {"Minimal device"} from the list of supported devices for this \l{Vendor}. Take a look at \l{The Plugin JSON file} \unicode{0x2192} \l{The DeviceClass definition} to see where this will be definend.
|
\li Select the \b {"Minimal device"} from the list of supported devices for this \l{Vendor}. Take a look at \l{The Plugin JSON file} \unicode{0x2192} \l{The DeviceClass definition} to see where this will be definend.
|
||||||
\image guh-cli_devices_add-device_minimal-2.png "Select device"
|
\image nymea-cli_devices_add-device_minimal-2.png "Select device"
|
||||||
\li Now enter the \e value for the \l{Param} \e "name" of the \l{DeviceClass} \e {"Minimal device"}. Take a look at \l{The Plugin JSON file} \unicode{0x2192} \l{The ParamType definition} to see where this will be definend. This parameter will be used to set up the new \l{Device}. Once you entered the \e name for the new \l {Device} and pressed \tt enter, the \l{DeviceManager} will call the \l{DevicePlugin::setupDevice()} in the \tt devicepluginminimal.cpp.
|
\li Now enter the \e value for the \l{Param} \e "name" of the \l{DeviceClass} \e {"Minimal device"}. Take a look at \l{The Plugin JSON file} \unicode{0x2192} \l{The ParamType definition} to see where this will be definend. This parameter will be used to set up the new \l{Device}. Once you entered the \e name for the new \l {Device} and pressed \tt enter, the \l{DeviceManager} will call the \l{DevicePlugin::setupDevice()} in the \tt devicepluginminimal.cpp.
|
||||||
|
|
||||||
\image guh-cli_devices_add-device_minimal-3.png "Set the parameter \"name\""
|
\image nymea-cli_devices_add-device_minimal-3.png "Set the parameter \"name\""
|
||||||
|
|
||||||
A new \l{Device} with a new \l{DeviceId} will be created and the passed to the \l{DevicePlugin::setupDevice()} in your plugin.
|
A new \l{Device} with a new \l{DeviceId} will be created and the passed to the \l{DevicePlugin::setupDevice()} in your plugin.
|
||||||
You can see here the implementation of the code:
|
You can see here the implementation of the code:
|
||||||
@ -126,7 +126,7 @@
|
|||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
If you started \b {\tt guhd} with the parameters \b {\tt{-n -d Minimal}} you will see following debug output:
|
If you started \b {\tt nymead} with the parameters \b {\tt{-n -d Minimal}} you will see following debug output:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
...
|
...
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
\code
|
\code
|
||||||
include(plugins.pri)
|
include(plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(guh_devicepluginminimal)
|
TARGET = $$qtLibraryTarget(nymea_devicepluginminimal)
|
||||||
|
|
||||||
message("Building $$deviceplugin$${TARGET}.so")
|
message("Building $$deviceplugin$${TARGET}.so")
|
||||||
|
|
||||||
@ -61,7 +61,7 @@
|
|||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Change the \tt TARGET name form \tt guh_devicepluginminimal \unicode{0x2192} \tt guh_devicepluginbuttons
|
\li Change the \tt TARGET name form \tt nymea_devicepluginminimal \unicode{0x2192} \tt nymea_devicepluginbuttons
|
||||||
\li Change the SOURCES file from \tt devicepluginminimal.cpp \unicode{0x2192} \tt devicepluginbuttons.cpp
|
\li Change the SOURCES file from \tt devicepluginminimal.cpp \unicode{0x2192} \tt devicepluginbuttons.cpp
|
||||||
\li Change the HEADERS file from \tt devicepluginminimal.h \unicode{0x2192} \tt devicepluginbuttons.h
|
\li Change the HEADERS file from \tt devicepluginminimal.h \unicode{0x2192} \tt devicepluginbuttons.h
|
||||||
\endlist
|
\endlist
|
||||||
@ -70,7 +70,7 @@
|
|||||||
\code
|
\code
|
||||||
include(plugins.pri)
|
include(plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(guh_devicepluginbuttons)
|
TARGET = $$qtLibraryTarget(nymea_devicepluginbuttons)
|
||||||
|
|
||||||
message("Building $$deviceplugin$${TARGET}.so")
|
message("Building $$deviceplugin$${TARGET}.so")
|
||||||
|
|
||||||
@ -97,7 +97,7 @@
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PLUGIN_METADATA(IID "guru.guh.DevicePlugin" FILE "devicepluginminimal.json")
|
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginminimal.json")
|
||||||
Q_INTERFACES(DevicePlugin)
|
Q_INTERFACES(DevicePlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -129,7 +129,7 @@
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PLUGIN_METADATA(IID "guru.guh.DevicePlugin" FILE "devicepluginbuttons.json")
|
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginbuttons.json")
|
||||||
Q_INTERFACES(DevicePlugin)
|
Q_INTERFACES(DevicePlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -372,7 +372,7 @@
|
|||||||
|
|
||||||
You will see in the build output following section:
|
You will see in the build output following section:
|
||||||
\code
|
\code
|
||||||
/usr/bin/guh-generateplugininfo ../buttons-diy/devicepluginbuttons.json plugininfo.h
|
/usr/bin/nymea-generateplugininfo ../buttons-diy/devicepluginbuttons.json plugininfo.h
|
||||||
../buttons-diy/devicepluginbuttons.json -> plugininfo.h
|
../buttons-diy/devicepluginbuttons.json -> plugininfo.h
|
||||||
--> generate plugininfo.h
|
--> generate plugininfo.h
|
||||||
PluginId for plugin "Buttons" = 7bfd3af5-7983-4540-9398-d14085d069f4
|
PluginId for plugin "Buttons" = 7bfd3af5-7983-4540-9398-d14085d069f4
|
||||||
@ -411,7 +411,7 @@
|
|||||||
|
|
||||||
\section1 Writing the plugin
|
\section1 Writing the plugin
|
||||||
|
|
||||||
Now we have our basic for starting to implement the new plugin. If you install the current plugin, you would already see the plugin implementation in \tt guh-cli, but it would do nothing because we have not implemented yet the code.
|
Now we have our basic for starting to implement the new plugin. If you install the current plugin, you would already see the plugin implementation in \tt nymea-cli, but it would do nothing because we have not implemented yet the code.
|
||||||
|
|
||||||
\section2 The \tt executeAction method
|
\section2 The \tt executeAction method
|
||||||
|
|
||||||
@ -441,22 +441,22 @@
|
|||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
When a user or the \l {guhserver::RuleEngine}{RuleEngine} calls the executeAction method, our plugin will first check if the \l DeviceClassId matches, then the \l ActionTypeId. If both are correct, we can emit our \l Event to show that the simple button \l Device was pressed.
|
When a user or the \l {nymeaserver::RuleEngine}{RuleEngine} calls the executeAction method, our plugin will first check if the \l DeviceClassId matches, then the \l ActionTypeId. If both are correct, we can emit our \l Event to show that the simple button \l Device was pressed.
|
||||||
|
|
||||||
You can see in the implementation that a new \l{Event} will be generated in guh. This is the way how you emit an Event for a device.
|
You can see in the implementation that a new \l{Event} will be generated in nymea. This is the way how you emit an Event for a device.
|
||||||
|
|
||||||
\section1 Test the plugin
|
\section1 Test the plugin
|
||||||
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Start guh with following command:
|
\li Start nymea with following command:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guhd -n -d Buttons
|
$ nymead -n -d Buttons
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\li Start guh-cli and add the a new \b {"Simple Button"} devcice. Give an appropriate name like \b {Test button}.
|
\li Start nymea-cli and add the a new \b {"Simple Button"} devcice. Give an appropriate name like \b {Test button}.
|
||||||
\li Use guh-cli to execute the \b {press the button} action:
|
\li Use nymea-cli to execute the \b {press the button} action:
|
||||||
|
|
||||||
\tt "Devices" \unicode{0x2192} \tt {"Execute an action"} \unicode{0x2192} \tt {"Your device name (Simple Button)"} \unicode{0x2192} \tt {press the button}
|
\tt "Devices" \unicode{0x2192} \tt {"Execute an action"} \unicode{0x2192} \tt {"Your device name (Simple Button)"} \unicode{0x2192} \tt {press the button}
|
||||||
|
|
||||||
@ -473,7 +473,7 @@
|
|||||||
|
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Now you have successfully implemented you first DeviceClass, which has an \l Action and an \l Event and can be used together with the \l {guhserver::RuleEngine}{RuleEngine}.
|
Now you have successfully implemented you first DeviceClass, which has an \l Action and an \l Event and can be used together with the \l {nymeaserver::RuleEngine}{RuleEngine}.
|
||||||
|
|
||||||
Now you can take a look at \l{Tutorial 3 - The "Power Button" device}.
|
Now you can take a look at \l{Tutorial 3 - The "Power Button" device}.
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
...
|
...
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
When a \l State value of a \l Device will be set, that will generate an \l Event in guh, which contains a \l Param holding the new \l State value.
|
When a \l State value of a \l Device will be set, that will generate an \l Event in nymea, which contains a \l Param holding the new \l State value.
|
||||||
|
|
||||||
\note You \underline don't have to take care about that \l Event, it will be generated automatically and will have the same uuid as \l EventTypeId like the \l StateTypeId. This makes it possible for client applications to link the \l Event to the corresponding \l State which generated the \l Event.
|
\note You \underline don't have to take care about that \l Event, it will be generated automatically and will have the same uuid as \l EventTypeId like the \l StateTypeId. This makes it possible for client applications to link the \l Event to the corresponding \l State which generated the \l Event.
|
||||||
|
|
||||||
@ -110,20 +110,20 @@
|
|||||||
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Start guh with following command:
|
\li Start nymea with following command:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guhd -n -d Buttons
|
$ nymead -n -d Buttons
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\li Start guh-cli and add the a new \b {"Power Button"} \l Device. Give an appropriate name like \b {Light}.
|
\li Start nymea-cli and add the a new \b {"Power Button"} \l Device. Give an appropriate name like \b {Light}.
|
||||||
\li Use guh-cli to check the current power \l State, it should be \tt false (default value).
|
\li Use nymea-cli to check the current power \l State, it should be \tt false (default value).
|
||||||
\li Use guh-cli to execute the \b {set power} \l Action:
|
\li Use nymea-cli to execute the \b {set power} \l Action:
|
||||||
|
|
||||||
\tt "Devices" \unicode{0x2192} \tt "Execute an action" \unicode{0x2192} \tt {"Your device name (Power Button)"} \unicode{0x2192} \tt {set power} \unicode{0x2192} \tt {true}
|
\tt "Devices" \unicode{0x2192} \tt "Execute an action" \unicode{0x2192} \tt {"Your device name (Power Button)"} \unicode{0x2192} \tt {set power} \unicode{0x2192} \tt {true}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
In the guhd stdout you should see the debug output from you plugin.
|
In the nymead stdout you should see the debug output from you plugin.
|
||||||
\code
|
\code
|
||||||
...
|
...
|
||||||
|
|
||||||
@ -134,7 +134,7 @@
|
|||||||
QUuid("{9328693e-9054-47bc-b95f-ae3e42d50b8b}")
|
QUuid("{9328693e-9054-47bc-b95f-ae3e42d50b8b}")
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Now you have successfully implemented you first DeviceClass, which has an parametrized \l Action and a \l State which generates an \l Event containig the new \l State value. This new DeviceClass can be used in the \l {guhserver::RuleEngine}{RuleEngine}. Feel free to play with the Device and the Rule engine to get a feeling how the system works.
|
Now you have successfully implemented you first DeviceClass, which has an parametrized \l Action and a \l State which generates an \l Event containig the new \l State value. This new DeviceClass can be used in the \l {nymeaserver::RuleEngine}{RuleEngine}. Feel free to play with the Device and the Rule engine to get a feeling how the system works.
|
||||||
|
|
||||||
Now you can take a look at \l{Tutorial 4 - The alternative "Power Button"}.
|
Now you can take a look at \l{Tutorial 4 - The alternative "Power Button"}.
|
||||||
|
|
||||||
|
|||||||
@ -90,20 +90,20 @@
|
|||||||
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Start guh with following command:
|
\li Start nymea with following command:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guhd -n -d Buttons
|
$ nymead -n -d Buttons
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\li Start guh-cli and add the a new \b {"Alternative Power Button"} \l Device. Give an appropriate name like \b {Alternative Light}.
|
\li Start nymea-cli and add the a new \b {"Alternative Power Button"} \l Device. Give an appropriate name like \b {Alternative Light}.
|
||||||
\li Use guh-cli to check the current power \l State, it should be \tt false (default value).
|
\li Use nymea-cli to check the current power \l State, it should be \tt false (default value).
|
||||||
\li Use guh-cli to execute the \b {set power} \l Action:
|
\li Use nymea-cli to execute the \b {set power} \l Action:
|
||||||
|
|
||||||
\tt "Devices" \unicode{0x2192} \tt {"Execute an action"} \unicode{0x2192} \tt {"Your device name (Alternative Power Button)"} \unicode{0x2192} \tt {set power} \unicode{0x2192} \tt {true}
|
\tt "Devices" \unicode{0x2192} \tt {"Execute an action"} \unicode{0x2192} \tt {"Your device name (Alternative Power Button)"} \unicode{0x2192} \tt {set power} \unicode{0x2192} \tt {true}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
In the guhd STDOUT you should see the debug output from you plugin. You will notice that the ActionTypeId, StateTypeId and EventTypeId are equal.
|
In the nymead STDOUT you should see the debug output from you plugin. You will notice that the ActionTypeId, StateTypeId and EventTypeId are equal.
|
||||||
|
|
||||||
\code
|
\code
|
||||||
...
|
...
|
||||||
|
|||||||
@ -43,7 +43,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
\code
|
\code
|
||||||
include(plugins.pri)
|
include(plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(guh_devicepluginminimal)
|
TARGET = $$qtLibraryTarget(nymea_devicepluginminimal)
|
||||||
|
|
||||||
message("Building $$deviceplugin$${TARGET}.so")
|
message("Building $$deviceplugin$${TARGET}.so")
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Change the \tt TARGET name form \tt guh_devicepluginminimal \unicode{0x2192} \tt guh_devicepluginnetworkinfo
|
\li Change the \tt TARGET name form \tt nymea_devicepluginminimal \unicode{0x2192} \tt nymea_devicepluginnetworkinfo
|
||||||
\li Change the SOURCES file from \tt devicepluginminimal.cpp \unicode{0x2192} \tt devicepluginnetworkinfo.cpp
|
\li Change the SOURCES file from \tt devicepluginminimal.cpp \unicode{0x2192} \tt devicepluginnetworkinfo.cpp
|
||||||
\li Change the HEADERS file from \tt devicepluginminimal.h \unicode{0x2192} \tt devicepluginnetworkinfo.h
|
\li Change the HEADERS file from \tt devicepluginminimal.h \unicode{0x2192} \tt devicepluginnetworkinfo.h
|
||||||
\endlist
|
\endlist
|
||||||
@ -65,7 +65,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
\code
|
\code
|
||||||
include(plugins.pri)
|
include(plugins.pri)
|
||||||
|
|
||||||
TARGET = $$qtLibraryTarget(guh_devicepluginnetworkinfo)
|
TARGET = $$qtLibraryTarget(nymea_devicepluginnetworkinfo)
|
||||||
|
|
||||||
message("Building $$deviceplugin$${TARGET}.so")
|
message("Building $$deviceplugin$${TARGET}.so")
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PLUGIN_METADATA(IID "guru.guh.DevicePlugin" FILE "devicepluginminimal.json")
|
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginminimal.json")
|
||||||
Q_INTERFACES(DevicePlugin)
|
Q_INTERFACES(DevicePlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -125,7 +125,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PLUGIN_METADATA(IID "guru.guh.DevicePlugin" FILE "devicepluginnetworkinfo.json")
|
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "devicepluginnetworkinfo.json")
|
||||||
Q_INTERFACES(DevicePlugin)
|
Q_INTERFACES(DevicePlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -201,7 +201,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
|
|
||||||
You will see in the build output following section:
|
You will see in the build output following section:
|
||||||
\code
|
\code
|
||||||
/usr/bin/guh-generateplugininfo ../networkinfo-diy/devicepluginnetworkinfo.json plugininfo.h
|
/usr/bin/nymea-generateplugininfo ../networkinfo-diy/devicepluginnetworkinfo.json plugininfo.h
|
||||||
../networkinfo-diy/devicepluginnetworkinfo.json -> plugininfo.h
|
../networkinfo-diy/devicepluginnetworkinfo.json -> plugininfo.h
|
||||||
--> generate plugininfo.h
|
--> generate plugininfo.h
|
||||||
PluginId for plugin "Minimal plugin" = 6878754a-f27d-4007-a4e5-b030b55853f5
|
PluginId for plugin "Minimal plugin" = 6878754a-f27d-4007-a4e5-b030b55853f5
|
||||||
@ -257,7 +257,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
|
|
||||||
For more details about how to write the JSON file please take a look at \l{The Plugin JSON file} documentation.
|
For more details about how to write the JSON file please take a look at \l{The Plugin JSON file} documentation.
|
||||||
|
|
||||||
\note As you can see in this example the \l Vendor for this \l DevicePlugin is the \e guh. Of course you can define here a new Vendor (using \tt uuidgen to generate a new UUID). Please take a look at the existing \l{Vendor}{Vendors} and check if your \l Vendor already exists. If the \l{Vendor} exists, please copy the \e name, \e idName and \e id to make shore all \l{Device}{Devices} from one \l{Vendor} will be together in the system like in this example for \e guh.
|
\note As you can see in this example the \l Vendor for this \l DevicePlugin is the \e nymea. Of course you can define here a new Vendor (using \tt uuidgen to generate a new UUID). Please take a look at the existing \l{Vendor}{Vendors} and check if your \l Vendor already exists. If the \l{Vendor} exists, please copy the \e name, \e idName and \e id to make shore all \l{Device}{Devices} from one \l{Vendor} will be together in the system like in this example for \e nymea.
|
||||||
|
|
||||||
Our new plugin will have the name \b {"Network Info"}, the corresponding logging categorie will be \tt dcNetworkInfo (defined from the \e {idName}). There will be one new \l{DeviceClass} with the \e name \b {Info about Network}. This \l{DeviceClass} has 6 \l{StateType}{StateTypes} and one \l{ActionType}.
|
Our new plugin will have the name \b {"Network Info"}, the corresponding logging categorie will be \tt dcNetworkInfo (defined from the \e {idName}). There will be one new \l{DeviceClass} with the \e name \b {Info about Network}. This \l{DeviceClass} has 6 \l{StateType}{StateTypes} and one \l{ActionType}.
|
||||||
|
|
||||||
@ -268,8 +268,8 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
"id": "c16852d7-f123-4dd5-983d-fc2eedb885aa",
|
"id": "c16852d7-f123-4dd5-983d-fc2eedb885aa",
|
||||||
"vendors": [
|
"vendors": [
|
||||||
{
|
{
|
||||||
"name": "guh",
|
"name": "nymea",
|
||||||
"idName": "guh",
|
"idName": "nymea",
|
||||||
"id": "2062d64d-3232-433c-88bc-0d33c0ba2ba6",
|
"id": "2062d64d-3232-433c-88bc-0d33c0ba2ba6",
|
||||||
"deviceClasses": [
|
"deviceClasses": [
|
||||||
{
|
{
|
||||||
@ -345,7 +345,7 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
Once you have changed \l{The Plugin JSON file} you should rebuild the whole project to make shore all changed will be considerated. In the \e {Qt Creator} got to the menu \unicode{0x2192} \b Build \unicode{0x2192} \b{Rebuild all} to create the new \tt plugininfo.h file. You should see in the build output something like this:
|
Once you have changed \l{The Plugin JSON file} you should rebuild the whole project to make shore all changed will be considerated. In the \e {Qt Creator} got to the menu \unicode{0x2192} \b Build \unicode{0x2192} \b{Rebuild all} to create the new \tt plugininfo.h file. You should see in the build output something like this:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
/usr/bin/guh-generateplugininfo ../networkinfo-diy/devicepluginnetworkinfo.json plugininfo.h
|
/usr/bin/nymea-generateplugininfo ../networkinfo-diy/devicepluginnetworkinfo.json plugininfo.h
|
||||||
../networkinfo-diy/devicepluginnetworkinfo.json -> plugininfo.h
|
../networkinfo-diy/devicepluginnetworkinfo.json -> plugininfo.h
|
||||||
--> generate plugininfo.h
|
--> generate plugininfo.h
|
||||||
PluginId for plugin "Network Info" = c16852d7-f123-4dd5-983d-fc2eedb885aa
|
PluginId for plugin "Network Info" = c16852d7-f123-4dd5-983d-fc2eedb885aa
|
||||||
@ -363,13 +363,13 @@ In order to get started with our new \b {"Network Info"} plugin we use the minim
|
|||||||
--> generated successfully "extern-plugininfo.h"
|
--> generated successfully "extern-plugininfo.h"
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\note You have to change the \tt {qCDebug(dcMinimal)} \unicode{0x2192} \tt {qCDebug(dcNetworkInfo)} because you have changed the plugin \e idName and therefore also the logging categorie. You need to start guh now with the parameter \b {\tt {guhd -n -d NetworkInfo}} to see the debug output of the new plugin.
|
\note You have to change the \tt {qCDebug(dcMinimal)} \unicode{0x2192} \tt {qCDebug(dcNetworkInfo)} because you have changed the plugin \e idName and therefore also the logging categorie. You need to start nymea now with the parameter \b {\tt {nymead -n -d NetworkInfo}} to see the debug output of the new plugin.
|
||||||
|
|
||||||
If you make a syntax error in the JSON file, you will get a build error with the position of the syntax error in the JSON file. Now your definitions should be in the plugininfo.h file and ready to use in the plugin source code.
|
If you make a syntax error in the JSON file, you will get a build error with the position of the syntax error in the JSON file. Now your definitions should be in the plugininfo.h file and ready to use in the plugin source code.
|
||||||
|
|
||||||
\section1 Writing the plugin
|
\section1 Writing the plugin
|
||||||
|
|
||||||
Now we have our basic for starting to implement the new defined plugin. If you install the current plugin, start \tt guhd and add the a \b {Info about Network} device whith \b {\tt guh-cli} you can check the device states and should see something like this:
|
Now we have our basic for starting to implement the new defined plugin. If you install the current plugin, start \tt nymead and add the a \b {Info about Network} device whith \b {\tt nymea-cli} you can check the device states and should see something like this:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
========================================================
|
========================================================
|
||||||
@ -567,20 +567,20 @@ parameter from \l{The Plugin JSON file}.
|
|||||||
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
Rebuild the whole project to make shore all changes are registered and install the plugin (see \l{Install the plugin}{Tutorial 1 - Install the plugin}).
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Start guh with following command:
|
\li Start nymea with following command:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
$ guhd -n -d NetworkInfo
|
$ nymead -n -d NetworkInfo
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\li Start guh-cli and add the a new "Info" devcice.
|
\li Start nymea-cli and add the a new "Info" devcice.
|
||||||
\li Use guh-cli to check if the device states are initialized with the default values from \l{Change the devicepluginnetworkinfo.json}:
|
\li Use nymea-cli to check if the device states are initialized with the default values from \l{Change the devicepluginnetworkinfo.json}:
|
||||||
|
|
||||||
\tt "Devices" \unicode{0x2192} \tt "List..." \unicode{0x2192} \tt {"List device states"} \unicode{0x2192} \tt {"Your device name"}.
|
\tt "Devices" \unicode{0x2192} \tt "List..." \unicode{0x2192} \tt {"List device states"} \unicode{0x2192} \tt {"Your device name"}.
|
||||||
\li Use guh-cli to execute the \b update action:
|
\li Use nymea-cli to execute the \b update action:
|
||||||
|
|
||||||
\tt "Devices" \unicode{0x2192} \tt "Execute action" \unicode{0x2192} \tt {"Your device name"} \unicode{0x2192} \tt {update}
|
\tt "Devices" \unicode{0x2192} \tt "Execute action" \unicode{0x2192} \tt {"Your device name"} \unicode{0x2192} \tt {update}
|
||||||
\li Use guh-cli to check if the device states were updated sucessfully:
|
\li Use nymea-cli to check if the device states were updated sucessfully:
|
||||||
|
|
||||||
\tt "Devices" \unicode{0x2192} \tt "List..." \unicode{0x2192} \tt {"List device states"} \unicode{0x2192} \tt {"Your device name"}.
|
\tt "Devices" \unicode{0x2192} \tt "List..." \unicode{0x2192} \tt {"List device states"} \unicode{0x2192} \tt {"Your device name"}.
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
\code
|
\code
|
||||||
include(plugins.pri)
|
include(plugins.pri)
|
||||||
|
|
||||||
TARGET = guh_deviceplugincoapclient
|
TARGET = nymea_deviceplugincoapclient
|
||||||
|
|
||||||
message(============================================)
|
message(============================================)
|
||||||
message("Qt version: $$[QT_VERSION]")
|
message("Qt version: $$[QT_VERSION]")
|
||||||
@ -53,8 +53,8 @@
|
|||||||
"vendors": [
|
"vendors": [
|
||||||
{
|
{
|
||||||
"id": "2062d64d-3232-433c-88bc-0d33c0ba2ba6",
|
"id": "2062d64d-3232-433c-88bc-0d33c0ba2ba6",
|
||||||
"name": "guh",
|
"name": "nymea",
|
||||||
"idName": "guh",
|
"idName": "nymea",
|
||||||
"deviceClasses": [
|
"deviceClasses": [
|
||||||
{
|
{
|
||||||
"deviceClassId": "69dcccbd-a66a-4c5b-8921-2fb86c4c4299",
|
"deviceClassId": "69dcccbd-a66a-4c5b-8921-2fb86c4c4299",
|
||||||
@ -127,7 +127,7 @@
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PLUGIN_METADATA(IID "guru.guh.DevicePlugin" FILE "deviceplugincoapclient.json")
|
Q_PLUGIN_METADATA(IID "io.nymea.DevicePlugin" FILE "deviceplugincoapclient.json")
|
||||||
Q_INTERFACES(DevicePlugin)
|
Q_INTERFACES(DevicePlugin)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -170,7 +170,7 @@
|
|||||||
|
|
||||||
#include "coap/corelinkparser.h"
|
#include "coap/corelinkparser.h"
|
||||||
|
|
||||||
// Note: You can find the documentation for this code here -> http://dev.guh.guru/write-plugins.html
|
// Note: You can find the documentation for this code here -> http://doc.nymea.io/write-plugins.html
|
||||||
|
|
||||||
// The constructor of this device plugin.
|
// The constructor of this device plugin.
|
||||||
DevicePluginCoapClient::DevicePluginCoapClient()
|
DevicePluginCoapClient::DevicePluginCoapClient()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
\page libguh-types.html
|
\page libnymea-types.html
|
||||||
\title Types of libguh
|
\title Types of libnymea
|
||||||
|
|
||||||
\annotatedlist guh-types
|
\annotatedlist nymea-types
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -342,7 +342,7 @@
|
|||||||
This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Action} and \l{RuleAction}.
|
This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Action} and \l{RuleAction}.
|
||||||
|
|
||||||
\section2 RuleId
|
\section2 RuleId
|
||||||
This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{guhserver::Rule}.
|
This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{nymeaserver::Rule}.
|
||||||
|
|
||||||
\section2 PairingTransactionId
|
\section2 PairingTransactionId
|
||||||
This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a pairing transaction.
|
This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a pairing transaction.
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
#include "network/upnp/upnpdevicedescriptor.h"
|
#include "network/upnp/upnpdevicedescriptor.h"
|
||||||
|
|
||||||
// Discovering UPnP devices reference: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
|
// Discovering UPnP devices reference: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
|
||||||
// guh basic device reference: http://upnp.org/specs/basic/UPnP-basic-Basic-v1-Device.pdf
|
// nymea basic device reference: http://upnp.org/specs/basic/UPnP-basic-Basic-v1-Device.pdf
|
||||||
|
|
||||||
namespace nymeaserver {
|
namespace nymeaserver {
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@
|
|||||||
Indicates from where the \l{LogEntry} was created. Can be used as flag.
|
Indicates from where the \l{LogEntry} was created. Can be used as flag.
|
||||||
|
|
||||||
\value LoggingSourceSystem
|
\value LoggingSourceSystem
|
||||||
This \l{LogEntry} was created from the guh system (server).
|
This \l{LogEntry} was created from the nymea system (server).
|
||||||
\value LoggingSourceEvents
|
\value LoggingSourceEvents
|
||||||
This \l{LogEntry} was created from an \l{Event} which trigged.
|
This \l{LogEntry} was created from an \l{Event} which trigged.
|
||||||
\value LoggingSourceActions
|
\value LoggingSourceActions
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
\ingroup logs
|
\ingroup logs
|
||||||
\inmodule core
|
\inmodule core
|
||||||
|
|
||||||
A \l{LogEntry} represents an a guh event which can be stored from the \l{LogEngine} to the database.
|
A \l{LogEntry} represents an a nymea event which can be stored from the \l{LogEngine} to the database.
|
||||||
Each LogEntry has a timestamp an can be loaded from the database and stored in the database.
|
Each LogEntry has a timestamp an can be loaded from the database and stored in the database.
|
||||||
|
|
||||||
\sa LogEngine, LogFilter, LogsResource, LoggingHandler
|
\sa LogEngine, LogFilter, LogsResource, LoggingHandler
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class nymeaserver::TimeManager
|
\class nymeaserver::TimeManager
|
||||||
\brief Describes the centralized time manager of guh.
|
\brief Describes the centralized time manager of nymea.
|
||||||
|
|
||||||
\ingroup rules
|
\ingroup rules
|
||||||
\inmodule core
|
\inmodule core
|
||||||
|
|||||||
@ -27,15 +27,15 @@
|
|||||||
|
|
||||||
The \l{WebServer} class provides a HTTP/1.1 web server. The web server
|
The \l{WebServer} class provides a HTTP/1.1 web server. The web server
|
||||||
provides access to the nymea-webinterface and the path can be specified
|
provides access to the nymea-webinterface and the path can be specified
|
||||||
in the \tt /etc/guh/nymead.conf file and to the guh \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST API}.
|
in the \tt /etc/nymea/nymead.conf file and to the nymea \l{https://github.com/guh/guh/wiki/REST-Api-documentation}{REST API}.
|
||||||
The default port for the web server is 3333, which is according to this
|
The default port for the web server is 3333, which is according to this
|
||||||
\l{https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers}{list}
|
\l{https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers}{list}
|
||||||
officially free.
|
officially free.
|
||||||
|
|
||||||
The URL for the insecure guh-webinterface access:
|
The URL for the insecure nymea-webinterface access:
|
||||||
\code http://localhost:3333\endcode
|
\code http://localhost:3333\endcode
|
||||||
|
|
||||||
The URL for the secure HTTPS (TLS 1.2) guh-webinterface access:
|
The URL for the secure HTTPS (TLS 1.2) nymea-webinterface access:
|
||||||
\code https://localhost:3333\endcode
|
\code https://localhost:3333\endcode
|
||||||
|
|
||||||
The URL for the insecure REST API access to a \l{RestResource}:
|
The URL for the insecure REST API access to a \l{RestResource}:
|
||||||
@ -44,10 +44,10 @@
|
|||||||
The URL for the secure HTTPS (TLS 1.2) REST API access to a \l{RestResource}:
|
The URL for the secure HTTPS (TLS 1.2) REST API access to a \l{RestResource}:
|
||||||
\code https://localhost:3333/api/v1/{RestResource}\endcode
|
\code https://localhost:3333/api/v1/{RestResource}\endcode
|
||||||
|
|
||||||
You can turn on the HTTPS server in the \tt WebServer section of the \tt /etc/guh/nymead.conf file.
|
You can turn on the HTTPS server in the \tt WebServer section of the \tt /etc/nymea/nymead.conf file.
|
||||||
|
|
||||||
\note For \tt HTTPS you need to have a certificate and configure it in the \tt SSL-configuration
|
\note For \tt HTTPS you need to have a certificate and configure it in the \tt SSL-configuration
|
||||||
section of the \tt /etc/guh/nymead.conf file.
|
section of the \tt /etc/nymea/nymead.conf file.
|
||||||
|
|
||||||
\sa WebServerClient, WebSocketServer, TcpServer
|
\sa WebServerClient, WebSocketServer, TcpServer
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -259,7 +259,7 @@ QList<QJsonObject> DeviceManager::pluginsMetadata()
|
|||||||
return pluginList;
|
return pluginList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Register a DevicePlugin class. This can be used to create devices internally from the guh system without having to create a full plugin.
|
/*! Register a DevicePlugin class. This can be used to create devices internally from the nymea system without having to create a full plugin.
|
||||||
The DeviceManager takes ownership of the object and will clean it up when exiting. Do not delete the object yourself. */
|
The DeviceManager takes ownership of the object and will clean it up when exiting. Do not delete the object yourself. */
|
||||||
void DeviceManager::registerStaticPlugin(DevicePlugin *plugin, const QJsonObject &metaData)
|
void DeviceManager::registerStaticPlugin(DevicePlugin *plugin, const QJsonObject &metaData)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -38,7 +38,7 @@
|
|||||||
#include "upnpdevicedescriptor.h"
|
#include "upnpdevicedescriptor.h"
|
||||||
|
|
||||||
// Discovering UPnP devices reference: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
|
// Discovering UPnP devices reference: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
|
||||||
// guh basic device reference: http://upnp.org/specs/basic/UPnP-basic-Basic-v1-Device.pdf
|
// nymea basic device reference: http://upnp.org/specs/basic/UPnP-basic-Basic-v1-Device.pdf
|
||||||
|
|
||||||
class LIBNYMEA_EXPORT UpnpDiscovery : public HardwareResource
|
class LIBNYMEA_EXPORT UpnpDiscovery : public HardwareResource
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
\value SettingsRolePlugins
|
\value SettingsRolePlugins
|
||||||
This role will create the \b{plugins.conf} file and is used to store the \l{DevicePlugin}{Plugin} configurations.
|
This role will create the \b{plugins.conf} file and is used to store the \l{DevicePlugin}{Plugin} configurations.
|
||||||
\value SettingsRoleGlobal
|
\value SettingsRoleGlobal
|
||||||
This role will create the \b{nymead.conf} file and is used to store the global settings of the guh system. This settings
|
This role will create the \b{nymead.conf} file and is used to store the global settings of the nymea system. This settings
|
||||||
file is read only.
|
file is read only.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -80,8 +80,7 @@
|
|||||||
/*!
|
/*!
|
||||||
\fn void DevicePlugin::emitEvent(const Event &event)
|
\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.
|
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,
|
Usually events are emitted in response to incoming data or other other events happening. 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
|
\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.
|
create a \l{Event} complying to that \l{EventType} and emit it here.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class Action
|
\class Action
|
||||||
\brief Holds information required to execute an action described by a \l{ActionType}.
|
\brief Holds information required to execute an action described by a \l{ActionType}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
It is bound to a \l{Device} and an \l{ActionType} and holds the parameters
|
It is bound to a \l{Device} and an \l{ActionType} and holds the parameters
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class ActionType
|
\class ActionType
|
||||||
\brief Describes an \l{Action} for a \l{Device}.
|
\brief Describes an \l{Action} for a \l{Device}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
ActionTypes are contained in \l{DeviceClass} templates returned
|
ActionTypes are contained in \l{DeviceClass} templates returned
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class Event
|
\class Event
|
||||||
\brief Holds information required to emit a event described by a \l{EventType}.
|
\brief Holds information required to emit a event described by a \l{EventType}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
It is bound to a \l{Device} and a \l{EventType} and holds the parameters
|
It is bound to a \l{Device} and a \l{EventType} and holds the parameters
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class EventDescriptor
|
\class EventDescriptor
|
||||||
\brief Describes a certain \l{Event}.
|
\brief Describes a certain \l{Event}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\ingroup rules
|
\ingroup rules
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class EventType
|
\class EventType
|
||||||
\brief Describes a \l{Event} for a \l{Device}.
|
\brief Describes a \l{Event} for a \l{Device}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
\sa Event, EventDescriptor
|
\sa Event, EventDescriptor
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class Param
|
\class Param
|
||||||
\brief Holds the parameters of a Param.
|
\brief Holds the parameters of a Param.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
\sa Device, ParamType, ParamDescriptor
|
\sa Device, ParamType, ParamDescriptor
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class ParamDescriptor
|
\class ParamDescriptor
|
||||||
\brief Describes a certain \l{Param}.
|
\brief Describes a certain \l{Param}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\ingroup rules
|
\ingroup rules
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class ParamType
|
\class ParamType
|
||||||
\brief Describes a certain ParamType.
|
\brief Describes a certain ParamType.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
\sa Device, Param, ParamDescriptor
|
\sa Device, Param, ParamDescriptor
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class RuleAction
|
\class RuleAction
|
||||||
\brief Describes an action for a \l{nymeaserver::Rule}.
|
\brief Describes an action for a \l{nymeaserver::Rule}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\ingroup rules
|
\ingroup rules
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class RuleActionParam
|
\class RuleActionParam
|
||||||
\brief Holds the parameters for a \l{RuleAction}.
|
\brief Holds the parameters for a \l{RuleAction}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\ingroup rules
|
\ingroup rules
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class State
|
\class State
|
||||||
\brief Holds the parameters of a State of a \l{Device}.
|
\brief Holds the parameters of a State of a \l{Device}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
States hold the state values for devices. A State is associated to a \l{Device} by
|
States hold the state values for devices. A State is associated to a \l{Device} by
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class StateDescriptor
|
\class StateDescriptor
|
||||||
\brief Describes a certain \l{State}.
|
\brief Describes a certain \l{State}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\ingroup rules
|
\ingroup rules
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
\class StateType
|
\class StateType
|
||||||
\brief Describes the Type of a \l{State} from \l{Device}.
|
\brief Describes the Type of a \l{State} from \l{Device}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
\sa State, StateDescriptor
|
\sa State, StateDescriptor
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
\class Vendor
|
\class Vendor
|
||||||
\brief Holds information about a the vendor of a \l{Device}.
|
\brief Holds information about a the vendor of a \l{Device}.
|
||||||
|
|
||||||
\ingroup guh-types
|
\ingroup nymea-types
|
||||||
\inmodule libnymea
|
\inmodule libnymea
|
||||||
|
|
||||||
\sa DevicePlugin
|
\sa DevicePlugin
|
||||||
|
|||||||
@ -24,10 +24,10 @@
|
|||||||
/*!
|
/*!
|
||||||
\page mockdevices.html
|
\page mockdevices.html
|
||||||
\title Mock devices
|
\title Mock devices
|
||||||
\brief Devices for the guh test base.
|
\brief Devices for the nymea test base.
|
||||||
|
|
||||||
\ingroup plugins
|
\ingroup plugins
|
||||||
\ingroup guh-tests
|
\ingroup nymea-tests
|
||||||
|
|
||||||
The mock devices are used for testing.
|
The mock devices are used for testing.
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
{
|
{
|
||||||
"id": "2062d64d-3232-433c-88bc-0d33c0ba2ba6",
|
"id": "2062d64d-3232-433c-88bc-0d33c0ba2ba6",
|
||||||
"name": "guh",
|
"name": "guh",
|
||||||
"displayName": "guh",
|
"displayName": "guh GmbH",
|
||||||
"deviceClasses": [
|
"deviceClasses": [
|
||||||
{
|
{
|
||||||
"id": "753f0d32-0468-4d08-82ed-1964aab03298",
|
"id": "753f0d32-0468-4d08-82ed-1964aab03298",
|
||||||
@ -643,7 +643,7 @@
|
|||||||
"displayName": "URL",
|
"displayName": "URL",
|
||||||
"type": "QString",
|
"type": "QString",
|
||||||
"inputType": "Url",
|
"inputType": "Url",
|
||||||
"defaultValue": "http://guh.guru"
|
"defaultValue": "http://nymea.io"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "e93db587-7919-48f3-8c88-1651de63c765",
|
"id": "e93db587-7919-48f3-8c88-1651de63c765",
|
||||||
|
|||||||
@ -159,7 +159,7 @@ int main(int argc, char *argv[])
|
|||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.addVersionOption();
|
parser.addVersionOption();
|
||||||
QString applicationDescription = QCoreApplication::translate("main", "\nguh ( /[guːh]/ ) is an open source IoT (Internet of Things) server, \n"
|
QString applicationDescription = QCoreApplication::translate("main", "\nnymea is an open source IoT (Internet of Things) server, \n"
|
||||||
"which allows to control a lot of different devices from many different \n"
|
"which allows to control a lot of different devices from many different \n"
|
||||||
"manufacturers. With the powerful rule engine you are able to connect any \n"
|
"manufacturers. With the powerful rule engine you are able to connect any \n"
|
||||||
"device available in the system and create individual scenes and behaviors \n"
|
"device available in the system and create individual scenes and behaviors \n"
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class nymeaserver::NymeaApplication
|
\class nymeaserver::NymeaApplication
|
||||||
\brief Application class of the guh server.
|
\brief Application class of the nymea server.
|
||||||
|
|
||||||
\ingroup core
|
\ingroup core
|
||||||
\inmodule server
|
\inmodule server
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class nymeaserver::NymeaService
|
\class nymeaserver::NymeaService
|
||||||
\brief The daemon service reprenetation of the guh server.
|
\brief The daemon service reprenetation of the nymea server.
|
||||||
|
|
||||||
\ingroup core
|
\ingroup core
|
||||||
\inmodule server
|
\inmodule server
|
||||||
|
|||||||
Reference in New Issue
Block a user