first test with the lib
This commit is contained in:
parent
ebcabda682
commit
85b11eb80f
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += widgets declarative qml quick network dbus
|
QT += network declarative
|
||||||
|
|
||||||
TARGET = libhive
|
TARGET = libhive
|
||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
|
|||||||
@ -1,8 +1,4 @@
|
|||||||
#include "server.h"
|
#include "server.h"
|
||||||
|
|
||||||
#include <QNetworkInterface>
|
|
||||||
#include <QTcpServer>
|
|
||||||
#include <QTcpSocket>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
Server::Server(QObject *parent) :
|
Server::Server(QObject *parent) :
|
||||||
|
|||||||
@ -2,7 +2,9 @@
|
|||||||
#define SERVER_H
|
#define SERVER_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QNetworkInterface>
|
||||||
#include <QTcpServer>
|
#include <QTcpServer>
|
||||||
|
#include <QTcpSocket>
|
||||||
|
|
||||||
class Server : public QObject
|
class Server : public QObject
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core
|
QT += core network
|
||||||
|
|
||||||
QT -= gui
|
QT -= gui
|
||||||
|
|
||||||
@ -17,12 +17,14 @@ TEMPLATE = app
|
|||||||
SOURCES += main.cpp \
|
SOURCES += main.cpp \
|
||||||
hivecore.cpp
|
hivecore.cpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
hivecore.h
|
||||||
|
|
||||||
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../libhive/release/ -llibhive
|
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../libhive/release/ -llibhive
|
||||||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../libhive/debug/ -llibhive
|
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../libhive/debug/ -llibhive
|
||||||
else:unix: LIBS += -L$$OUT_PWD/../../libhive/ -llibhive
|
else:unix: LIBS += -L$$OUT_PWD/../../libhive/ -llibhive
|
||||||
|
|
||||||
INCLUDEPATH += $$PWD/../../libhive
|
INCLUDEPATH += $$PWD/../../libhive
|
||||||
DEPENDPATH += $$PWD/../../libhive
|
DEPENDPATH += $$PWD/../../libhive
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
hivecore.h
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define HIVECORE_H
|
#define HIVECORE_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <libhive/server.h>
|
#include "server.h"
|
||||||
|
|
||||||
class HiveCore : public QObject
|
class HiveCore : public QObject
|
||||||
{
|
{
|
||||||
@ -11,7 +11,7 @@ public:
|
|||||||
explicit HiveCore(QObject *parent = 0);
|
explicit HiveCore(QObject *parent = 0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Server m_server;
|
Server *m_server;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
|||||||
@ -4,20 +4,29 @@
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core
|
QT += core network
|
||||||
|
|
||||||
QT -= gui
|
QT -= gui
|
||||||
|
|
||||||
TARGET = hive_pi
|
TARGET = hive_pi
|
||||||
target.path = /usr/bin
|
|
||||||
|
|
||||||
CONFIG += console
|
CONFIG += console
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|
||||||
|
target.path = /usr/bin
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|
||||||
|
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
|
|
||||||
SOURCES += main.cpp
|
SOURCES += main.cpp \
|
||||||
|
hivecore.cpp
|
||||||
|
|
||||||
|
unix:!macx: LIBS += -L$$OUT_PWD/../../libhive/ -llibhive
|
||||||
|
|
||||||
|
INCLUDEPATH += $$PWD/../../libhive
|
||||||
|
DEPENDPATH += $$PWD/../../libhive
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
hivecore.h
|
||||||
|
|||||||
7
hive/server/hive_pi/hivecore.cpp
Normal file
7
hive/server/hive_pi/hivecore.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include "hivecore.h"
|
||||||
|
|
||||||
|
HiveCore::HiveCore(QObject *parent) :
|
||||||
|
QObject(parent)
|
||||||
|
{
|
||||||
|
m_server = new Server(this);
|
||||||
|
}
|
||||||
22
hive/server/hive_pi/hivecore.h
Normal file
22
hive/server/hive_pi/hivecore.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef HIVECORE_H
|
||||||
|
#define HIVECORE_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include "server.h"
|
||||||
|
|
||||||
|
class HiveCore : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit HiveCore(QObject *parent = 0);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Server *m_server;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HIVECORE_H
|
||||||
Reference in New Issue
Block a user