deCONZ C++ API v2.6.1
Loading...
Searching...
No Matches
deCONZ::ApsController Class Referenceabstract

Provides APSDE-DATA service and access to node cache. More...

#include <aps_controller.h>

Inherits QObject.

Signals

void apsdeDataConfirm (const deCONZ::ApsDataConfirm &)
 Is emitted on the reception of a APSDE-DATA.confirm primitive.
 
void apsdeDataIndication (const deCONZ::ApsDataIndication &)
 Is emitted on the reception of a APSDE-DATA.indication primitive.
 
void apsdeDataRequestEnqueued (const deCONZ::ApsDataRequest &)
 Is emitted when a APSDE-DATA.request primitive was added to the queue.
 
void nodeEvent (const deCONZ::NodeEvent &)
 Is emitted on changes in the nodecache or user interactions.
 
void configurationChanged ()
 Is emitted when the configuration changed via deCONZ network settings or any other means.
 
void networkStateChangeRequest (bool)
 Is emitted when the user requested network state change.
 
void sourceRouteCreated (const deCONZ::SourceRoute &)
 Is emitted when a new source route is created.
 
void sourceRouteChanged (const deCONZ::SourceRoute &)
 Is emitted when a source route was changed.
 
void sourceRouteDeleted (const QString &uuid)
 Is emitted when a source route is deleted.
 
void nodesRestored ()
 Is emitted when the controller has restored all nodes from database.
 

Public Member Functions

 ApsController (QObject *parent)
 Constructor.
 
virtual ~ApsController ()
 Deconstructor.
 
virtual State networkState ()=0
 Returns the current network state.
 
virtual int setNetworkState (State state)=0
 Sets the current network state.
 
virtual int setPermitJoin (uint8_t duration)=0
 Sets the permit join duration.
 
virtual int apsQueueSize ()=0
 Returns number of enqueued APS requests.
 
virtual int apsdeDataRequest (const ApsDataRequest &req)=0
 Send a APSDE-DATA.request to the network.
 
virtual int resolveAddress (Address &addr)=0
 Fills in missing network or extended IEEE address information.
 
virtual int getNode (int index, const Node **node)=0
 Iterates through the internal node cache.
 
virtual bool updateNode (const Node &node)=0
 TODO: return object instead of pointer ...
 
virtual uint8_t getParameter (U8Parameter parameter)=0
 Returns a 8-bit parameter.
 
virtual bool setParameter (U8Parameter parameter, uint8_t value)=0
 Sets a 8-bit parameter.
 
virtual bool setParameter (U16Parameter parameter, uint16_t value)=0
 Sets a 16-bit parameter.
 
virtual bool setParameter (U32Parameter parameter, uint32_t value)=0
 Sets a 32-bit parameter.
 
virtual bool setParameter (U64Parameter parameter, uint64_t value)=0
 Sets a 64-bit parameter.
 
virtual bool setParameter (ArrayParameter parameter, QByteArray value)=0
 Sets a byte array parameter.
 
virtual bool setParameter (VariantMapParameter parameter, QVariantMap value)=0
 Sets a VariantMap parameter.
 
virtual bool setParameter (StringParameter parameter, const QString &value)=0
 Sets a string parameter.
 
virtual uint16_t getParameter (U16Parameter parameter)=0
 Returns a 16-bit parameter.
 
virtual uint32_t getParameter (U32Parameter parameter)=0
 Returns a 32-bit parameter.
 
virtual uint64_t getParameter (U64Parameter parameter)=0
 Returns a 64-bit parameter.
 
virtual QString getParameter (StringParameter parameter)=0
 Returns a string parameter.
 
virtual QByteArray getParameter (ArrayParameter parameter)=0
 Returns a byte array parameter.
 
virtual QVariantMap getParameter (VariantMapParameter parameter, int index)=0
 Returns a variant map parameter.
 
virtual void activateSourceRoute (const SourceRoute &sourceRoute)=0
 Activate a source route, also called when restored from database.
 
virtual void addBinding (const deCONZ::Binding &binding)=0
 Adds a binding, if not already exists, to a nodes binding table.
 
virtual void removeBinding (const deCONZ::Binding &binding)=0
 Removes a binding to a nodes binding table.
 
virtual uint8_t nextRequestId ()=0
 Alloctes a new APS request id.
 

Static Public Member Functions

static ApsControllerinstance ()
 Get the singleton instance of the ApsController.
 

Detailed Description

Provides APSDE-DATA service and access to node cache.

Member Function Documentation

◆ activateSourceRoute()

virtual void deCONZ::ApsController::activateSourceRoute ( const SourceRoute sourceRoute)
pure virtual

Activate a source route, also called when restored from database.

Parameters
sourceRoute- the source route
Since
2.05.81

◆ addBinding()

virtual void deCONZ::ApsController::addBinding ( const deCONZ::Binding binding)
pure virtual

Adds a binding, if not already exists, to a nodes binding table.

Parameters
binding- the binding, the node is determinded by Binding::srcAddress()
Since
2.05.86

◆ apsdeDataConfirm

void deCONZ::ApsController::apsdeDataConfirm ( const deCONZ::ApsDataConfirm _t1)
signal

Is emitted on the reception of a APSDE-DATA.confirm primitive.

Note
The id of the confirmation equals the id from the former request.
See also
apsdeDataRequest()

◆ apsdeDataIndication

void deCONZ::ApsController::apsdeDataIndication ( const deCONZ::ApsDataIndication _t1)
signal

Is emitted on the reception of a APSDE-DATA.indication primitive.

A indication might be received at any time and is not necessarily releated to a former request.

No filtering is done by the application any indication which is received will be forwarded.

◆ apsdeDataRequest()

virtual int deCONZ::ApsController::apsdeDataRequest ( const ApsDataRequest req)
pure virtual

Send a APSDE-DATA.request to the network.

Multible requests could be send in parallel. It is guaranteed that for each request a apsdeDataConfirm() signal is emitted after the request is processed.

The confirmation might take from 5 milliseconds up to serval seconds depending on if a new route must be found or the destination is not available.

To match the request to the confirmation compare their ids, ApsDataRequest::id() == ApsDataConfirm::id().

Return values
Successthe request is enqueued and will be processed
ErrorNotConnectedif not connected to a network
ErrorQueueIsFullrequest queue is full
ErrorNodeIsZombiedestionation node is zombie node, only ZDP requests are allowed

◆ apsdeDataRequestEnqueued

void deCONZ::ApsController::apsdeDataRequestEnqueued ( const deCONZ::ApsDataRequest _t1)
signal

Is emitted when a APSDE-DATA.request primitive was added to the queue.

Since
2.05.79

◆ configurationChanged

void deCONZ::ApsController::configurationChanged ( )
signal

Is emitted when the configuration changed via deCONZ network settings or any other means.

Since
2.05.44

◆ getNode()

virtual int deCONZ::ApsController::getNode ( int  index,
const Node **  node 
)
pure virtual

Iterates through the internal node cache.

int i = 0;
const deCONZ::Node *node;
while (ctrl->getNode(i, &node) == 0)
{
// do something with *node
i++;
}
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 int getNode(int index, const Node **node)=0
Iterates through the internal node cache.
Represents a ZigBee node with all its descriptors and clusters.
Definition node.h:119

The node with the index 0 is always the own node.

Parameters
indexa index >= 0
nodea pointer to a user provides deCONZ::Node pointer
Return values
0if node points to a valid deCONZ::Node
-1if no node is available for index

◆ getParameter() [1/7]

virtual QByteArray deCONZ::ApsController::getParameter ( ArrayParameter  parameter)
pure virtual

Returns a byte array parameter.

Parameters
parameter- the parameter identifier
Returns
the parameter value

◆ getParameter() [2/7]

virtual QString deCONZ::ApsController::getParameter ( StringParameter  parameter)
pure virtual

Returns a string parameter.

Parameters
parameter- the parameter identifier
Returns
the parameter value

◆ getParameter() [3/7]

virtual uint16_t deCONZ::ApsController::getParameter ( U16Parameter  parameter)
pure virtual

Returns a 16-bit parameter.

Parameters
parameter- the parameter identifier
Returns
the parameter value

◆ getParameter() [4/7]

virtual uint32_t deCONZ::ApsController::getParameter ( U32Parameter  parameter)
pure virtual

Returns a 32-bit parameter.

Parameters
parameter- the parameter identifier
Returns
the parameter value

◆ getParameter() [5/7]

virtual uint64_t deCONZ::ApsController::getParameter ( U64Parameter  parameter)
pure virtual

Returns a 64-bit parameter.

Parameters
parameter- the parameter identifier
Returns
the parameter value

◆ getParameter() [6/7]

virtual uint8_t deCONZ::ApsController::getParameter ( U8Parameter  parameter)
pure virtual

Returns a 8-bit parameter.

Parameters
parameter- the parameter identifier
Returns
the parameter value

◆ getParameter() [7/7]

virtual QVariantMap deCONZ::ApsController::getParameter ( VariantMapParameter  parameter,
int  index 
)
pure virtual

Returns a variant map parameter.

Parameters
parameter- the parameter identifier
index(optional)
Returns
the parameter value

◆ networkStateChangeRequest

void deCONZ::ApsController::networkStateChangeRequest ( bool  _t1)
signal

Is emitted when the user requested network state change.

true = connect; false = disconnect.

Since
2.05.70

◆ nextRequestId()

virtual uint8_t deCONZ::ApsController::nextRequestId ( )
pure virtual

Alloctes a new APS request id.

Since
2.19.0
Returns
new non zero request id 1-255

◆ nodesRestored

void deCONZ::ApsController::nodesRestored ( )
signal

Is emitted when the controller has restored all nodes from database.

Since
2.05.81

◆ removeBinding()

virtual void deCONZ::ApsController::removeBinding ( const deCONZ::Binding binding)
pure virtual

Removes a binding to a nodes binding table.

Parameters
binding- the binding, the node is determinded by Binding::srcAddress()
Since
2.05.86

◆ resolveAddress()

virtual int deCONZ::ApsController::resolveAddress ( Address addr)
pure virtual

Fills in missing network or extended IEEE address information.

Parameters
addrat least nwk() or ext() must be set
Return values
Successon success
ErrorNotFoundif the missing address part was not available

◆ setNetworkState()

virtual int deCONZ::ApsController::setNetworkState ( State  state)
pure virtual

Sets the current network state.

Parameters
stateeither NotInNetwork or InNetwork
Return values
Successthe request is enqueued and will be processed
ErrorNotConnectedif not connected to device

◆ setParameter() [1/7]

virtual bool deCONZ::ApsController::setParameter ( ArrayParameter  parameter,
QByteArray  value 
)
pure virtual

Sets a byte array parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setParameter() [2/7]

virtual bool deCONZ::ApsController::setParameter ( StringParameter  parameter,
const QString &  value 
)
pure virtual

Sets a string parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setParameter() [3/7]

virtual bool deCONZ::ApsController::setParameter ( U16Parameter  parameter,
uint16_t  value 
)
pure virtual

Sets a 16-bit parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setParameter() [4/7]

virtual bool deCONZ::ApsController::setParameter ( U32Parameter  parameter,
uint32_t  value 
)
pure virtual

Sets a 32-bit parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setParameter() [5/7]

virtual bool deCONZ::ApsController::setParameter ( U64Parameter  parameter,
uint64_t  value 
)
pure virtual

Sets a 64-bit parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setParameter() [6/7]

virtual bool deCONZ::ApsController::setParameter ( U8Parameter  parameter,
uint8_t  value 
)
pure virtual

Sets a 8-bit parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setParameter() [7/7]

virtual bool deCONZ::ApsController::setParameter ( VariantMapParameter  parameter,
QVariantMap  value 
)
pure virtual

Sets a VariantMap parameter.

Parameters
parameter- the parameter identifier
value- the parameter value
Returns
true on success

◆ setPermitJoin()

virtual int deCONZ::ApsController::setPermitJoin ( uint8_t  duration)
pure virtual

Sets the permit join duration.

Parameters
duration0..255 (in seconds)
Return values
Successthe request is enqueued and will be processed
ErrorNotConnectedif not connected to a network

◆ sourceRouteChanged

void deCONZ::ApsController::sourceRouteChanged ( const deCONZ::SourceRoute _t1)
signal

Is emitted when a source route was changed.

Since
2.05.81

◆ sourceRouteCreated

void deCONZ::ApsController::sourceRouteCreated ( const deCONZ::SourceRoute _t1)
signal

Is emitted when a new source route is created.

Since
2.05.81

◆ sourceRouteDeleted

void deCONZ::ApsController::sourceRouteDeleted ( const QString &  uuid)
signal

Is emitted when a source route is deleted.

Since
2.05.81

◆ updateNode()

virtual bool deCONZ::ApsController::updateNode ( const Node node)
pure virtual

TODO: return object instead of pointer ...

Updates the data of a node in the internal node cache.

Parameters
nodea node which must have a extended IEEE address

The documentation for this class was generated from the following files: