d202df9a165f003a3a733a636c7aea4afa12923d
[apps/thermostat-demo.git] / remoteaccessmanager.h
1 #ifndef REMOTEACCESSMANAGER_H
2 #define REMOTEACCESSMANAGER_H
4 #include <QHash>
5 #include <QObject>
6 #include <QVariant>
8 class GlobalSettings;
9 class QTcpServer;
10 class QTcpSocket;
12 class RemoteAccessManager : public QObject
13 {
14     Q_OBJECT
15 public:
16     explicit RemoteAccessManager(QObject *parent = 0);
17     ~RemoteAccessManager();
18     
19     void start();
20     void stop();
22 signals:
23     void remoteChangeReceived(QHash<QString, QVariant> getVariables);
24     
25 public slots:
26     void handleIncomingConnection();
27     void processIncomingConnection();
29 private:
30     QTcpServer* m_tcpServer;
31     qint16 m_listenPort;
33     GlobalSettings* m_globalSettings;
34     QTcpSocket* m_clientConnection;
36     QByteArray hashToJSONByteArray(QHash<QString, QVariant> hash);
38     QHash<QString, QVariant> m_oldData;
39 };
41 #endif // REMOTEACCESSMANAGER_H