17#include "deconz/declspec.h"
35 uint id()
const {
return m_id; }
36 const QString &name()
const {
return m_name; }
37 void setValue(uint key,
const QString &name) { m_values[key] = name; }
38 QString getValueName(uint key)
40 if (m_values.contains(key))
45 const QHash<uint, QString> &values()
const {
return m_values; }
48 QHash<uint, QString> m_values;
58 static constexpr int PoolSize = 64;
60 uint16_t m_id = 0xFFFF;
61 uint8_t m_dataType = 0xFF;
62 uint8_t m_subType = 0xFF;
64 QString m_description;
82 std::vector<int> m_valuePos;
83 QStringList m_valueNames;
84 int64_t m_lastRead = -1;
103 quint16 m_manufacturerCode = 0;
105 quint16 m_attrSetId = 0xFFFF;
106 quint16 m_attrSetManufacturerCode = 0;
115 quint16 manufacturerCode;
116 std::vector<int> attributeIndexes;
125 uint16_t manufacturerCode;
130 std::vector<ZclAttribute> attributes;
131 std::vector<ZclAttributeSet> attributeSets;
132 std::vector<ZclCommand> commands;
138 static constexpr int PoolSize = 16;
140 uint8_t frameControl = 0;
141 uint16_t manufacturerCode = 0xFFFF;
142 uint8_t seqNumber = 0;
143 uint8_t commandId = 0;
170 uint16_t m_manufacturerId;
171 uint8_t m_responseId;
175 QString m_description;
176 bool m_isProfileWide;
177 bool m_disableDefaultResponse;
178 std::vector<ZclAttribute> m_payload;
186 ZclDomain(
const QString &name,
const QString &description) :
189 m_description(description)
192 qDebug(
"Domain: %s %04X-%04X -- %s", qPrintable(name), qPrintable(description));
195 bool useZcl()
const {
return m_useZcl; }
196 void setUseZcl(
bool useZcl) { m_useZcl = useZcl; }
197 const QString &name()
const {
return m_name; }
198 void setName(
const QString &name) { m_name = name; }
199 const QString &description()
const {
return m_description; }
200 void setDescription(
const QString &description) { m_description = description; }
201 const QHash<uint32_t, ZclCluster> &inClusters()
const {
return m_inClusters; }
202 const QHash<uint32_t, ZclCluster> &outClusters()
const {
return m_outClusters; }
203 bool isValid()
const {
return !m_name.isEmpty(); }
209 QString m_description;
210 QHash<uint32_t, ZclCluster> m_inClusters;
211 QHash<uint32_t, ZclCluster> m_outClusters;
217 ZclDevice() : m_deviceId(0xFFFF), m_profileId(0xFFFF) {}
218 ZclDevice(uint16_t
id,
const QString &name,
const QString &description,
const QIcon &icon) :
222 m_description(description),
226 qDebug(
"ZclDevice: %04X %s -- %s",
id, qPrintable(name), qPrintable(description));
230 uint16_t id()
const {
return m_deviceId; }
231 void setId(uint16_t
id) { m_deviceId = id; }
232 uint16_t profileId()
const {
return m_profileId; }
233 void setProfileId(uint16_t
id) { m_profileId = id; }
234 const QString &name()
const {
return m_name; }
235 const QString &description()
const {
return m_description; }
236 const QIcon &icon()
const {
return m_icon; }
240 uint16_t m_profileId;
242 QString m_description;
251 ZclProfile(uint16_t
id,
const QString &name,
const QString &description,
const QIcon &icon) :
254 m_description(description),
258 qDebug(
"Profile: %04X %s -- %s",
id, qPrintable(name), qPrintable(description));
262 uint16_t id()
const {
return m_id; }
263 void setId(uint16_t
id) { m_id = id; }
264 const QString &name()
const {
return m_name; }
265 void setName(
const QString &name) { m_name = name; }
266 const QString &description()
const {
return m_description; }
267 void setDescription(
const QString &description) { m_description = description; }
268 const QIcon &icon()
const {
return m_icon; }
269 void setIcon(
const QIcon &icon) { m_icon = icon; }
270 const std::vector<ZclDomain> &domains()
const {
return m_domains; }
272 bool isValid()
const {
return (m_id != 0xFFFF); }
279 QString m_description;
281 std::vector<ZclDomain> m_domains;
290 ZclCluster inCluster(uint16_t profileId, uint16_t clusterId, quint16 mfcode);
291 ZclCluster outCluster(uint16_t profileId, uint16_t clusterId, quint16 mfcode);
293 const ZclDataType &dataType(
const QString &shortName)
const;
298 ZclDevice device(uint16_t profileId, uint16_t deviceId);
301 for (
const auto &e : m_enums)
312 void load(
const QString &dbfile);
313 void initDbFile(
const QString &zclFile);
314 void reloadAll(
const QString &zclFile);
316 bool knownDataType(uint8_t
id);
319 std::vector<deCONZ::Enumeration> m_enums;
322 std::vector<ZclDataType> m_dataTypes;
323 std::vector<ZclDomain> m_domains;
324 QHash<uint16_t, ZclProfile> m_profiles;
329 std::vector<ZclDevice> m_devices;
Definition zcl_private.h:23
Definition zcl_private.h:54
NumericUnion m_reportableChange
Reportable change.
Definition zcl_private.h:97
int m_listSize
Current size of the list.
Definition zcl_private.h:91
bool m_required
True if mandatory.
Definition zcl_private.h:68
uint16_t m_listSizeAttr
If this is a list here is the attribute id wich holds the list size.
Definition zcl_private.h:90
NumericUnion m_numericValue
Numeric data.
Definition zcl_private.h:81
QVariant m_value
May hold a value or the static content like enumeration or bitmap values.
Definition zcl_private.h:80
bool m_avail
Attribute is available in the cluster.
Definition zcl_private.h:69
int idx
index into a list
Definition zcl_private.h:71
uint8_t m_numericBase
For numeric data types.
Definition zcl_private.h:67
uint16_t m_maxReportInterval
Maximum reporting interval.
Definition zcl_private.h:95
uint16_t m_minReportInterval
Minimum reporting interval.
Definition zcl_private.h:94
uint64_t bitmap
bitmap bits set
Definition zcl_private.h:72
uint8_t m_enumerationId
Id of a enumeration repository.
Definition zcl_private.h:66
uint16_t m_reportTimeout
Report timeout period.
Definition zcl_private.h:96
Definition zcl_private.h:110
FormatHint
Used to change the display format in the GUI.
Definition zcl.h:685
@ DefaultFormat
Use the default format for a value.
Definition zcl.h:686
Definition zcl_private.h:120
Represents a ZigBee cluster (ZCL and non-ZCL).
Definition zcl.h:1173
Definition zcl_private.h:166
Definition zcl_private.h:286
Definition zcl_private.h:148
DataKind
Data kind of the data type.
Definition zcl_private.h:152
Represents the data type of a ZigBee cluster attribute.
Definition zcl.h:310
Definition zcl_private.h:215
Definition zcl_private.h:183
Definition zcl_private.h:136
Definition zcl_private.h:248
The deCONZ namespace.
Definition aps.cpp:19
ZclAccess
Allowed access method of a ZclAttribute.
Definition zcl.h:418
Holds various numeric values 8-64 bit, signed and unsigned.
Definition types.h:329