forked from u236/homed-service-zigbee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
poll.h
75 lines (46 loc) · 1.41 KB
/
poll.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
#ifndef POLL_H
#define POLL_H
#include <QSharedPointer>
#include "zcl.h"
class PollObject;
typedef QSharedPointer <PollObject> Poll;
class PollObject
{
public:
PollObject(const QString &name, quint16 clusterId, QList <quint16> attributes) :
m_name(name), m_clusterId(clusterId), m_attributes(attributes) {}
PollObject(const QString &name, quint16 clusterId, quint16 attributeId) :
m_name(name), m_clusterId(clusterId), m_attributes({attributeId}) {}
inline QString name(void) { return m_name; }
inline quint16 clusterId(void) { return m_clusterId; }
inline QList <quint16> &attributes(void) { return m_attributes; }
static void registerMetaTypes(void);
protected:
QString m_name;
quint16 m_clusterId;
QList <quint16> m_attributes;
};
namespace Polls
{
class Energy : public PollObject
{
public:
Energy(void) : PollObject("energy", CLUSTER_SMART_ENERGY_METERING, 0x0000) {}
};
class Voltage : public PollObject
{
public:
Voltage(void) : PollObject("voltage", CLUSTER_ELECTRICAL_MEASUREMENT, 0x0505) {}
};
class Current : public PollObject
{
public:
Current(void) : PollObject("current", CLUSTER_ELECTRICAL_MEASUREMENT, 0x0508) {}
};
class Power : public PollObject
{
public:
Power(void) : PollObject("power", CLUSTER_ELECTRICAL_MEASUREMENT, 0x050B) {}
};
}
#endif