Datasheet

BLEService
This base class is used when defining custom BLE Gatt Services, such as the various service helper classes that make
up the Adafruit Bluefruit nRF52 API described here.
Unless you are implementing a custom GATT service and characteristic, you normally won't use this base class directly,
and would instantiate and call a higher level helper service or characteristic included in the Bluefruit nRF52 API.
Basic Usage
There are normally only two operation required to use the BLEService class:
You need to declare and instantiate the class with an appropriate 16-bit or 128-bit UUID in the constructor:
You then need to call the .begin() method on the instance before adding any BLECharacteristics to it (via the
BLECharacteristic's respective .begin() function call):
Order of Operations (Important!)
One very important thing to take into consideration when working with BLEService and BLECharacteristic, is that any
BLECharacteristic will automatically be added to the last BLEService that had it's `.begin()` function called. As such, you
must call yourService.begin() before adding any characteristics!
See the example at the bottom of this page for a concrete example of how this works in practice.
API
BLEService has the following overall class structure:
The Bluefruit nRF52 Feather codebase is in an early BETA stage and is undergoing active development
based on customer feedback and testing. As such, the class documentation here is incomplete, and you
should consult the Github repo for the latest code and API developments: https://goo.gl/LdEx62
BLEService myService = BLEService(0x1234);
myService.begin();
This documentation may be slightly out of date as bugs are fixed, and the API develops. You should always
consult the Github repo for the definitive latest code release and class definitions!
© Adafruit Industries https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide Page 104 of 175