forked from dresden-elektronik/deconz-rest-plugin
-
Notifications
You must be signed in to change notification settings - Fork 8
/
gateway.h
79 lines (66 loc) · 1.73 KB
/
gateway.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef GATEWAY_H
#define GATEWAY_H
#include <QObject>
#include <QHostAddress>
#include <QNetworkReply>
#include "de_web_plugin.h"
#include "de_web_plugin_private.h"
namespace deCONZ {
class ApsDataIndication;
class ZclFrame;
}
class GatewayPrivate;
class Gateway : public QObject
{
Q_OBJECT
public:
class Group
{
public:
QString id;
QString name;
};
class CascadeGroup
{
public:
quint16 local;
quint16 remote;
};
enum State
{
StateOffline,
StateNotAuthorized,
StateConnected
};
explicit Gateway(DeRestPluginPrivate *parent = 0);
~Gateway();
const QString &name() const;
void setName(const QString &name);
const QString &uuid() const;
void setUuid(const QString &uuid);
const QHostAddress &address() const;
void setAddress(const QHostAddress &address);
quint16 port() const;
void setPort(quint16 port);
void setApiKey(const QString &apiKey);
const QString &apiKey() const;
bool pairingEnabled() const;
void setPairingEnabled(bool pairingEnabled);
State state() const;
bool needSaveDatabase() const;
void setNeedSaveDatabase(bool save);
void addCascadeGroup(quint16 local, quint16 remote);
void removeCascadeGroup(quint16 local, quint16 remote);
void handleGroupCommand(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
const std::vector<Group> &groups() const;
const std::vector<CascadeGroup> &cascadeGroups() const;
signals:
private Q_SLOTS:
void timerFired();
void finished(QNetworkReply *reply);
void error(QNetworkReply::NetworkError);
private:
Q_DECLARE_PRIVATE(Gateway)
GatewayPrivate *d_ptr;
};
#endif // GATEWAY_H