Basic BLE Project

Table of Contents

Introduction

The basic_ble_project project is a BLE framework that enables the user to simply add one function appMain() in order to run full BLE application

The basic_ble_project is a set of ble services and project task and empty appMain() function

ble_app_services

basic_advertise

The basic_advertise application starts legacy advertisement by calling bleStack_initAdvSet().

Remove CONNECTABLE from ADV params, SysConfig: BLE-->Broadcaster Configuration-->Advertisement Parameters 1-->Legacy Event Properties Options-->Scannable undirected * Supports: * Legacy advertisement configured by SysConfig

basic_peripheral

The basic_peripheral application initiates the simple profile services by calling bleApp_initProfiles()

On event INIT_DONE, the application starts legacy advertisement by calling bleStack_initAdvSet()

On event GAP_LINK_ESTABLISHED_EVENT, the connection is done and the application restart the ADV set to enable more connections

On GATT read from central, the value is ready and there is no application calls

On GATT write from central, event BLEAPP_EVT_CHAR_CHANGE, just print the change

basic_central

The basic_central application initiates scan discovery of devices by bleApp_scanInit(), wait for scan reports event BLEAPP_EVT_ADV_SCAN_REPORT, searching for SIMPLEPROFILE_SERV_UUID (save as a connection candidate). On scan done by event BLEAPP_EVT_SCAN_DISABLED, the application connect to the candidate by GapInit_connect() and wait for the connection to be established

On connection established, by event GAP_LINK_ESTABLISHED_EVENT the application start service discovery by calling bleApp_startServiceDiscovery() searching for service SIMPLEPROFILE_SERV_UUID and characteristic SIMPLEPROFILE_CHAR1_UUID

On service discovery done by event GATT_MSG_EVENT and return value of 1 from bleApp_processGATTMsg the application writes value 0x55 to SIMPLEPROFILE_CHAR1_UUID

Configuration

This project has the following app configurations available:

App Build Configuration Description
FlashROM_Release (default) All TI-RTOS debug features disabled but application-logging to UART remains enabled.
The application uses the config file ble_release.cfg and the defines are in <app name>_FlashROM_Release.opt.
FlashROM_Debug All TI-RTOS debug features enabled.
The application uses the config file ble_debug.cfg and the defines are in <app name>_FlashROM_Debug.opt.

All application configurations use the stack library configuration, FlashROM_Library. This build configuration will yield additional flash footprint optimizations by the linker since the application and stack can share contiguous flash pages. This configuration is further discussed in the Stack Library Configuration section of the BLE5-Stack User's Guide provided in the SDK.

Hardware Prerequisites

The default Basic ble project board configuration uses the device's LaunchPad development kit. This hardware configuration is shown in the below image:

For custom hardware, see the Running the SDK on Custom Boards section of the BLE5-Stack User's Guide.

Software Prerequisites

For information on what versions of Code Composer Studio and IAR Embedded Workbench to use, see the Release Notes file provided in the SDK. For information on how to import this project into your IDE workspace and build/run, please refer to the device's Platform section in the BLE5-Stack User's Guide.