User guide

8.1 Callback Interface
AppBuilder is very versatile, with one example being the callback interface, which allows user applications to be notified about important
events
or make decisions based on runtime state. Software designers can choose which callbacks are needed for their application and
can leave the rest disabled so that only the chosen callbacks appear in the user’s Callbacks C file. The rest are safely defined as
empty stubs within the framework until they are enabled.
Callbacks are the places where custom application code can be added on top of Silicon Labs’ existing framework to give that applica-
tion unique behaviors and decide how it will react. Within the callback implementations, developers can utilize the entire HAL and stack
APIs as well as a complete set of Application Framework-specific APIs that often provide high-level wrappers around complex HAL or
stack functionality. These APIs are documented in an Application Framework API Guide and be found in use in existing sample code.
Like all of the Silicon Labs Application Framework, full source code in C is provided to help understand the implementation of these
APIs.
Overall, there are over 200 callbacks to choose from. In addition, Application Builder automatically provides a unique callback for every
incoming message type supported by the device’s application protocol, enabling the application to handle each incoming command
frame exactly as desired.
8.2 Customization
To add proprietary extensions to a standard application protocol like ZCL, just describe the custom clusters, commands, attributes, and
device types in an XML file that follows the Silicon Labs schema, and point AppBuilder to the XML file. The next time a configuration
based on that stack is created or edited, those manufacturer-specific enhancements will appear as clusters and attributes that can be
enabled, and callbacks will automatically be provided to handle any proprietary incoming commands declared in the XML data. App-
Builder will even create macros that firmware can use to quickly craft an outgoing message in the proprietary format, enabling the as-
sembly of a command frame and the passing of arguments from the API to populate parameters of that command.
8.3 Plugins
The [Plugins] tab in AppBuilder also enables application acceleration. This tab has over 100 plugins that each implement one or more
callbacks on top of the Application Framework to provide a sophisticated state machine for complex features like message fragmenta-
tion, RF4CE device profiles, or external dataflash storage for downloading firmware updates. Source code for all plugins is available, so
the code is there as a point of reference for customized implementations.
Many plugins implement functionality for a specific ZigBee ZCL cluster, such as Level Control, Groups, or Key Establishment, so the
plugin can be enabled and, in many cases, provide all the needed messaging required to pass ZigBee application layer compliance
tests. Other plugins implement a software state machine and expect developers to integrate the hardware behavior into that state ma-
chine to get the device to physically react to the change in software state. Still other plugins are provided as sample code that can be
used like a test harness to exercise functionality otherwise not available in the system.
8.4 Generating a Project
After making selections for any portions of the application the developer wishes to customize, AppBuilder will generate a software
project with customized header files and array definitions in C code to represent the desired application behavior. The resulting project
can be built from within Simplicity IDE to produce a binary that can be loaded onto the target wireless SoC.
This project generation is specific to the stack version and target chip where the configuration is done, but the Silicon Labs Application
Framework abstracts many of these differences within its APIs and state machines, so AppBuilder configurations can be reused across
different stack versions or chip platforms. This makes it much easier to transition from one version of a stack release to the next.
8.5 More Information
More information on the Simplicity AppBuilder tool can be found in "UG102: Ember Application Framework Developer's Guide." This
document can be found on the Silicon Labs website: http://www.silabs.com/Support%20Documents/TechnicalDocs/UG102.pdf..
AN0822: Simplicity Studio™ User Guide
Application Builder
silabs.com | Smart. Connected. Energy-friendly. Rev. 0.2 | 14