SWRU271I October 2010 – January 2020 CC2540 , CC2540T , CC2541 , CC2541-Q1 , CC2640R2F
The profile containing the characteristics provides set and get abstraction functions for the application to read and/or write a characteristic. The set parameter function should include logic to check for and implement notifications and/or indications if the relevant characteristic has notify and/or indicate properties. Figure 5-13 and the following code depict how to set the simpleProfileChacteristic4 in the simpleGATTProfile.
The application initializes simpleProfileCharacteristic4 to 0 in SimpleBLEPeripheral.c through the following:
The code for this function is displayed in the following code from simpleGATTProfile.c. Other than setting the value of the static simpleProfileChar4, this function also calls GATTServApp_ProcessCharCfg because it has GATT_PROP_NOTIFY properties. This call forces GATTServApp to check if notifications have been enabled by the GATT client. If so, the GATTServApp sends a notification of this attribute to the GATT client.