Section overview

This section covers some BLE and mbed concepts in greater detail.

Service templates

With mbed BLE, we offer a growing set of SIG-defined BLE services implemented as C++ headers to ease application development. These can be found under the mbed OS API services folder.

But, we don’t expect you to settle for what’s already been done; we expect you to develop applications for custom sensors and actuators,. These will often fall outside the scope of the standard Bluetooth services or the service templates offered by mbed BLE. In this case, you could use the BLE_API. You may also find that you benefit from modelling your custom services as C++ classes for ease of use (and reuse). Here, we’d like to capture the process of creating a BLE service.

Creating a BLE service may sound scary, but we’ve created two templates that you can easily adapt to your needs:

  • The input service template demonstrates the use of a simple input (boolean values) from a read-only characteristic. You can get the code here or read the full explanation here.

  • The actuator service template demonstrates the use of a read-write characteristic to control an LED through a phone app. You can get the code here or read the full explanation here.

  • We have two more service samples that include the use of Evothings custom apps. The first reviews customising a GAP advertising packet, and the second creates a GATT service for control of a LED.

Note: These examples are all written for mbed 2.0 and 5.0, but you may find them interesting even if you’re working on mbed OS 3.0, because the underlying logic of BLE and the API is the same.

Advanced features

Reviewing advanced features of standard implementations:

Firmware Over the Air

Reviewing Firmware Over the Air (FOTA):