Building and running a Bluetooth LE example application

This section presents the general requirements for using and testing a demo application. To open, build, and run any example application on a specific board, refer to the Bluetooth Low Energy Quick Start Guide document for the corresponding board.

User interface

The demo applications that implement the Battery Service expose the current battery level, as measured on the board, through the Battery Level characteristic. The value represents a percentage between 0 and 100. The value can be read from the device from a connected GATT client.

The demo applications that implement the Device Information Service display various information regarding the current software, hardware, and firmware revisions. These values are used as an example and application developers can modify them when developing their product. The values can be read from the device through a connected GATT client.

Parent topic:Building and running a Bluetooth LE example application

Security

The examples that enable pairing always generate a default passkey of 999999 that must be entered on the Central device, which is usually a smartphone or tablet.

Parent topic:Building and running a Bluetooth LE example application

Testing devices

To demonstrate the profile functionality, most of the scenarios require one of the supported platforms and a Bluetooth Low Energy capable central device. The device is usually a smartphone or a tablet that runs a compatible Bluetooth LE application. The figure below shows the IoT Toolbox UI.

IOT toolbox

The recommended application is the IoT Toolbox, which can be installed on Apple iOS or Android OS handheld devices that support Bluetooth Low Energy. The application can be found on Apple Playstore or on Google Play.

Other demos can be run by using two platforms, one for the peripheral and one for the central role. A few examples of such demos are listed below:

  • Low-Power Temperature Sensor and Collector

  • Wireless UART

  • OTAP Client and Server

  • HID Host and Device

  • Extended Advertising Central and Peripheral

  • EATT Central and Peripheral

To provide feedback and more interaction, some examples use a shell console via the virtual COM port. To access the device, open a serial port terminal and as shown in the figure below. For this example, Tera Term VT and a KW45B41Z-EVK or K32W148-EVK, or a FRDM-MCXW71 board can be used. The communication parameters are 115200 and 8N1.

Connect it to the platform with parameters as shown in the figure below .

The start screen is displayed after the board is reset as shown in the figure below .

Parent topic:Building and running a Bluetooth LE example application

Time client devices

Some applications implement the Current Time Service. To enable this feature, define the gAppUseTimeService_d parameter in the app_preinclude.h file as 1. If the Time Client is enabled, the device must synchronize with a Time Server to update its internal date/time to the current date/time. If you connect the device to the phone, the Time Client synchronizes with the phone (pairing and bonding must be active).

Parent topic:Building and running a Bluetooth LE example application