SWRU271I October 2010 – January 2020 CC2540 , CC2540T , CC2541 , CC2541-Q1 , CC2640R2F
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.