Atmel AVR2060: BitCloud ZigBee Light Link Quick Start Guide [APPLICATION NOTE]
42004B
−
AVR
−
08/2012
12
3.4
Supported clusters
lists clusters supported by the demo applications for the color light and color scene controller. Note that most
of the clusters used by Light Link applications duplicate common clusters from the ZigBee Cluster Library, but may be
slightly different, and so applications should employ clusters specially defined for the ZigBee Light Link profile (header
files for these clusters include
Zll
in their names).
Table 3-3. Clusters supported by the demo application (s – server, c - client).
Color light
Color scene controller
Basic (s)
Commissioning (s)
OnOff (s)
Level control (s)
Color control (s)
Groups (s)
Identify (s)
Scenes (s)
Commissioning (c)
Basic (s)
Commissioning (s)
Commissioning (c)
OnOff (c)
Level control (c)
Groups (c)
Identify (c)
Scenes (c)
3.5
Source code organization
Application projects and source code are located in the
/Applications/ZLLDemo
folder inside the SDK. The source
code is divided into the common part, code specific to a color light and code specific a color scene controller. The entry
main()
function is located the
colorLight.c
file for color light and in the
colorSceneRemote.c
file for color scene
controller in the corresponding folders. An endpoint for communication between clusters is registered in the same file.
A separate source code file is provided for each cluster supported by color light and color scene controller. Such file
initializes structures needed for the cluster and implements callback functions that are called to indicate commands’
responses. For example, see the
colorLightColorControlCluster.c
file, which initializes the color control
cluster for the color light device.
The device type for which the application is compiled is configured in the
configuration.h
file, depending on
whether the
APP_DEVICE_TYPE_COLOR_LIGHT
or
APP_DEVICE_TYPE_COLOR_SCENE_REMOTE
symbol is defined
and equals 1.
3.5.1 IAR projects
IAR project files for the demo application are located in the
/Applications/ZLLDemo/IAR_projects
folder. The
project files define several application configurations differing in what portions of the BitCloud stack’s code are
compiled. Configurations with names prefixed with
All_
include code for all ZigBee device types (router, end device
and coordinator), while configurations which names start with
Router_
or
EndDevice_
include functionality of only a
router or an end device, respectively. Since a color light must be a router and a color scene remote an end device, an
All_*
configuration can be used for both devices, whereas an
EndDevice_*
configuration can be used only for the
color scene remote application. However, the latter configuration results in a smaller size of the produced firmware
(around 30Kb).
A particular device type for which the application is compiled depends on whether
APP_DEVICE_TYPE_COLOR_LIGHT
or
APP_DEVICE_TYPE_COLOR_SCENE_REMOTE
symbol is defined in the
configuration.h
file. Application code for
the other device type is not compiled.