What Is GATT in Bluetooth Low Energy?
After two BLE devices connect, an application needs a way to find and use the other device’s data. GATT gives that data a discoverable structure.
What you’ll learn
- Distinguish GATT from ATT and GAP
- Explain GATT client and server behavior
- Follow discovery, read, write, notification, and indication workflows
Read the architecture and GAP lessons, or know what a BLE connection is.
Why a data model is needed
A connected sensor might offer temperature, battery level, and a control setting. The phone cannot safely guess which bytes mean which value or where they reside. The Generic Attribute Profile (GATT) defines a way to organize a server’s attribute table into services, characteristics, and descriptors and provides procedures for a client to discover and use them.
GATT is especially important for connected application data. It is not the mechanism by which a scanner receives an advertising packet. To understand that earlier stage, see the GAP lesson.
Where GATT sits in the stack
In the BLE architecture, the application requests an operation, such as reading a battery level. GATT defines the structure and higher-level procedure; the Attribute Protocol (ATT) carries the corresponding client/server attribute operations. L2CAP routes ATT data, and the lower stack carries it across the established BLE link. A successful radio connection alone does not guarantee that a particular attribute can be read or written.
It helps to separate data meaning from transport action. “Battery Level characteristic” describes meaning in GATT. “Read this attribute handle” is an ATT operation. This distinction also explains why a development tool may show both a familiar service name and a numeric handle.
Client, server, and the attribute database
The GATT server holds the attribute database. A GATT client discovers entries and initiates supported operations. A sensor commonly acts as server; a phone app commonly acts as client. These GATT roles do not define who initiated the radio connection: central/peripheral are GAP roles. Although the usual sensor example combines central+client and peripheral+server, applications can use other combinations.
Each attribute has a handle that locates that entry within this server’s database and a UUID identifying its type. A service groups related characteristics. A characteristic has a declaration and a value attribute, and may have descriptors that add information or configuration. Handles can vary across products and database versions; UUIDs identify types, not fixed locations.
Discover before using
A client generally discovers the server’s services, then the characteristics within a relevant service, before it chooses a value handle. It may also discover descriptors. A service UUID tells the client what family of functionality a service represents; a characteristic UUID tells it which value or control is present. Discovery prevents the application from relying on handles copied from a different device.
The next lesson inspects each entry in detail. For now, notice that a characteristic is more than one value byte string: its declaration describes the value’s UUID and properties, and optional descriptors may follow it.
Read, write, or receive updates
A client may read a permitted value when it needs the current state. It may write a permitted value to change a setting. A characteristic’s properties advertise supported operation types, while the server’s permissions and security rules determine whether a specific attempt is allowed. A value can advertise Read and still require an encrypted or authenticated link.
For changing data, a server may send notifications after the client configures them, avoiding repeated reads. Indications also update the client but require an ATT confirmation. Both require a suitable characteristic and client configuration; neither is automatically available for every value. Module 4 will explore their timing and behavior in depth.
See a real discovery listing
BleuIO’s documented AT+GETSERVICES command rediscovers a connected peripheral’s services and characteristics. Its reference shows lines such as 0001 serv 0x1800, 0002 char 0x1800 prop=0a (-R-W----), and 0003 ---- 0x2a00. In that documented listing, 0001, 0002, and 0003 are handles; 0x1800 identifies the GAP service; and 0x2A00 identifies the Device Name characteristic value. The char line reports properties, while the next line is the value entry.
That listing is from BleuIO’s command reference. A real device can have different handles, services, and security requirements. Watch the HibouAir service discovery and read demonstration, then use the guided lab there to inspect your own peripheral.
Explore the hierarchy
Open the entries below. The static descriptions remain available even if JavaScript is disabled.
Service · groups a function
A service declaration gives a group of characteristics a purpose, such as battery information. A server can expose several services.
Characteristic · describes a value or control
The declaration gives the value UUID, properties, and value handle. The value attribute holds the bytes a client may access if allowed.
Descriptor · adds optional information or configuration
A Client Characteristic Configuration descriptor can let a client enable notifications or indications where the characteristic supports them.
Check your understanding
A connected app knows a service UUID but not the attribute handles on this sensor. What should it do first?
Key takeaways
- GATT gives connected BLE data a discoverable service and characteristic structure.
- A server holds attributes; a client discovers and requests permitted operations through ATT.
- Handles locate entries in one database, while UUIDs identify types.
Further Reading and Resources
Save your progress in this browser.