Writing ZigBee cluster library definition for code generation

54 views
Skip to first unread message

Tommi

unread,
Apr 9, 2016, 1:24:50 AM4/9/16
to zigbee4java
Hi

Is anybody interested in help with writing down the ZigBee cluster library definition for code generation?

The aim of this work is to code generate certain parts of the code base to have 100% coverage of all cluster library commands. This generated code will replace the parts which are now hard coded to cluster implementations. This will allow constructing the commands either directly or through the cluster interfaces.

Here is the specification from ZigBee alliance:


This is the wiki page where the protocol is being written:


If you are able to help please follow the syntax of existing clusters and commands in the page so that it can be processed by the code generator.

Best regards,
Tommi 

Tommi

unread,
Apr 10, 2016, 2:02:46 PM4/10/16
to zigbe...@googlegroups.com
The code generation is implemented and working. It can be currently used to send and receive ZCL commands directly through ZigBeeApi. The definition file is about half way done and it should be easy to add missing messages as they are needed:

/**
* Sends ZCL command message without waiting for response.
* @param commandMessage the command message
* @throws ZigBeeNetworkManagerException if exception occurs in sending
*/
public void sendCommand(final ZclCommandMessage commandMessage) throws ZigBeeNetworkManagerException {
zclCommandTransmitter.sendCommand(commandMessage);
}

/**
* Adds ZCL command listener.
* @param commandListener the command listener
*/
public void addCommandListener(final ZclCommandListener commandListener) {
this.zclCommandTransmitter.addCommandListener(commandListener);
}

/**
* Removes ZCL command listener.
* @param commandListener the command listener
*/
public void removeCommandListener(final ZclCommandListener commandListener) {
this.zclCommandTransmitter.removeCommandListener(commandListener);
}

Example log about receiving IAS Zone / Zone Status Change Notification:

ZigBee API starting up ... [OK]
There are 4 known devices in the network.
ZigBee console ready.
Node added: XX:XX:XX:XX:XX:XX:XX:XX (#0)
Node discovered: XX:XX:XX:XX:XX:XX:XX:XX (#0)
Received: Zone Status Change Notification XXXX.1 -> 0.2 {Zone Status=50, Extended Status=0}

-Tommi
Reply all
Reply to author
Forward
0 new messages