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

Represents a ZigBee node with all its descriptors and clusters. More...

#include <node.h>

Public Member Functions

 Node ()
 Constructor.
 
 Node (const Node &other)
 Copy constructor.
 
Nodeoperator= (const Node &other)
 Assignment operator.
 
virtual ~Node ()
 Deconstructor.
 
virtual CommonState state () const =0
 Returns the current node state.
 
const deCONZ::Addressaddress () const
 Returns the const node address.
 
bool isCoordinator () const
 Returns true if the node is a coordinator.
 
bool isRouter () const
 Returns true if the node is a router.
 
bool isEndDevice () const
 Returns true if the node is a end-device.
 
bool isZombie () const
 Returns true if the node not reachable.
 
void setIsZombie (bool isZombie)
 Sets the reachable state of the node.
 
const QString & userDescriptor () const
 Returns the user descriptor (usually the nodes name).
 
void setUserDescriptor (const QString &userDescriptor)
 Sets the user descriptor.
 
QString deviceTypeString ()
 Returns the device type as string which might be Coordinator, Router or End device.
 
const std::vector< uint8_t > & endpoints () const
 Returns all known active endpoint numbers.
 
void setActiveEndpoints (const std::vector< uint8_t > &ep)
 Sets the active endpoint numbers.
 
SimpleDescriptorgetSimpleDescriptor (uint8_t endpoint)
 Returns a simple descriptor for a endpoint.
 
bool setSimpleDescriptor (const SimpleDescriptor &descr)
 Adds or updates a simple descriptor.
 
std::vector< SimpleDescriptor > & simpleDescriptors ()
 Returns the modifyable list of a simple descriptors.
 
const std::vector< SimpleDescriptor > & simpleDescriptors () const
 Returns the const list of a simple descriptors.
 
int copySimpleDescriptor (uint8_t endpoint, SimpleDescriptor *descr) const
 Copy the simple descriptor specified by endpoint from internal storage to descr.
 
const NodeDescriptornodeDescriptor () const
 Returns the node descriptor.
 
void setNodeDescriptor (const NodeDescriptor &descr)
 Sets the node descriptor.
 
const PowerDescriptorpowerDescriptor () const
 Returns the power descriptor.
 
void setPowerDescriptor (const PowerDescriptor &descr)
 Sets the power descriptor.
 
const MacCapabilities & macCapabilities () const
 Returns the mac capabilities.
 
void setMacCapabilities (MacCapabilities cap)
 Sets the mac capabilities.
 
void resetAll ()
 Resets internal fields and state.
 
virtual const std::vector< NodeNeighbor > & neighbors () const =0
 Returns all neighbors of the node.
 
const std::vector< SourceRoute > & sourceRoutes () const
 Returns all source routes of the node.
 
int addSourceRoute (const SourceRoute &sourceRoute)
 Add or update a source route.
 
bool updateSourceRoute (const SourceRoute &sourceRoute)
 Update a source route.
 
int removeSourceRoute (uint srHash)
 Removes a source route specified by srHash.
 
virtual const BindingTablebindingTable () const =0
 Returns the binding table of a node.
 
void pushEdScan (int ed)
 
int edScanValue () const
 
bool needRedraw () const
 
void setNeedRedraw (bool redraw)
 

Protected Attributes

NodePrivated_ptr = nullptr
 

Detailed Description

Represents a ZigBee node with all its descriptors and clusters.

Member Function Documentation

◆ addSourceRoute()

int deCONZ::Node::addSourceRoute ( const SourceRoute sourceRoute)

Add or update a source route.

If a source route with the same order or uuid exists, it will be replaced.

Parameters
sourceRoute
Return values
0on success, a new source route was added
1on success, existing source route was updated
-1if the source route isn't valid

◆ copySimpleDescriptor()

int deCONZ::Node::copySimpleDescriptor ( uint8_t  endpoint,
SimpleDescriptor descr 
) const

Copy the simple descriptor specified by endpoint from internal storage to descr.

Parameters
endpointshall be between 1-254
descrpointer to a user simple descriptor
Return values
0on success
-1if not found
-1descr is 0

◆ endpoints()

const std::vector< uint8_t > & deCONZ::Node::endpoints ( ) const

Returns all known active endpoint numbers.

Returns a list of all active application endpoints on the node.

The list might be empty if the ZDP active endpoint request is not done for the node yet.

◆ getSimpleDescriptor()

SimpleDescriptor * deCONZ::Node::getSimpleDescriptor ( uint8_t  endpoint)

Returns a simple descriptor for a endpoint.

Parameters
endpointshall be between 1-254
Returns
a pointer to the internal SimpleDescriptor if found
Return values
0if no simple descriptor is available for endpoint

◆ removeSourceRoute()

int deCONZ::Node::removeSourceRoute ( uint  srHash)

Removes a source route specified by srHash.

Return values
0if the source route was removed
-1if there was no source route with the given uuid

◆ setMacCapabilities()

void deCONZ::Node::setMacCapabilities ( MacCapabilities  cap)

Sets the mac capabilities.

Parameters
capor combined value of deCONZ::MacCapability

◆ setNodeDescriptor()

void deCONZ::Node::setNodeDescriptor ( const NodeDescriptor descr)

Sets the node descriptor.

Parameters
descra node descriptor

◆ setPowerDescriptor()

void deCONZ::Node::setPowerDescriptor ( const PowerDescriptor descr)

Sets the power descriptor.

Parameters
descra power descriptor

◆ setSimpleDescriptor()

bool deCONZ::Node::setSimpleDescriptor ( const SimpleDescriptor descr)

Adds or updates a simple descriptor.

Parameters
descra simple descriptor with endpoint between 1-254
Returns
true on updated added, false if nothing changed

◆ setUserDescriptor()

void deCONZ::Node::setUserDescriptor ( const QString &  userDescriptor)

Sets the user descriptor.

Parameters
userDescriptora string with a max length of 16

◆ updateSourceRoute()

bool deCONZ::Node::updateSourceRoute ( const SourceRoute sourceRoute)

Update a source route.

If a source route with the same order or uuid exists, it will be replaced.

Parameters
sourceRoute
Return values
truewhen existing source route was updated
falseif the source route wasn't found

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