The control of the Light from the Remote happens in a client-server model. This is as per the Zigbee Cluster Library (ZCL) specification. The light holds the relevant data (attributes) and is the server. The Remote is the client and manipulates the attributes on the light through commands.
Example:Change in brightness level of the Light from the AVR477 Remote Control.
The Move to
Level
command is part of the Level Control
Cluster. This command is sent from the remote to the light with the parameters:
level
and
transition time
.
When the light receives this command, it should move to the new level over the specified
transition time.
When the wireless command to move to level reaches the ATSAMR21 MCU, it is
propagated to the application from the lower layers in the stack to the application. The
moveToLevelInd()
function (in
lightLevelControlCluster.c
) is an indication
function to inform the application that a new moveToLevel
command has been received.
This command is processed by the application and provided to the LED Driver via function
APP_PWMMoveToLevel()
(in
lightPwm.c
). This
function scales the level value to the PWM duty cycle value and starts a timer to
periodically move level. This is done so that the new level is achieved at the end of
the provided transition time.