Zigbee_OnOffSwCfg_Client_Coord Application Description

How to use the OnOff Switch Config cluster on a device acting as a Client within a Centralized Zigbee network.

The purpose of this application is to show how to create a Zigbee centralized network, and how to communicate from one node to another one using the OnOff Switch Config cluster. Once the Zigbee mesh network is created, the user can send requests from the Client to the Server through push buttons SW1/SW2 in order to read or change attribute SWITCH ACTION.

Note: The OnOff Switch Config Server Cluster needs always to be integrated in a device with a OnOff Client Cluster.

Keywords

Connectivity, Zigbee, Zigbee protocol, 802.15.4 protocol, OnOff cluster, Switch Config cluster

Hardware Requirements

For this application it is requested to have:

    
    
                            Coord.                                           Router
                          +--------+                                       +--------+
                          |        |                                       |        |
                          | OnOff  |                                       | OnOff  |        
                          | SwCfg  |                                       | SwCfg  | 
                          | Client |                                       | Server | 
                          |        |                                       |        |
                          | OnOff  |                                       | OnOff  |        
                          | Server |                                       | Client | 
                          |        |                                       |        | 'OnOff Switch Config' during init : default Switch Action Toggle(SW1)
                          |        |                                       |        |   <= ZbZclAttrIntegerWrite(ZCL_ONOFF_SWCONFIG_ATTR_ACTIONS)
                          |        |                                       |        |              
                          |        |   ZbZclOnOffClientToggleReq           |        |
        Red LED Toggle <= |        | <------------------------------------ |        | <= PushB SW1
                          |        |                                       |        |
                          |        |                                       |        |                         
                          |        |   ZbZclWriteReq                       |        |
    * Change Action Mode  |        |   (ZCL_ONOFF_SWCONFIG_ATTR_ACTIONS)   |        |
            PushB SW2 =>  |        | ------------------------------------> |        | => Switch Action : from Toggle(SW1) to On(SW1)/Off(SW2)
                          |        |                                       |        |              
                          |        |   ZbZclOnOffClientOnReq               |        |
            Red LED ON <= |        | <------------------------------------ |        | <= PushB SW1
                          |        |                                       |        |              
                          |        |   ZbZclOnOffClientOffReq              |        |
           Red LED OFF <= |        | <------------------------------------ |        | <= PushB SW2
                          |        |                                       |        |
                          |        |                                       |        |                         
                          |        |   ZbZclReadReq                        |        |
                          |        |   (ZCL_ONOFF_SWCONFIG_ATTR_ACTIONS)   |        |
            PushB SW1 =>  |        | ------------------------------------> |        |
      Display Setting <=  |        | <------------------------------------ |        |
                          |        |                                       |        |                         
                          |        |                                       |        |                         
                          |        |   ZbZclWriteReq                       |        |
    * Change Action Mode  |        |   (ZCL_ONOFF_SWCONFIG_ATTR_ACTIONS)   |        |
            PushB SW2 =>  |        | ------------------------------------> |        | => Switch Action : from On(SW1)/Off(SW2) to Off(SW1)/On(SW2)
                          |        |                                       |        |              
                          |        |   ZbZclOnOffClientOnReq               |        |
            Red LED ON <= |        | <------------------------------------ |        | <= PushB SW2
                          |        |                                       |        |              
                          |        |   ZbZclOnOffClientOffReq              |        |
           Red LED OFF <= |        | <------------------------------------ |        | <= PushB SW1
                          |        |                                       |        |
                          |        |                                       |        |                         
                          |        |   ZbZclWriteReq                       |        |
    * Change Action Mode  |        |   (ZCL_ONOFF_SWCONFIG_ATTR_ACTIONS)   |        |
            PushB SW2 =>  |        | ------------------------------------> |        | => Switch Action : from Off(SW1)/On(SW2) to Toggle(SW1)
                          |        |                                       |        |              
                          |        |   ZbZclOnOffClientToggleReq           |        |
        Red LED Toggle <= |        | <------------------------------------ |        | <= PushB SW1
                          |        |                                       |        |              
                          |        |                                       |        |                      
                          +--------+                                       +--------+

  

Application Setup

Note: When LED Red, Green and Blue are toggling it is indicating an error has occurred on application.

Hardware and Software environment

Traces

Note

By default, this application runs with Zigbee PRO stack R23.
If you want to run this application using Zigbee PRO stack R22, you should replace ZigBeeProR23_FFD.a by ZigBeeProR22_FFD.a and ZigBeeProR23_RFD.a by ZigBeeProR22_RFD.a and ZigBeeClusters.a by ZigBeeClustersR22.a in the build environment.
Also, set in the project setup compilation flag CONFIG_ZB_REV=22.