deCONZ C++ API v2.6.1
Loading...
Searching...
No Matches
aps_controller.h
1#ifndef DECONZ_APS_CONTROLLER_H
2#define DECONZ_APS_CONTROLLER_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
14#include <QObject>
15#include <deconz/types.h>
16#include <deconz/aps.h>
17#include <deconz/binding_table.h>
18
19#define FW_ONLY_AVR_BOOTLOADER 1
20#define FW_ONLY_R21_BOOTLOADER 2
21
22namespace deCONZ
23{
24
28{
29 FirmwareUpdateIdle,
30 FirmwareUpdateReadyToStart,
31 FirmwareUpdateRunning
32};
33
37{
51};
52
56{
60};
61
65{
69};
70
74{
79};
80
84{
88};
89
93{
97};
98
102{
103 ParamHAEndpoint,
104 ParamLinkKey
105};
106
107class Node;
108class NodeEvent;
109class SourceRoute;
110
116class DECONZ_DLLSPEC ApsController: public QObject
117{
118 Q_OBJECT
119
120public:
122 ApsController(QObject *parent);
124 virtual ~ApsController();
128 virtual State networkState() = 0;
135 virtual int setNetworkState(State state) = 0;
142 virtual int setPermitJoin(uint8_t duration) = 0;
144 virtual int apsQueueSize() = 0;
163 virtual int apsdeDataRequest(const ApsDataRequest &req) = 0;
169 virtual int resolveAddress(Address &addr) = 0;
190 virtual int getNode(int index, const Node **node) = 0;
192 //virtual const Node &getNode(int index) = 0;
196 virtual bool updateNode(const Node &node) = 0;
201 virtual uint8_t getParameter(U8Parameter parameter) = 0;
207 virtual bool setParameter(U8Parameter parameter, uint8_t value) = 0;
213 virtual bool setParameter(U16Parameter parameter, uint16_t value) = 0;
219 virtual bool setParameter(U32Parameter parameter, uint32_t value) = 0;
225 virtual bool setParameter(U64Parameter parameter, uint64_t value) = 0;
231 virtual bool setParameter(ArrayParameter parameter, QByteArray value) = 0;
237 virtual bool setParameter(VariantMapParameter parameter, QVariantMap value) = 0;
243 virtual bool setParameter(StringParameter parameter, const QString &value) = 0;
248 virtual uint16_t getParameter(U16Parameter parameter) = 0;
253 virtual uint32_t getParameter(U32Parameter parameter) = 0;
258 virtual uint64_t getParameter(U64Parameter parameter) = 0;
263 virtual QString getParameter(StringParameter parameter) = 0;
268 virtual QByteArray getParameter(ArrayParameter parameter) = 0;
274 virtual QVariantMap getParameter(VariantMapParameter parameter, int index) = 0;
275
280 virtual void activateSourceRoute(const SourceRoute &sourceRoute) = 0;
281
286 virtual void addBinding(const deCONZ::Binding &binding) = 0;
287
292 virtual void removeBinding(const deCONZ::Binding &binding) = 0;
293
298 virtual uint8_t nextRequestId() = 0;
299
300Q_SIGNALS:
306 void apsdeDataConfirm(const deCONZ::ApsDataConfirm &);
307
316 void apsdeDataIndication(const deCONZ::ApsDataIndication &);
317
322 void apsdeDataRequestEnqueued(const deCONZ::ApsDataRequest &);
323
325 void nodeEvent(const deCONZ::NodeEvent&);
326
330 void configurationChanged();
331
335 void networkStateChangeRequest(bool);
336
340 void sourceRouteCreated(const deCONZ::SourceRoute&);
341
345 void sourceRouteChanged(const deCONZ::SourceRoute&);
346
350 void sourceRouteDeleted(const QString &uuid);
351
355 void nodesRestored();
356};
357
358} // namespace deCONZ
359
360#endif // DECONZ_APS_CONTROLLER_H
Convenience class to work with network, extended and group addresses.
Definition aps.h:111
Provides APSDE-DATA service and access to node cache.
Definition aps_controller.h:117
static ApsController * instance()
Get the singleton instance of the ApsController.
virtual uint64_t getParameter(U64Parameter parameter)=0
Returns a 64-bit parameter.
virtual bool setParameter(VariantMapParameter parameter, QVariantMap value)=0
Sets a VariantMap parameter.
virtual uint32_t getParameter(U32Parameter parameter)=0
Returns a 32-bit parameter.
virtual uint8_t getParameter(U8Parameter parameter)=0
Returns a 8-bit parameter.
virtual void removeBinding(const deCONZ::Binding &binding)=0
Removes a binding to a nodes binding table.
virtual int setNetworkState(State state)=0
Sets the current network state.
virtual int apsQueueSize()=0
Returns number of enqueued APS requests.
virtual ~ApsController()
Deconstructor.
virtual QByteArray getParameter(ArrayParameter parameter)=0
Returns a byte array parameter.
virtual int getNode(int index, const Node **node)=0
Iterates through the internal node cache.
virtual State networkState()=0
Returns the current network state.
virtual bool setParameter(U32Parameter parameter, uint32_t value)=0
Sets a 32-bit parameter.
virtual uint8_t nextRequestId()=0
Alloctes a new APS request id.
virtual QVariantMap getParameter(VariantMapParameter parameter, int index)=0
Returns a variant map parameter.
ApsController(QObject *parent)
Constructor.
virtual bool setParameter(U64Parameter parameter, uint64_t value)=0
Sets a 64-bit parameter.
virtual void addBinding(const deCONZ::Binding &binding)=0
Adds a binding, if not already exists, to a nodes binding table.
virtual bool setParameter(U16Parameter parameter, uint16_t value)=0
Sets a 16-bit parameter.
virtual bool setParameter(StringParameter parameter, const QString &value)=0
Sets a string parameter.
virtual int apsdeDataRequest(const ApsDataRequest &req)=0
Send a APSDE-DATA.request to the network.
virtual QString getParameter(StringParameter parameter)=0
Returns a string parameter.
virtual void activateSourceRoute(const SourceRoute &sourceRoute)=0
Activate a source route, also called when restored from database.
virtual int setPermitJoin(uint8_t duration)=0
Sets the permit join duration.
virtual bool setParameter(U8Parameter parameter, uint8_t value)=0
Sets a 8-bit parameter.
virtual uint16_t getParameter(U16Parameter parameter)=0
Returns a 16-bit parameter.
virtual bool setParameter(ArrayParameter parameter, QByteArray value)=0
Sets a byte array parameter.
virtual int resolveAddress(Address &addr)=0
Fills in missing network or extended IEEE address information.
virtual bool updateNode(const Node &node)=0
TODO: return object instead of pointer ...
APSDE-DATA.confirm primitive.
Definition aps.h:352
APSDE-DATA.indication primitive.
Definition aps.h:408
APSDE-DATA.request primitive.
Definition aps.h:227
Definition binding_table.h:24
Represents a ZigBee node with all its descriptors and clusters.
Definition node.h:119
Definition node.h:42
The deCONZ namespace.
Definition aps.cpp:19
U16Parameter
Parameters of type uint16_t.
Definition aps_controller.h:56
@ ParamNwkAddress
the network address of the device
Definition aps_controller.h:58
@ ParamHttpPort
the http server port
Definition aps_controller.h:59
@ ParamPANID
the short PANID
Definition aps_controller.h:57
U8Parameter
Parameters of type uint8_t.
Definition aps_controller.h:37
@ ParamCurrentChannel
the current operation channel
Definition aps_controller.h:38
@ ParamPermitJoin
permit join duration
Definition aps_controller.h:41
@ ParamAutoPollingActive
Automatic polling of ZDP / REST Plugin: 1 = activated, 0 = deactivated.
Definition aps_controller.h:43
@ ParamFirmwareUpdateActive
values from FirmwareUpdateState enum
Definition aps_controller.h:45
@ ParamOtauActive
otau server: 1 = activated, 0 = deactivated
Definition aps_controller.h:42
@ ParamDeviceConnected
device connected state: 1 = connected, 0 = disconnected
Definition aps_controller.h:46
@ ParamApsAck
aps ack enabled/disabled
Definition aps_controller.h:47
@ ParamNetworkUpdateId
network update id
Definition aps_controller.h:44
@ ParamStaticNwkAddress
static NwkAddress enabled/disabled
Definition aps_controller.h:50
@ ParamSecurityMode
one of the deCONZ::SecurityMode values
Definition aps_controller.h:40
@ ParamPredefinedPanId
Predefined PanId enabled/disabled.
Definition aps_controller.h:48
@ ParamDeviceType
deCONZ::Coordinator or deCONZ::Router
Definition aps_controller.h:39
@ ParamCustomMacAddress
custom Mac Address enabled/disabled
Definition aps_controller.h:49
ArrayParameter
Parameters of type QByteArray.
Definition aps_controller.h:93
@ ParamSecurityMaterial0
the 256-bit security material set 0
Definition aps_controller.h:96
@ ParamNetworkKey
the 128-bit network key
Definition aps_controller.h:94
@ ParamTrustCenterLinkKey
the 128-bit trust center link key
Definition aps_controller.h:95
U64Parameter
Parameters of type uint64_t.
Definition aps_controller.h:74
@ ParamExtendedPANID
the current extended PANID
Definition aps_controller.h:76
@ ParamApsUseExtendedPANID
the extended PANID to use during join
Definition aps_controller.h:75
@ ParamMacAddress
the MAC address of the device
Definition aps_controller.h:77
@ ParamTrustCenterAddress
the MAC address of the trust center
Definition aps_controller.h:78
State
The state of a device or node.
Definition types.h:376
U32Parameter
Parameters of type uint32_t.
Definition aps_controller.h:65
@ ParamChannelMask
the 32-bit bitmap with enabled channels set as bit
Definition aps_controller.h:66
@ ParamFirmwareVersion
the firmware version of the connected device, special value 1 means bootloader but no firmware
Definition aps_controller.h:67
@ ParamFrameCounter
the current outgoing frame counter
Definition aps_controller.h:68
StringParameter
Parameters of type QString.
Definition aps_controller.h:84
@ ParamDeviceName
name of the connetced device (RaspBee, ConBee, ...)
Definition aps_controller.h:85
@ ParamHttpRoot
the http server root directory
Definition aps_controller.h:87
@ ParamDevicePath
/dev/ttyUSB0, /dev/ttyAMA0, COM49, ...
Definition aps_controller.h:86
VariantMapParameter
Parameters of type QVariantMap.
Definition aps_controller.h:102
FirmwareUpdateState
Values for ParamFirmwareUpdateActive.
Definition aps_controller.h:28
Declaration of the most common deCONZ library types.