Datasheet

BLEClientCharacteristic
This base class is used when defining custom client for BLE GATT characteristics, and is used throughout the Adafruit
Bluefruit nRF52 API and helper classes.
Unless you are implementing a custom client for 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 three main steps to using the BLECharacteristic class.
1.) First, you need to declare and instantiate your BLECharacteristic class with a 16-bit or 128-bit UUID:
2.) Then you need to set the relevant callback for the characteristic if it supports notify or indicate.
.setNotifyCallback This sets the callback that will be fired when we receive a Notify message from peripheral.
This is needed to handle notifiable characteristic since callback allow us to response to the message in timely
manner
.begin() will cause this characteristic to be added to the last BLEClientService that had it's .begin() method called.
3) Discover the characteristic after connected to peripheral by calling .discover() It is a must in order to perform any
operation such as .read(), .write(), .enableNotify().
API
BLEClientCharacteristic 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
BLEClientCharacteristic myChar = BLEClientCharacteristic(0xABCD);
myChar.setNotifyCallback(notify_callback);
myChar.begin();
if ( myChar.discover() )
{
uint32_t value = myChar.read32();
}
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 117 of 175