2. • Generic Attribute Profile (GATT)
• defines how to exchange user data (attributes) over a BLE connection
• Roles
• Client
• sends requests to a server
• performs Service Discovery
to know server’s attributes
• Server
• responds to requests
• stores user data
Generic Attribute Profile (GATT)
Request
Response
Client Server
3. • Handle
• 16-bit unique identifier
• 0x0001 – 0xFFFF
• Type
• UUID (Universal unique Identifier)
• 128-bit globally unique
• 32/16-bit SIG adopted
• xxxxxxxx-0000-1000-8000-00805F9B34FB
• Permission
• access rights: readable, writable, notifiable,
indicatable
• security level required to access: encryption,
authorization
• Value
• actual data content
• with variable length
• in format according to type
Attribute structure
Handle Type Permission Value
4. database / profile • Attribute
• There are 3 types of Attributes
• Primary Service
• Secondary Service
• Characteristic
• Attributes are grouped into Services
• Service Definition
• Service Declaration
• 0 or more Characteristics
• Characteristic Definition
• Characteristic Declaration
• Characteristic Value
• 0 or more Descriptors
• Extended Properties Descriptor
• Client Characteristic Configuration Descriptor (CCCD)
• Characteristic User Description Descriptor
Attribute data hierarchy
Characteristic
…
Descriptor
Service
Characteristic
…
Descriptor
Characteristic
…
Descriptor
Service
Characteristic
…
Descriptor
Characteristic
…
Descriptor
6. ATT database view in BlueNRG GUI
6
https://www.st.com/en/embedded-software/stsw-bnrgui.html
7. Handle Value
1 0x1801
2 0x2A05 0003 20
3 0xFFFF0000
4 0x0000
5 0x1800
6 0x2A00 0007 4E
7 0x74736574
8 0x2A01 0009 4E
9 0x0000
A 0x2A04 000B 02
B 0xFFFF0000 FFFFFFFF
ACI_GATT_Read_Handle_Value
7
Bits Field
7:0 0: Broadcast
1: Read
2: Write without Response
3: Write
4: Notify
5: Indicate
6: Authenticated Signed Writes
7: Extended Properties
23:8 Characteristic Value Handle
39:24 Characteristic UUID
8. • Bluetooth SIG
• Core Spec, Profiles, Assign Numbers
• https://www.bluetooth.com/specifications/specs/
• Intro to Bluetooth Generic Attribute Profile
• Mohammad Afaneh @ Ellisys
• https://www.bluetooth.com/bluetooth-resources/intro-to-bluetooth-gap-gatt/
• Introduction to Bluetooth Low Energy – GATT
• Kevin Townsend @ Adafruit
• https://learn.adafruit.com/introduction-to-bluetooth-low-energy/gatt
• Getting Started with Bluetooth Low Energy – GATT (Services and Characteristics)
• Kevin Townsend, Carles Cufí, Akiba, Robert Davidson
• https://www.oreilly.com/library/view/getting-started-with/9781491900550/ch04.html
References