deCONZ C++ API v2.6.1
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#ifndef DECONZ_TYPES_H_
2#define DECONZ_TYPES_H_
3
4/*
5 * Copyright (c) 2012-2023 dresden elektronik ingenieurtechnik gmbh.
6 * All rights reserved.
7 *
8 * The software in this package is published under the terms of the BSD
9 * style license a copy of which has been included with this distribution in
10 * the LICENSE.txt file.
11 *
12 */
13
24#include <stdint.h>
25#include <inttypes.h>
26
27#ifdef __cplusplus
28
29#define CL_URL_SCHEME "cluster"
30#define CL_ITEM_ENDPOINT "ep"
31#define CL_ITEM_EXT_ADDR "ieee"
32#define CL_ITEM_CLUSTER_ID "cid"
33#define CL_ITEM_NAME "name"
34#define CL_ITEM_CLUSTER_SIDE "side"
35#define CL_ITEM_PROFILE_ID "prf"
36#define CL_ITEM_DEVICE_ID "dev"
37#define EP_URL_SCHEME "endpoint"
38
39#define ZLL_PROFILE_ID 0xC05E
40#define GP_PROFILE_ID 0xa1e0
41#define HA_PROFILE_ID 0x0104
42#define SE_PROFILE_ID 0x0109
43
44#define HA_DEFAULT_TC_LINK_KEY 0x5a6967426565416c6c69616e63653039LL
45
46#define BROADCAST_SOCKET -1
47
48#define FW_ONLY_AVR_BOOTLOADER 1
49
50class zmgNode;
51
52namespace deCONZ
53{
54 class zmNode;
55
58 {
59 Success = 0,
64 };
65
70 {
71 BroadcastAll = 0xFFFF,
74 BroadcastRxOnWhenIdle = 0xFFFD
75 };
76
79 {
80 SecModeNoSecurity = 0x00,
81 SecModePreconfiguredNetworkKey = 0x01,
82 SecModeNetworkKeyFromTrustCenter = 0x02,
83 SecModeNoMasterButTrustCeneterLinkKey = 0x03,
84 SecModeMasterKey = 0x04
85 };
86
87 enum Indication
88 {
89 IndicateNone,
90 IndicateReceive,
91 IndicateSend,
92 IndicateSendDone,
93 IndicateDataUpdate,
94 IndicateError
95 };
96
101 {
102 ZdpSuccess = 0x00,
103 ZdpInvalidRequestType = 0x80,
104 ZdpDeviceNotFound = 0x81,
105 ZdpInvalidEndpoint = 0x82,
106 ZdpNotActive = 0x83,
107 ZdpNotSupported = 0x84,
108 ZdpTimeout = 0x85,
109 ZdpNoMatch = 0x86,
110 // reserved 0x87
111 ZdpNoEntry = 0x88,
112 ZdpNoDescriptor = 0x89,
113 ZdpInsufficientSpace = 0x8a,
114 ZdpNotPermitted = 0x8b,
115 ZdpTableFull = 0x8c,
116 ZdpNotAuthorized = 0x8d
117 };
118
123 {
124 ZclSuccessStatus = 0x00,
125 ZclFailureStatus = 0x01,
126 ZclNotAuthorizedStatus = 0x7e,
127 ZclReservedFieldNotZeroStatus = 0x7f,
128 ZclMalformedCommandStatus = 0x80,
129 ZclUnsupClusterCommandStatus = 0x81,
130 ZclUnsupGeneralCommandStatus = 0x82,
131 ZclUnsupManufClusterCommandStatus = 0x83,
132 ZclUnsupManufGeneralCommandStatus = 0x84,
133 ZclInvalidFieldStatus = 0x85,
134 ZclUnsupportedAttributeStatus = 0x86,
135 ZclInvalidValueStatus = 0x87,
136 ZclReadOnlyStatus = 0x88,
137 ZclInsufficientSpaceStatus = 0x89,
138 ZclInconstistentStartupStateStatus = 0x90,
139 ZclDefinedOutOfBandStatus = 0x91,
140 ZclHardwareFailureStatus = 0xc0,
141 ZclSoftwareFailureStatus = 0xc1,
142 ZclCalibrationErrorStatus = 0xc2,
143 ZclClusterNotSupportedErrorStatus = 0xc3
144 };
145
150 {
151 ApsSuccessStatus = 0x00,
152 ApsAsduTooLongStatus = 0xa0,
153 ApsDefragDeferredStatus = 0xa1,
154 ApsDefragUnsupportedStatus = 0xa2,
155 ApsIllegalRequestStatus = 0xa3,
156 ApsInvalidBindingStatus = 0xa4,
157 ApsInvalidGroupStatus = 0xa5,
158 ApsInvalidParameterStatus = 0xa6,
159 ApsNoAckStatus = 0xa7,
160 ApsNoBoundDeviceStatus = 0xa8,
161 ApsNoShortAddressStatus = 0xa9,
162 ApsNotSupportedStatus = 0xaa,
163 ApsSecuredLinkKeyStatus = 0xab,
164 ApsSecuredNwkKeyStatus = 0xac,
165 ApsSecurityFailStatus = 0xad,
166 ApsTableFullStatus = 0xae,
167 ApsUnsecuredStatus = 0xaf,
168 ApsUnsupportedAttributeStatus = 0xb0
169 };
170
175 {
176 NwkInvalidParameterStatus = 0xc1,
177 NwkInvalidRequestStatus = 0xc2,
178 NwkNotPermittedStatus = 0xc3,
179 NwkStartupFailureStatus = 0xc4,
180 NwkAlreadyPresentStatus = 0xc5,
181 NwkSyncFailureStatus = 0xc6,
182 NwkNeighborTableFullStatus = 0xc7,
183 NwkNoNetworkStatus = 0xca,
184 NwkRouteDiscoveryFailedStatus = 0xd0,
185 NwkRouteErrorStatus = 0xd1,
186 NwkBroadcastTableFullStatus = 0xd2
187 };
188
193 {
194 MacNoChannelAccess = 0xe1,
195 MacInvalidParameterStatus = 0xe8,
196 MacNoAckStatus = 0xe9,
197 MacNoBeaconStatus = 0xea,
198 MacTransactionExpiredStatus = 0xf0
199 };
200
206 {
207 ApsRequestKeySuccessStatus = 0x00,
208 ApsRequestKeyNoShortAddressStatus = 0x01,
209 ApsRequestKeySecurityFailStatus = 0x02,
210 ApsRequestKeyNotSendStatus = 0x03,
211 ApsRequestKeyTimeoutStatus = 0x04
212 };
213
216 {
217 NoAddress = 0x0,
218 NwkAddress = 0x1,
219 ExtAddress = 0x2,
220 GroupAddress = 0x4
221 };
222
225 {
226 Coordinator,
227 Router,
228 EndDevice,
229 UnknownDevice
230 };
231
232 enum NeighborPermitJoin
233 {
234 NeighborAcceptJoin,
235 NeighborNotAcceptJoin,
236 NeighborJoinUnknown
237 };
238
241 {
242 ParentRelation = 0x0,
243 ChildRelation,
244 SiblingRelation,
245 UnknownRelation,
246 PreviousChildRelation,
247 UnauthenticatedChildRelation
248 };
249
256 {
257 UnknownEvent,
325 };
326
329 {
330 uint8_t u8;
331 uint16_t u16;
332 uint32_t u32;
333 uint64_t u64;
334 int8_t s8;
335 int16_t s16;
336 int32_t s32;
337 int64_t s64;
338 float real;
339 };
340
341 struct BindReq
342 {
343 bool unbind;
344 ZdpState rspState;
345 uint64_t srcAddr;
346 uint8_t srcEndpoint;
347 uint16_t clusterId;
348 uint8_t dstAddrMode;
349 uint64_t dstExtAddr;
350 uint8_t dstEndpoint;
351 uint16_t dstGroupAddr;
352 uint64_t binderAddr;
353 };
354
355 enum RequestId
356 {
357 ReqUnknown = 0,
358 ReqNwkAddr,
359 ReqIeeeAddr,
360 ReqNodeDescriptor,
361 ReqPowerDescriptor,
362 ReqSimpleDescriptor,
363 ReqUserDescriptor,
364 ReqActiveEndpoints,
365 ReqMgmtLqi,
366 ReqMgmtBind,
367
368 ReqMaxItems
369 };
370
375 enum State
376 {
377 NotInNetwork = 0,
378 Connecting,
379 InNetwork,
380 Leaving,
381 UnknownState,
382 Touchlink
383 };
384
390 {
391 ConnectModeManual = 0x00,
392 ConnectModeNormal = 0x01,
393 ConnectModeZll = 0x02
394 };
395
399 enum CommonState : unsigned char
400 {
401 IdleState = 0,
402 BusyState,
403 WaitState,
404 ConfirmedState,
405 TimeoutState,
406 FailureState,
407 FinishState,
408 FireAndForgetState // deprecated
409 };
410
415 {
416 UnknownFrequencyBand = 0,
417 Freq868 = 0x08,
418 Freq902 = 0x20,
419 Freq2400 = 0x40
420 };
421
422 enum GraphicalTypes
423 {
424 GraphNodeType = 1,
425 GraphLinkType = 2,
426 GraphSocketType = 3
427 };
428} // namespace deCONZ
429
430#endif /* __cplusplus */
431
432#endif // DECONZ_TYPES_H_
NwkBroadcastAddress
Special network layer broadcast addresses.
Definition types.h:70
NwkStatus
Common Network Layer (NWK) status codes.
Definition types.h:175
MacStatus
Common Medium Access Control Layer (MAC) status codes.
Definition types.h:193
ApsStatus
Common Application Support Layer (APS) status codes.
Definition types.h:150
@ BroadcastRxOnWhenIdle
Broadcast to all nodes which have the RxOnWhenIdle flag set.
Definition types.h:74
@ BroadcastAll
Broadcast to all nodes including end devices.
Definition types.h:71
@ BroadcastLowPowerRouters
Broadcast only to low power routers.
Definition types.h:72
@ BroadcastRouters
Broadcast only to routers.
Definition types.h:73
ZclStatus
Common ZigBee Cluster Library (ZCL) status codes.
Definition types.h:123
ZdpState
Common ZigBee Device Profile (ZDP) status codes.
Definition types.h:101
FrequencyBand
ZigBee frequency band.
Definition types.h:415
@ Freq2400
2400 - 2483.5 MHz
Definition types.h:419
@ Freq902
902 - 928 MHz
Definition types.h:418
@ Freq868
868 - 868.6 MHz
Definition types.h:417
The deCONZ namespace.
Definition aps.cpp:19
ConnectMode
Defines how the device connects to the network.
Definition types.h:390
SecurityMode
Security modes.
Definition types.h:79
DeviceType
ZigBee device types.
Definition types.h:225
State
The state of a device or node.
Definition types.h:376
AddressMode
ZigBee device types.
Definition types.h:216
NetEvent
Type of a event send by the zmMaster.
Definition types.h:256
@ GotApsDataIndication
zmNetEvent::value() holds a zmApsDataIndication.
Definition types.h:299
@ GotComplexDescriptor
zmNetEvent::pod() holds a zmComplexDescriptor.
Definition types.h:277
@ GotNodeDescriptor
zmNetEvent::pod() holds a zmNodeDescriptor.
Definition types.h:271
@ NodeDataChanged
zmNetEvent::node() holds the node for which the data has changed.
Definition types.h:322
@ GotMgmtBind
zmNetEvent::value() holds a BindingTable if isValid().
Definition types.h:269
@ NotifyZdpError
zmNetEvent::value() holds a uint error code.
Definition types.h:309
@ GotNwkAddressList
TODO.
Definition types.h:293
@ GotLqiRssi
zmNetEvent::value() holds a QByteArray with (u8 lqi, u8 rssi).
Definition types.h:285
@ GotUnbindResponse
zmNetEvent::value() holds the deCONZ::ZdpState.
Definition types.h:267
@ GotMgmtLqiPart
zmNetEvent::pod() holds a zmNeighbor.
Definition types.h:281
@ GotLinkKey
zmNetEvent::value() holds a deCONZ::ApsRequestKeyStatus status code.
Definition types.h:295
@ NotifyZclError
zmNetEvent::value() holds a uint error code.
Definition types.h:311
@ GotUserDescriptor
zmNetEvent::value() holds a QString.
Definition types.h:279
@ GotBindResponse
zmNetEvent::value() holds the deCONZ::ZdpState.
Definition types.h:265
@ NodeDeleted
zmNetEvent::node() holds the node which is gone.
Definition types.h:324
@ NotifyText
zmNetEvent::value() holds a QString.
Definition types.h:320
@ GotGeneralFrame
zmNetEvent::value() holds the deCONZ::GeneralFrame.
Definition types.h:259
@ GotPowerDescriptor
zmNetEvent::pod() holds a zmPowerDescriptor.
Definition types.h:273
@ DeviceStateChanged
zmNetEvent::value() holds the deCONZ::State.
Definition types.h:261
@ NeighborUpdated
zmNetEvent::value() holds a zmNeighbor.
Definition types.h:305
@ GotActiveEndpoints
zmNetEvent::value() holds a QByteArray with endpoints.
Definition types.h:283
@ GotNetDescriptor
zmNetEvent::value() holds a zmNet.
Definition types.h:289
@ GotNetworkConfig
zmNetEvent::value() holds a zmNet
Definition types.h:263
@ GotZclReadAttributes
zmNetEvent::value() holds a QByteArray with the ZCL Read Attributes response.
Definition types.h:287
@ GotApsDataConfirm
zmNetEvent::value() holds a zmApsDataConfirm.
Definition types.h:297
@ NotifyError
zmNetEvent::value() holds a uint error code.
Definition types.h:307
@ GotSimpleDescriptor
zmNetEvent::pod() holds a zmSimpleDescriptor.
Definition types.h:275
@ NotifyStatus
zmNetEvent::value() holds a uint status code.
Definition types.h:318
@ NotifyNwkError
zmNetEvent::value() holds a uint error code.
Definition types.h:313
ApsRequestKeyStatus
Bitcloud's APSME-REQUEST-KEY.confirm status codes.
Definition types.h:206
DeviceRelationship
Neighbortable relationship between devices.
Definition types.h:241
CommonState
Common states for various purposes.
Definition types.h:400
LibraryReturnCodes
Return codes of the deCONZ library.
Definition types.h:58
@ ErrorNotConnected
Not connected (device or network)
Definition types.h:60
@ ErrorNotFound
Not found.
Definition types.h:63
@ ErrorNodeIsZombie
Node is not reachable.
Definition types.h:62
@ ErrorQueueIsFull
Queue is full.
Definition types.h:61
@ Success
Success.
Definition types.h:59
Definition types.h:342
uint16_t dstGroupAddr
only set then dstAddrMode = 0x1 (group)
Definition types.h:351
bool unbind
true if this is a unbind request
Definition types.h:343
Holds various numeric values 8-64 bit, signed and unsigned.
Definition types.h:329