ZCL library  4.3
ZCL library to manage a Zigbee network
zcl Class Reference

This Class defines the services for sending and receiving ZCL commands. More...

#include <zcl.h>

List of all members.

Public Types

enum  NodeEvent { EVENT_CREATE = 1, EVENT_UPDATE = 2, EVENT_DELETE = 3 }
 Enumeration constant of node events used in the registerCallback method.
enum  Reason {
  UNKNOWN = 0, ANNOUNCE = 1, DISCOVER = 2, MODEL_ID = 3,
  BINDINGS = 4, BIND_CMD = 5, PARENT = 6, CHILDREN = 7,
  LEAVE = 8, RESET = 9, UNPLUG = 10, STOP = 11,
  NAME = 12
}
 Enumeration constant of Node event reasons.
enum  UbeeEvent { UBEE_STARTED = 1, UBEE_RELEASED = 2, UBEE_STOPPED = 3, UBEE_WAITING_BOOT = 4 }
 Enumeration constant of UBee events used in the startUbee method.

Static Public Member Functions

static bool startUbee (void(*pCallback)(UbeeEvent event), const char *portname=NULL)
 Start the ZCL Api and try to communicate with UBee.
static bool stopUbee ()
 Stop the ZCL Api and close the communication with UBee.
static bool isUbeeStarted ()
 Return true if the UBee is started.
static void resetUbee (bool nwkParams=false)
 Reset the UBee with or without the network parameters.
static void resetNetwork ()
 Reset the network.
static void openAssociation (dbyte duration)
 Open/Stop the association on the UBee for a duration.
static std::string getCoordinator ()
 Get the IEEE address of the coordinator detected.
static std::string readNetworkParameters ()
 Read the the network parameters from the non-volatile flash.
static bool writeNetworkParameters (std::string xmlParameters)
 Write the network parameters in the non-volatile flash and Reset the Coordinator.
static dbyte getNetworkChannel ()
 Get the logical channel occupied by the network.
static bool updateNetworkChannel (dbyte channel)
 Update the logical channel of the Zigbee network.
static void setNetworkChannel (dbyte channel)
 Set the logical channel occupied by the network.
static dbyte getNetworkPanId ()
 Get the Pan ID of the network.
static void setNetworkPanId (dbyte panId)
 Set the Pan ID of the network.
static bool loadUbeeFirmware (void(*pCallback)(int percent, void *param), const char *filename, void *param=NULL)
 Load the firmware of the UBee.
static bool registerCallback (void(*pCallback)(zcl::NodeEvent event, const ZNode &node, zcl::Reason))
 Register the callback for receiving the node events.
static void unregisterCallback ()
 Unregister the callback for receiving the node events.
static bool subscribe (NotificationListener *listener, dbyte nwkAddr=ZNode::BROADCAST_NWK_ADDR)
 Subscribe a listener of the notification events for the specified node by its network address.
static bool unsubscribe (NotificationListener *listener, dbyte nwkAddr=ZNode::BROADCAST_NWK_ADDR)
 Unsubscribe a listener from the notification events for the specified node by its network address.
static bool subscribe (RequestListener *listener, dbyte nwkAddr=ZNode::BROADCAST_NWK_ADDR)
 Subscribe a listener of the received requests for the specified node by its network address.
static bool unsubscribe (RequestListener *listener, dbyte nwkAddr=ZNode::BROADCAST_NWK_ADDR)
 Unsubscribe a listener from the received requests for the specified node by its network address.
static bool unsubscribeAll ()
 Unsubscribe all listeners from the notification events.
static int getNodesCount ()
 Return the count of nodes known by the coordinator.
static const ZNodegetNodes (int &size)
 Get all nodes known by the coordinator.
static const ZNodegetGhostNodes (int &size)
 Get all ghost nodes discovered by the coordinator.
static const ZNodesearchNode (dbyte nwkAddr)
 Search a node by its network address.
static const ZNodesearchNode (const ZIEEEAddress &ieeeAddr)
 Search a node by its IEEE address.
static byte sendReadAttributesCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, const Attribute attributes[], int size)
 Send a Read Attributes command to a Zigbee node via the coordinator.
static byte sendReadAttributesCommand (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, const Attribute attributes[], int size)
 Send a Read Attributes command to a Zigbee node on a manufacturer specific cluster via the coordinator.
static byte sendWriteAttributesCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, const WriteAttribute attributes[], int size)
 Send a Write Attributes command to a Zigbee node via the coordinator.
static byte sendWriteAttributesCommand (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, const WriteAttribute attributes[], int size)
 Send a Write Attributes command to a Zigbee node on a manufacturer specific cluster via the coordinator.
static byte sendDiscoverAttributesCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, dbyte attrIdentifier, byte maxAttributes)
 Send a Discover Attributes command to a Zigbee node via the coordinator.
static byte sendDiscoverAttributesCommand (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, dbyte attrIdentifier, byte maxAttributes)
 Send a Discover Attributes command to a Zigbee node on a manufacturer specific cluster via the coordinator.
static byte sendReadReportingConfigurationCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, const ReadReportingConfigAttribute attributes[], int size)
 Send a Read Reporting Configuration command to a Zigbee node via the coordinator.
static byte sendReadReportingConfigurationCommand (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, const ReadReportingConfigAttribute attributes[], int size)
 Send a Read Reporting Configuration command to a Zigbee node on a manufacturer specific cluster via the coordinator.
static byte sendConfigureReportingCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, const ReportingConfigurationAttribute attributes[], int size)
 Send a Configure Reporting command to a Zigbee node via the coordinator.
static byte sendConfigureReportingCommand (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, const ReportingConfigurationAttribute attributes[], int size)
 Send a Configure Reporting command to a Zigbee node on a manufacturer specific cluster via the coordinator.
static byte sendClusterSpecificCommand (dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const byte payload[], int length)
 Send a Cluster Specific command to a Zigbee node via the coordinator (No response is returned).
static byte sendClusterSpecificCommand (int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const byte payload[], int length)
 Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (No response is returned).
static byte sendClusterSpecificCommandExt (dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const ClusterSpecCmdAttribute attributes[], int size)
 Send a Cluster Specific command to a Zigbee node via the coordinator (No response is returned).
static byte sendClusterSpecificCommandExt (int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const ClusterSpecCmdAttribute attributes[], int size)
 Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (No response is returned).
static byte sendClusterSpecificCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const byte payload[], int length)
 Send a Cluster Specific command to a Zigbee node via the coordinator (A response is returned).
static byte sendClusterSpecificCommand (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const byte payload[], int length)
 Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (A response is returned).
static byte sendClusterSpecificCommandExt (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const ClusterSpecCmdAttribute attributes[], int size)
 Send a Cluster Specific command to a Zigbee node via the coordinator (A response is returned).
static byte sendClusterSpecificCommandExt (ResponseListener *listener, int manufacturerCode, dbyte nwkAddr, byte epNumber, dbyte clusterId, byte command, const ClusterSpecCmdAttribute attributes[], int size)
 Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (A response is returned).
static byte sendZCLFrameCommand (ResponseListener *listener, dbyte nwkAddr, byte epNumber, dbyte clusterId, const ZCLFrame &frame)
 Send a ZCL frame to a Zigbee node via the coordinator.
static byte sendZCLFrameCommand (dbyte nwkAddr, byte epNumber, dbyte clusterId, const ZCLFrame &frame)
 Send a ZCL frame to a Zigbee node via the coordinator.
static bool sendBindRequest (ResponseListener *listener, dbyte nwkAddr, const ZIEEEAddress &srcIeeeAddr, byte srcEpNumber, dbyte clusterId, const ZIEEEAddress &dstIeeeAddr, byte dstEpNumber)
 Send a request to bind the cluster of the source end point with a destination end point.
static bool sendBindRequest (ResponseListener *listener, dbyte nwkAddr, const byte srcIeeeAddr[8], byte srcEpNumber, dbyte clusterId, const byte dstIeeeAddr[8], byte dstEpNumber)
 Send a request to bind the cluster of the source end point with a destination end point.
static bool sendBindRequest (ResponseListener *listener, dbyte nwkAddr, const ZIEEEAddress &srcIeeeAddr, byte srcEpNumber, dbyte clusterId, dbyte dstGroupAddr)
 Send a request to bind the cluster of the source end point with a group address.
static bool sendBindRequest (ResponseListener *listener, dbyte nwkAddr, const byte srcIeeeAddr[8], byte srcEpNumber, dbyte clusterId, dbyte dstGroupAddr)
 Send a request to bind the cluster of the source end point with a group address.
static bool sendUnbindRequest (ResponseListener *listener, dbyte nwkAddr, const ZIEEEAddress &srcIeeeAddr, byte srcEpNumber, dbyte clusterId, const ZIEEEAddress &dstIeeeAddr, byte dstEpNumber)
 Send a request to unbind the cluster of the source end point with a destination end point.
static bool sendUnbindRequest (ResponseListener *listener, dbyte nwkAddr, const byte srcIeeeAddr[8], byte srcEpNumber, dbyte clusterId, const byte dstIeeeAddr[8], byte dstEpNumber)
 Send a request to unbind the cluster of the source end point with a destination end point.
static bool sendUnbindRequest (ResponseListener *listener, dbyte nwkAddr, const ZIEEEAddress &srcIeeeAddr, byte srcEpNumber, dbyte clusterId, dbyte dstGroupAddr)
 Send a request to unbind the cluster of the source end point with a group address.
static bool sendUnbindRequest (ResponseListener *listener, dbyte nwkAddr, const byte srcIeeeAddr[8], byte srcEpNumber, dbyte clusterId, dbyte dstGroupAddr)
 Send a request to unbind the cluster of the source end point with a group address.
static bool sendBindingsListRequest (ResponseListener *listener, const dbyte nwkAddrs[], int size)
 Send a request to retrieve/refresh the cluster bindings of the specified devices.
static bool sendLeaveNetworkRequest (dbyte nwkAddr)
 Send a request to force a Zigbee node to leave the network.
static bool initAuthorizedDevices (const ZIEEEAddress addrs[], int size)
 Initialize the IEEE addresses of devices authorized to enter the Zigbee network.
static bool clearAuthorizedDevices ()
 Clear the IEEE addresses of devices authorized to enter the Zigbee network.
static bool addAuthorizedDevice (const ZIEEEAddress &ieeeAddr)
 Add the IEEE address of a device authorized to enter the Zigbee network.
static bool removeAuthorizedDevice (const ZIEEEAddress &ieeeAddr)
 Remove the IEEE address of a device authorized to enter the Zigbee network.
static const ZIEEEAddressgetAllAuthorizedDevices (int &size)
 Get the the IEEE addresses of devices authorized to enter the Zigbee network.
static int getAuthorizedDevicesCount ()
 Get the count of the devices authorized to enter the Zigbee network.
static bool containsAuthorizedDevice (const ZIEEEAddress &ieeeAddr)
 Return true if the device defined by its IEEE address is authorized to enter the Zigbee network.
static void setLicensePath (const char *path)
 Set the license path for finding the license file.
static void setLicenseKey (const char *key)
 Set the license key by programmation.
static bool isLicenseValid ()
 Return true if the license is valid.
static void setDebugTrace (bool displayed)
 Set the displaying of debug traces.
static const char * getVersion ()
 Get the version of ZCL library.

Detailed Description

This Class defines the services for sending and receiving ZCL commands.


Member Function Documentation

static bool zcl::addAuthorizedDevice ( const ZIEEEAddress ieeeAddr) [static]

Add the IEEE address of a device authorized to enter the Zigbee network.

Parameters:
ieeeAddrthe IEEE address of the authorized device.
Returns:
true if successful, otherwise false.
static bool zcl::clearAuthorizedDevices ( ) [static]

Clear the IEEE addresses of devices authorized to enter the Zigbee network.

Returns:
true if successful, otherwise false.
static bool zcl::containsAuthorizedDevice ( const ZIEEEAddress ieeeAddr) [static]

Return true if the device defined by its IEEE address is authorized to enter the Zigbee network.

Parameters:
ieeeAddrthe IEEE address of the authorized device.
Returns:
true if the device is authorized.
static const ZIEEEAddress* zcl::getAllAuthorizedDevices ( int &  size) [static]

Get the the IEEE addresses of devices authorized to enter the Zigbee network.

Parameters:
[out]sizethe returned array size.
Returns:
an array of IEEE Addresses, or NULL if none.
static int zcl::getAuthorizedDevicesCount ( ) [static]

Get the count of the devices authorized to enter the Zigbee network.

Returns:
the count of the authorized devices.
static std::string zcl::getCoordinator ( ) [static]

Get the IEEE address of the coordinator detected.

Returns:
the IEEE address as a string.
static const ZNode* zcl::getGhostNodes ( int &  size) [static]

Get all ghost nodes discovered by the coordinator.

Parameters:
[out]sizethe returned array size.
Returns:
an array of ghost nodes, or NULL if none.
static dbyte zcl::getNetworkChannel ( ) [static]

Get the logical channel occupied by the network.

The returned channel is included between 11 and 26.

Returns:
the logical channel.
static dbyte zcl::getNetworkPanId ( ) [static]

Get the Pan ID of the network.

The returned Pan ID is included between 0x0000 to 0xffff. the value 0x0000 means the Pan ID is not configured. the value 0xffff means the Pan ID is chosen by UBee.

Returns:
the Pan ID.
static const ZNode* zcl::getNodes ( int &  size) [static]

Get all nodes known by the coordinator.

Parameters:
[out]sizethe returned array size.
Returns:
an array of nodes, or NULL if none.
static int zcl::getNodesCount ( ) [static]

Return the count of nodes known by the coordinator.

Returns:
the nodes count.
static const char* zcl::getVersion ( ) [static]

Get the version of ZCL library.

Returns:
the version as a string.
static bool zcl::initAuthorizedDevices ( const ZIEEEAddress  addrs[],
int  size 
) [static]

Initialize the IEEE addresses of devices authorized to enter the Zigbee network.

Parameters:
addrsan array of IEEE addresses.
sizethe IEEE addresses array size.
Returns:
true if successful, otherwise false.
static bool zcl::isLicenseValid ( ) [static]

Return true if the license is valid.

Returns:
true if the license is valid, otherwise false.
static bool zcl::isUbeeStarted ( ) [static]

Return true if the UBee is started.

Returns:
true if the UBee is started, otherwise false.
static bool zcl::loadUbeeFirmware ( void(*)(int percent, void *param)  pCallback,
const char *  filename,
void *  param = NULL 
) [static]

Load the firmware of the UBee.

Parameters:
pCallbackcallback for receiving the progress state.
filenamethe HEX file containing the firmware.
parampointer directly passed in the callback. (can be used to pass the instance which receives the progress state)
Returns:
true if successful.
static void zcl::openAssociation ( dbyte  duration) [static]

Open/Stop the association on the UBee for a duration.

Parameters:
durationthe number of seconds, or 0 to stop the association.
static std::string zcl::readNetworkParameters ( ) [static]

Read the the network parameters from the non-volatile flash.

Returns:
the network parameters as an Xml string, or empty string if failure.
static bool zcl::registerCallback ( void(*)(zcl::NodeEvent event, const ZNode &node, zcl::Reason pCallback) [static]

Register the callback for receiving the node events.

Parameters:
pCallbackthe pointer of callback function.
Returns:
true if successful, otherwise false.
static bool zcl::removeAuthorizedDevice ( const ZIEEEAddress ieeeAddr) [static]

Remove the IEEE address of a device authorized to enter the Zigbee network.

Force the device to leave the network if it is present in the network.

Parameters:
ieeeAddrthe IEEE address of the authorized device.
Returns:
true if successful, otherwise false.
static void zcl::resetUbee ( bool  nwkParams = false) [static]

Reset the UBee with or without the network parameters.

if the option 'nwkParams' is true then reset also the network parameters.

Parameters:
nwkParamsif true then reset also the network parameters.
static const ZNode* zcl::searchNode ( dbyte  nwkAddr) [static]

Search a node by its network address.

Parameters:
nwkAddrthe network address of the searched node.
Returns:
the searched node, or NULL if not found.
static const ZNode* zcl::searchNode ( const ZIEEEAddress ieeeAddr) [static]

Search a node by its IEEE address.

Parameters:
ieeeAddrthe IEEE address of the searched node.
Returns:
the searched node, or NULL if not found.
static bool zcl::sendBindingsListRequest ( ResponseListener listener,
const dbyte  nwkAddrs[],
int  size 
) [static]

Send a request to retrieve/refresh the cluster bindings of the specified devices.

The list of bindings contained in the ZNode is updated on the response.

Parameters:
listenerthe listener for receiving the response.
nwkAddrsan array of node network addresses.
sizethe network addresses array size.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendBindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const ZIEEEAddress srcIeeeAddr,
byte  srcEpNumber,
dbyte  clusterId,
const ZIEEEAddress dstIeeeAddr,
byte  dstEpNumber 
) [static]

Send a request to bind the cluster of the source end point with a destination end point.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstIeeeAddrthe IEEE address of the destination device.
dstEpNumberthe destination end point number.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendBindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const byte  srcIeeeAddr[8],
byte  srcEpNumber,
dbyte  clusterId,
const byte  dstIeeeAddr[8],
byte  dstEpNumber 
) [static]

Send a request to bind the cluster of the source end point with a destination end point.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstIeeeAddrthe IEEE address of the destination device.
dstEpNumberthe destination end point number.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendBindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const ZIEEEAddress srcIeeeAddr,
byte  srcEpNumber,
dbyte  clusterId,
dbyte  dstGroupAddr 
) [static]

Send a request to bind the cluster of the source end point with a group address.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstGroupAddrthe group address of the destination devices.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendBindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const byte  srcIeeeAddr[8],
byte  srcEpNumber,
dbyte  clusterId,
dbyte  dstGroupAddr 
) [static]

Send a request to bind the cluster of the source end point with a group address.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstGroupAddrthe group address of the destination devices.
Returns:
true if the request is valid, otherwise false.
static byte zcl::sendClusterSpecificCommand ( dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const byte  payload[],
int  length 
) [static]

Send a Cluster Specific command to a Zigbee node via the coordinator (No response is returned).

The payload is filled by an array of bytes.

Parameters:
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
payloadthe payload if exist or NULL.
lengththe payload array length.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommand ( int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const byte  payload[],
int  length 
) [static]

Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (No response is returned).

The manufacturer code must be included between 0x0000 and 0xffff, otherwise the manufacturer code will be not present in the ZCLFrame.

The payload is filled by an array of bytes.

Parameters:
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
payloadthe payload if exist or NULL.
lengththe payload array length.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const byte  payload[],
int  length 
) [static]

Send a Cluster Specific command to a Zigbee node via the coordinator (A response is returned).

The payload is filled by an array of bytes.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
payloadthe payload if exist or NULL.
lengththe payload array length.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommand ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const byte  payload[],
int  length 
) [static]

Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (A response is returned).

The manufacturer code must be included between 0x0000 and 0xffff, otherwise the manufacturer code will be not present in the ZCLFrame.

The payload is filled by an array of bytes.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
payloadthe payload if exist or NULL.
lengththe payload array length.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommandExt ( dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const ClusterSpecCmdAttribute  attributes[],
int  size 
) [static]

Send a Cluster Specific command to a Zigbee node via the coordinator (No response is returned).

The payload is filled by an array of Cluster Specific attributes.
The order of the added Cluster Specific attributes determines the order in the payload.

Parameters:
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
attributesthe Cluster Specific attributes which composes the payload or NULL if none.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommandExt ( int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const ClusterSpecCmdAttribute  attributes[],
int  size 
) [static]

Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (No response is returned).

The manufacturer code must be included between 0x0000 and 0xffff, otherwise the manufacturer code will be not present in the ZCLFrame.

The payload is filled by an array of Cluster Specific attributes.
The order of the added Cluster Specific attributes determines the order in the payload.

Parameters:
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
attributesthe Cluster Specific attributes which composes the payload or NULL if none.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommandExt ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const ClusterSpecCmdAttribute  attributes[],
int  size 
) [static]

Send a Cluster Specific command to a Zigbee node via the coordinator (A response is returned).

The payload is filled by an array of Cluster Specific attributes.
The order of the added Cluster Specific attributes determines the order in the payload.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
attributesthe Cluster Specific attributes which composes the payload or NULL if none.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendClusterSpecificCommandExt ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
byte  command,
const ClusterSpecCmdAttribute  attributes[],
int  size 
) [static]

Send a Cluster Specific command to a Zigbee node on a manufacturer specific cluster via the coordinator (A response is returned).

The manufacturer code must be included between 0x0000 and 0xffff, otherwise the manufacturer code will be not present in the ZCLFrame.

The payload is filled by an array of Cluster Specific attributes.
The order of the added Cluster Specific attributes determines the order in the payload.

Parameters:
listenerlistener for receiving the response.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
commandthe cluster specific command.
attributesthe Cluster Specific attributes which composes the payload or NULL if none.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendConfigureReportingCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const ReportingConfigurationAttribute  attributes[],
int  size 
) [static]

Send a Configure Reporting command to a Zigbee node via the coordinator.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to write the reporting configuration.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendConfigureReportingCommand ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const ReportingConfigurationAttribute  attributes[],
int  size 
) [static]

Send a Configure Reporting command to a Zigbee node on a manufacturer specific cluster via the coordinator.

Parameters:
listenerlistener for receiving the response.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to write the reporting configuration.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendDiscoverAttributesCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
dbyte  attrIdentifier,
byte  maxAttributes 
) [static]

Send a Discover Attributes command to a Zigbee node via the coordinator.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attrIdentifierthe first attribute identifier to begin.
maxAttributesthe maximum attributes to discover.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendDiscoverAttributesCommand ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
dbyte  attrIdentifier,
byte  maxAttributes 
) [static]

Send a Discover Attributes command to a Zigbee node on a manufacturer specific cluster via the coordinator.

Parameters:
listenerlistener for receiving the response.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attrIdentifierthe first attribute identifier to begin.
maxAttributesthe maximum attributes to discover.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static bool zcl::sendLeaveNetworkRequest ( dbyte  nwkAddr) [static]

Send a request to force a Zigbee node to leave the network.

If the node has a child router, nothing is done.

Parameters:
nwkAddrthe network address of the Zigbee node.
Returns:
true if successful, otherwise false.
static byte zcl::sendReadAttributesCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const Attribute  attributes[],
int  size 
) [static]

Send a Read Attributes command to a Zigbee node via the coordinator.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to read.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendReadAttributesCommand ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const Attribute  attributes[],
int  size 
) [static]

Send a Read Attributes command to a Zigbee node on a manufacturer specific cluster via the coordinator.

Parameters:
listenerlistener for receiving the response.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to read.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendReadReportingConfigurationCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const ReadReportingConfigAttribute  attributes[],
int  size 
) [static]

Send a Read Reporting Configuration command to a Zigbee node via the coordinator.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to read the reporting configuration.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendReadReportingConfigurationCommand ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const ReadReportingConfigAttribute  attributes[],
int  size 
) [static]

Send a Read Reporting Configuration command to a Zigbee node on a manufacturer specific cluster via the coordinator.

Parameters:
listenerlistener for receiving the response.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to read the reporting configuration.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static bool zcl::sendUnbindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const ZIEEEAddress srcIeeeAddr,
byte  srcEpNumber,
dbyte  clusterId,
const ZIEEEAddress dstIeeeAddr,
byte  dstEpNumber 
) [static]

Send a request to unbind the cluster of the source end point with a destination end point.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstIeeeAddrthe IEEE address of the destination device.
dstEpNumberthe destination end point number.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendUnbindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const byte  srcIeeeAddr[8],
byte  srcEpNumber,
dbyte  clusterId,
const byte  dstIeeeAddr[8],
byte  dstEpNumber 
) [static]

Send a request to unbind the cluster of the source end point with a destination end point.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstIeeeAddrthe IEEE address of the destination device.
dstEpNumberthe destination end point number.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendUnbindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const ZIEEEAddress srcIeeeAddr,
byte  srcEpNumber,
dbyte  clusterId,
dbyte  dstGroupAddr 
) [static]

Send a request to unbind the cluster of the source end point with a group address.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstGroupAddrthe group address of the destination devices.
Returns:
true if the request is valid, otherwise false.
static bool zcl::sendUnbindRequest ( ResponseListener listener,
dbyte  nwkAddr,
const byte  srcIeeeAddr[8],
byte  srcEpNumber,
dbyte  clusterId,
dbyte  dstGroupAddr 
) [static]

Send a request to unbind the cluster of the source end point with a group address.

Parameters:
listenerthe listener for receiving the response.
nwkAddrthe network address of the Zigbee node.
srcIeeeAddrthe IEEE address of the source device.
srcEpNumberthe source end point number.
clusterIdthe cluster identifier.
dstGroupAddrthe group address of the destination devices.
Returns:
true if the request is valid, otherwise false.
static byte zcl::sendWriteAttributesCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const WriteAttribute  attributes[],
int  size 
) [static]

Send a Write Attributes command to a Zigbee node via the coordinator.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to write.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendWriteAttributesCommand ( ResponseListener listener,
int  manufacturerCode,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const WriteAttribute  attributes[],
int  size 
) [static]

Send a Write Attributes command to a Zigbee node on a manufacturer specific cluster via the coordinator.

Parameters:
listenerlistener for receiving the response.
manufacturerCodethe manufacturer code to insert in the ZCLFrame.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
attributesthe attributes to write.
sizethe attributes array size.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendZCLFrameCommand ( ResponseListener listener,
dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const ZCLFrame frame 
) [static]

Send a ZCL frame to a Zigbee node via the coordinator.

Parameters:
listenerlistener for receiving the response.
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
framethe ZCL frame.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static byte zcl::sendZCLFrameCommand ( dbyte  nwkAddr,
byte  epNumber,
dbyte  clusterId,
const ZCLFrame frame 
) [static]

Send a ZCL frame to a Zigbee node via the coordinator.

The ResponseStatus field of the frame control will be set to RESPONSE_NOT_RETURNED.

Parameters:
nwkAddrthe network address of the Zigbee node.
epNumberthe end point number.
clusterIdthe cluster identifier.
framethe ZCL frame.
Returns:
the transaction sequence number of the transmitted ZCL frame.
static void zcl::setDebugTrace ( bool  displayed) [static]

Set the displaying of debug traces.

Parameters:
displayedtrue if displayed (false by default).
static void zcl::setLicenseKey ( const char *  key) [static]

Set the license key by programmation.

Parameters:
keythe license key.
static void zcl::setLicensePath ( const char *  path) [static]

Set the license path for finding the license file.

For Windows

 zcl::setLicensePath("C:/Tmp") ou  zcl::setLicensePath("C:\\Tmp") 

For Linux

 zcl::setLicensePath("/home/tmp") 
Parameters:
paththe path of the license file.
static void zcl::setNetworkChannel ( dbyte  channel) [static]

Set the logical channel occupied by the network.

A reset of UBee with network parameters is necessary to take account the configuration. No more Zigbee node will be associated with the coordinator. The channel have to be included between 10 and 26. The value of 10 corresponds to all channels. It means that the UBee chooses the channel to be occupied among 16 channels.

Parameters:
channelthe logical channel.
static void zcl::setNetworkPanId ( dbyte  panId) [static]

Set the Pan ID of the network.

A reset of UBee with network parameters is necessary to take account the configuration. The Pan ID have to be include between 0x0001 to 0xffff. the value 0xffff means the Pan ID is chosen by UBee.

Parameters:
panIdthe Pan ID.
static bool zcl::startUbee ( void(*)(UbeeEvent event)  pCallback,
const char *  portname = NULL 
) [static]

Start the ZCL Api and try to communicate with UBee.

Parameters:
pCallbackthe pointer of callback function which receives the UBee events.
portnamethe serial port name or NULL for an automatic detection of UBee.
Returns:
true if the UBee is detected on a USB port.
static bool zcl::stopUbee ( ) [static]

Stop the ZCL Api and close the communication with UBee.

Returns:
true if the ZCL Api is stopped with success.
static bool zcl::subscribe ( NotificationListener listener,
dbyte  nwkAddr = ZNode::BROADCAST_NWK_ADDR 
) [static]

Subscribe a listener of the notification events for the specified node by its network address.

Thus it is not possible to subcribe for all nodes and for a specific node in same time.

Parameters:
listenerthe listener of the notification events.
nwkAddrthe network address of the node or BROADCAST_NWK_ADDR for all nodes.
Returns:
true if successful, otherwise false.
static bool zcl::subscribe ( RequestListener listener,
dbyte  nwkAddr = ZNode::BROADCAST_NWK_ADDR 
) [static]

Subscribe a listener of the received requests for the specified node by its network address.

Thus it is not possible to subcribe for all nodes and for a specific node in same time.

Parameters:
listenerthe listener of the received requests.
nwkAddrthe network address of the node or BROADCAST_NWK_ADDR for all nodes.
Returns:
true if successful, otherwise false.
static bool zcl::unsubscribe ( NotificationListener listener,
dbyte  nwkAddr = ZNode::BROADCAST_NWK_ADDR 
) [static]

Unsubscribe a listener from the notification events for the specified node by its network address.

Parameters:
listenerthe listener of the notification events.
nwkAddrthe network address of the node or BROADCAST_NWK_ADDR for all nodes.
Returns:
true if successful, otherwise false.
static bool zcl::unsubscribe ( RequestListener listener,
dbyte  nwkAddr = ZNode::BROADCAST_NWK_ADDR 
) [static]

Unsubscribe a listener from the received requests for the specified node by its network address.

Parameters:
listenerthe listener of the received requests.
nwkAddrthe network address of the node or BROADCAST_NWK_ADDR for all nodes.
Returns:
true if successful, otherwise false.
static bool zcl::unsubscribeAll ( ) [static]

Unsubscribe all listeners from the notification events.

Returns:
true if successful, otherwise false.
static bool zcl::updateNetworkChannel ( dbyte  channel) [static]

Update the logical channel of the Zigbee network.

All Zigbee node is going to change channel by remaining associated to the coordinator. The channel have to be included between 11 and 26.

Parameters:
channelthe channel.
Returns:
true if successful, otherwise false.
static bool zcl::writeNetworkParameters ( std::string  xmlParameters) [static]

Write the network parameters in the non-volatile flash and Reset the Coordinator.

Parameters:
xmlParametersthe network parameters as an Xml string.
Returns:
true if successful, false if XML file malformed.

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