integrate coap better into libguh

This commit is contained in:
Simon Stürz 2016-04-13 12:40:39 +02:00 committed by Michael Zanetti
parent 444a113c33
commit 05a7b69240
10 changed files with 69 additions and 61 deletions

View File

@ -29,6 +29,7 @@
#include <QPointer>
#include <QQueue>
#include "libguh.h"
#include "coaprequest.h"
#include "coapreply.h"
#include "coapobserveresource.h"
@ -44,9 +45,10 @@
Q_DECLARE_LOGGING_CATEGORY(dcCoap)
class Coap : public QObject
class LIBGUH_EXPORT Coap : public QObject
{
Q_OBJECT
public:
Coap(QObject *parent = 0, const quint16 &port = 5683);
@ -67,7 +69,6 @@ private:
QPointer<CoapReply> m_reply;
QQueue<CoapReply *> m_replyQueue;
QHash<int, CoapReply *> m_runningHostLookups;
QHash<QByteArray, CoapObserveResource> m_observeResources; // token | resource
@ -93,7 +94,6 @@ private:
void processBlock2Notification(CoapReply *reply, const CoapPdu &pdu);
signals:
void replyFinished(CoapReply *reply);
void notificationReceived(const CoapObserveResource &resource, const int &notificationNumber, const QByteArray &payload);
@ -103,6 +103,7 @@ private slots:
void onReadyRead();
void onReplyTimeout();
void onReplyFinished();
};
#endif // COAP_H

View File

@ -25,7 +25,7 @@
#include <QHash>
#include <QUrl>
class CoapObserveResource
class LIBGUH_EXPORT CoapObserveResource
{
public:

View File

@ -25,7 +25,9 @@
#include <QObject>
#include <QByteArray>
class CoapOption
#include "libguh.h"
class LIBGUH_EXPORT CoapOption
{
Q_GADGET
Q_ENUMS(Option)

View File

@ -24,6 +24,7 @@
#include <QDebug>
#include <QObject>
#include "libguh.h"
#include "coapoption.h"
#include "coappdublock.h"
@ -42,7 +43,7 @@
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
class CoapPdu : public QObject
class LIBGUH_EXPORT CoapPdu : public QObject
{
Q_OBJECT
Q_ENUMS(MessageType)
@ -149,7 +150,6 @@ public:
void clear();
bool isValid() const;
bool isNull() const;
QByteArray pack() const;

View File

@ -23,7 +23,9 @@
#include <QByteArray>
class CoapPduBlock
#include "libguh.h"
class LIBGUH_EXPORT CoapPduBlock
{
public:
CoapPduBlock();

View File

@ -24,11 +24,12 @@
#include <QObject>
#include <QTimer>
#include "libguh.h"
#include "coappdu.h"
#include "coapoption.h"
#include "coaprequest.h"
class CoapReply : public QObject
class LIBGUH_EXPORT CoapReply : public QObject
{
friend class Coap;

View File

@ -24,12 +24,11 @@
#include <QUrl>
#include <QHostAddress>
#include "libguh.h"
#include "coappdu.h"
#include "coapoption.h"
//class Coap;
class CoapRequest
class LIBGUH_EXPORT CoapRequest
{
// friend class Coap;
public:

View File

@ -24,9 +24,10 @@
#include <QObject>
#include <QDebug>
#include "libguh.h"
#include "coappdu.h"
class CoreLink
class LIBGUH_EXPORT CoreLink
{
public:
CoreLink();

View File

@ -23,11 +23,12 @@
#include <QObject>
#include "libguh.h"
#include "corelink.h"
// Constrained RESTful Environments (CoRE) Link Format : http://tools.ietf.org/html/rfc6690
class CoreLinkParser : public QObject
class LIBGUH_EXPORT CoreLinkParser : public QObject
{
Q_OBJECT
public:

View File

@ -12,58 +12,14 @@ target.path = /usr/lib
INSTALLS += target
contains(DEFINES, BLUETOOTH_LE) {
HEADERS += bluetooth/bluetoothscanner.h \
bluetooth/bluetoothlowenergydevice.h \
SOURCES += bluetooth/bluetoothscanner.cpp \
bluetooth/bluetoothlowenergydevice.cpp \
HEADERS += bluetooth/bluetoothscanner.h \
bluetooth/bluetoothlowenergydevice.h \
}
SOURCES += devicemanager.cpp \
loggingcategories.cpp \
guhsettings.cpp \
plugin/device.cpp \
plugin/deviceclass.cpp \
plugin/deviceplugin.cpp \
plugin/devicedescriptor.cpp \
plugin/devicepairinginfo.cpp \
hardware/gpio.cpp \
hardware/gpiomonitor.cpp \
hardware/radio433/radio433.cpp \
hardware/radio433/radio433transmitter.cpp \
hardware/radio433/radio433receiver.cpp \
hardware/radio433/radio433brennenstuhlgateway.cpp \
network/upnpdiscovery/upnpdiscovery.cpp \
network/upnpdiscovery/upnpdevice.cpp \
network/upnpdiscovery/upnpdevicedescriptor.cpp \
network/upnpdiscovery/upnpdiscoveryrequest.cpp \
network/networkmanager.cpp \
network/oauth2.cpp \
coap/coap.cpp \
coap/coappdu.cpp \
coap/coapoption.cpp \
coap/coaprequest.cpp \
coap/coapreply.cpp \
coap/coappdublock.cpp \
coap/corelinkparser.cpp \
coap/corelink.cpp \
coap/coapobserveresource.cpp \
types/action.cpp \
types/actiontype.cpp \
types/state.cpp \
types/statetype.cpp \
types/eventtype.cpp \
types/event.cpp \
types/eventdescriptor.cpp \
types/vendor.cpp \
types/paramtype.cpp \
types/param.cpp \
types/paramdescriptor.cpp \
types/ruleaction.cpp \
types/ruleactionparam.cpp \
types/statedescriptor.cpp \
HEADERS += devicemanager.h \
libguh.h \
typeutils.h \
@ -111,6 +67,51 @@ HEADERS += devicemanager.h \
types/statedescriptor.h \
SOURCES += devicemanager.cpp \
loggingcategories.cpp \
guhsettings.cpp \
plugin/device.cpp \
plugin/deviceclass.cpp \
plugin/deviceplugin.cpp \
plugin/devicedescriptor.cpp \
plugin/devicepairinginfo.cpp \
hardware/gpio.cpp \
hardware/gpiomonitor.cpp \
hardware/radio433/radio433.cpp \
hardware/radio433/radio433transmitter.cpp \
hardware/radio433/radio433receiver.cpp \
hardware/radio433/radio433brennenstuhlgateway.cpp \
network/upnpdiscovery/upnpdiscovery.cpp \
network/upnpdiscovery/upnpdevice.cpp \
network/upnpdiscovery/upnpdevicedescriptor.cpp \
network/upnpdiscovery/upnpdiscoveryrequest.cpp \
network/networkmanager.cpp \
network/oauth2.cpp \
coap/coap.cpp \
coap/coappdu.cpp \
coap/coapoption.cpp \
coap/coaprequest.cpp \
coap/coapreply.cpp \
coap/coappdublock.cpp \
coap/corelinkparser.cpp \
coap/corelink.cpp \
coap/coapobserveresource.cpp \
types/action.cpp \
types/actiontype.cpp \
types/state.cpp \
types/statetype.cpp \
types/eventtype.cpp \
types/event.cpp \
types/eventdescriptor.cpp \
types/vendor.cpp \
types/paramtype.cpp \
types/param.cpp \
types/paramdescriptor.cpp \
types/ruleaction.cpp \
types/ruleactionparam.cpp \
types/statedescriptor.cpp \
# install plugininfo python script for libguh-dev
generateplugininfo.files = $$top_srcdir/plugins/guh-generateplugininfo
generateplugininfo.path = /usr/bin