www.ti.com
Generic Attribute Profile (GATT)
57
SWRU271H–October 2010–Revised April 2019
Submit Documentation Feedback
Copyright © 2010–2019, Texas Instruments Incorporated
The Bluetooth Low Energy Protocol Stack
5.5.4.2.3 Register Application Callback Function
Profiles can relay messages to the application using callbacks. In the SimpleBLEPeripheral project, the
simpleGATTProfile calls an application callback whenever the GATT client writes a characteristic value.
To use these application callbacks, the profile must define a register application callback function that the
application uses to set up callbacks during initialization. The following is the register application callback
function of the simpleGATTProfile:
Where the typedef callback is defined as follows:
The application must define a callback of this type and pass it to the simpleGATTProfile with the
SimpleProfile_RegisterAppCBs() function. The application does this in simpleBLEPeripheral.c through the
following:
For the mechanism of how this callback is used, see Section 5.5.4.2.4.
5.5.4.2.4 Read and Write Callback Functions
The profile must define read and write callback functions that the protocol stack will call when one of the
attributes of the profile is written to and/or read from. The callbacks must be registered with GATTServApp
function as mentioned in Section 5.5.4.2.2. These callbacks perform the characteristic reads, writes, and
other processing like possibly calling an application callback defined by the profile.