7. Protocol Stack
• GATT: It defines the framework
that uses the ATT to service
discovery, read , write and
exchange values data transferred
from one device to another.
• ATT table organization:
Service->Characteristics-
>Attributes
ATT table
Service 1
Cha
r.
Att
r.
Att
r.
Cha
r.
Att
r.
Att
r.
Cha
r.
Att
r.
Att
r.
Service 2
…
8. Service Organization
Column
Handle: Index of attribute table (Identify attribute in Firmware)
UUID: Identify type in each row
Permissions: Data R/W permission
Value: Info. (value) of one attribute
Row attribute UUID
Service: Characteristic (1…N)
Characteristic attribute (1…N)
Characteristic Descriptor (0…N)
9. Attribute Permission
• Read
• Mobile Attribute value
• Write
• Mobile Attribute value
• Notify
• Mobile Characteristic Descriptor
( CCCD) 0x0100 = enable, 0x0000 = disable
• Characteristic value
10. Link-Layer State (Device)
Listen to advertising packets
Transmit advertising
packets
Listen to advertising
packets & respond to
initiate a connection
11. Advertising Sequence
Device Radio Scanner
Set advertisement data
Set local bluetooth
address
Start advertising
ADV packet
ADV packet
ADV packet
BLE_GAP_EVT_TIMEO
UT
Case 1:Timeout
12. Connection Sequence
Device Radio Mobile
Connection
request
BLE_GAP_EVT_DISCONNECT
ED
BLE_GAP_EVT_CONNECT
ED
Connection
termination
Advertisement
Case 1:Disconnection
Connection establishment
13. Service Discovery
Sequence
Device Radio Mobile
ATT write request
BLE_GATT_EVT_WRITE
ATT write
responseSend heart rate &
battery
data packet
ATT packet sending
ATT table
Heart rate service
Battery service
21. Set Notification (3/4)
In service
http://stackoverflow.com/questions/17910322/android-ble-api-gatt-notification-not-received
@API LEVEL 18
Notify(1/4 )