SWRU271I October 2010 – January 2020 CC2540 , CC2540T , CC2541 , CC2541-Q1 , CC2640R2F
This section describes how to use the GATT layer directly in the application. The functionality of the GATT layer is implemented in the library code but you can find the header functions can in gatt.h. You can find the complete API for the GATT layer in Section D. You can find more information on the functionality of these commands in the Device Information Service (Bluetooth Specification), version 1.0 (24-May-2011). GATT client applications uses these functions primarily. A few server-specific functions exist which are described in the API and not considered here. Most GATT functions return ATT events to the application, so consider the ATT API in Section D. Perform the following procedure to use the GATT layer when functioning as a GATT client (that is, in the SimpleBLECentral project):
NOTE
Though the event sent to the application is an ATT event, it is sent as a GATT protocol stack message (GATT_MSG_EVENT).
Besides receiving responses to its own commands, a GATT client may also receive asynchronous data from the GATT server as indications or notifications.
These events will also be sent as ATT events in GATT messages to the application and should be handled as described in this procedure.