Application Development in Simplicity Studio#
Starting Application Development#
Developing a Bluetooth application consists of two main steps: defining the GATT database structure and defining the event handlers for events such as connection_opened, connection_closed, and so on.
More Demos and Examples lists the various examples available in the SDK. The most common starting point for application development is the SoC Empty example. This project contains a simple GATT database (including the Generic Access service, Device Information service, and OTA service) and a while loop that handles some events raised by the stack. You can extend both the GATT database and the event handlers of this example according to your needs.
Note: Beginning with Bluetooth SDK version 2.7.0.0, all devices must be loaded with the Gecko Bootloader as well as the application. While you are getting started, the easiest way to do this is to load any of the precompiled demo images that come with the bootloader configured as part of the image. When you flash your application it overwrites the demo application, but the bootloader remains. Subsequently you may wish to build your own bootloader, as described in UG266: Silicon Labs Gecko Bootloader User’s Guide for GSDK 3.2 and Lower or UG489: Silicon Labs Gecko Bootloader User’s Guide for GSDK 4.0 and Higher.
New Project creation is done through three dialogs:
Target, SDK, and Toolchain
Examples
Configuration
An indicator at the top of the dialog shows you where you are.
You can start a project from different locations in the Launcher Perspective, as described in the Simplicity Studio 5 User's Guide. While you are getting started, we suggest starting from the File menu, as that takes you through all three of the above dialogs.
Select New >> Silicon Labs Project Wizard.
Review your SDK and toolchain. If you wish to use IAR instead of GCC, be sure to change it here. Once you have created a project it is difficult to change toolchains. Click NEXT.
On the Example Project Selection dialog, filter on Bluetooth and select Bluetooth - SoC Empty. Click NEXT.
On the Project Configuration dialog, rename your project if you wish. Note that if you change any linked resource, it is changed for any other project that references it. While you are getting started the default choice to include project files but link to the SDK is best. Click FINISH. If the example has documentation, the project opens on a readme tab. Note that a Simplicity IDE perspective control is now included in the upper right of the screen.
GATT Database#
A visual GATT Configurator is available on the gatt_configuration.btconf tab when you create the project, to help you create your own GATT database with a few clicks.
You can create your own database at this point, or return to it later either by double-clicking the gatt_configuration.btconf file under your project in Project Explorer, or through the Project Configurator’s Advanced > GATT Configurator component. For more information, see section The GATT Configurator.
A reference for each characteristic is generated and defined in gatt_db.h. You can use this reference in your code to read / write the values of the characteristics in the local GATT database with sl_bt_gatt_server_read_attribute_value()
/ sl_bt_gatt_server_write_attribute_value()
commands.
You can also build the GATT database from the