BLE
Outline
• BLE
•
Terminology
Term Generation Introduction
BR 1.1 (2002) Basic Rate (1 Mbps)
EDR 2.0 (2004) Enhanced Data Rate (2 -3 Mbps)
HS 3.0 (2009) High Speed (AMP: 24 Mbps)
LE 4.0 (2010) Low Energy (ultra low power:1
Mbps )
Bluetooth smart 4.0 Single mode
Bluetooth smart
ready
4.0 Dual mode
Classic
bluetoo
th
Introduction- Applications
Wireless headset,
printer,etc.
(Bulk data)
PCs, smartphones,etc.
(Communicate with smart & classic
bluetooth)
Remote control, heart
rate monitor,etc.
(Small data)
Protocol Stack
GATT: Generic Attribute Profile.
GAP: Generic Access Profile.
ATT: Attribute Protocol.
SMP: Security Manager.
L2CAP: Logical Link and Adaption
Protocol.
SIG Service (Profile)
Protocol Stack
GAP:
Device discovery.
Connection establishment.
Initiation of security features.
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
…
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)
Attribute Permission
• Read
• Mobile Attribute value
• Write
• Mobile Attribute value
• Notify
• Mobile Characteristic Descriptor 

( CCCD) 0x0100 = enable, 0x0000 = disable
• Characteristic value
Link-Layer State (Device)
Listen to advertising packets
Transmit advertising
packets
Listen to advertising
packets & respond to
initiate a connection
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
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
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
Outline
• BLE
•
• Activity BLE Device Scan
• Service BLE
• Activity UI BLE Service
Scan Device
In activity
Connect DeviceIn service
Discover Services (1/2)
In service
method
Discover Services (2/2)
In service
In activity
Service mBluetoothGatt Gatt
Set Notification (1/4)
In activity
Set Notification (2/4)
Descriptor UUID? app
Device CCCD UUID
<- ?
In service
Set Notification (3/4)
In service
http://stackoverflow.com/questions/17910322/android-ble-api-gatt-notification-not-received



@API LEVEL 18
Notify(1/4 )
Set Notification (4/4)
In service
Read ( notify read)

BLE短講