silabs.com | Building a more connected world. Page 5
R
R
S
S
9
9
1
1
1
1
3
3
-
-
W
W
i
i
S
S
e
e
C
C
o
o
n
n
n
n
e
e
c
c
t
t
T
T
M
M
B
B
l
l
u
u
e
e
t
t
o
o
o
o
t
t
h
h
L
L
o
o
w
w
E
E
n
n
e
e
r
r
g
g
y
y
S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e
P
P
r
r
o
o
g
g
r
r
a
a
m
m
m
m
i
i
n
n
g
g
R
R
e
e
f
f
e
e
r
r
e
e
n
n
c
c
e
e
M
M
a
a
n
n
u
u
a
a
l
l
V
V
e
e
r
r
s
s
i
i
o
o
n
n
1
1
.
.
7
7
.
.
9
9
E
E
r
r
r
r
o
o
r
r
!
!
N
N
o
o
t
t
e
e
x
x
t
t
o
o
f
f
s
s
p
p
e
e
c
c
i
i
f
f
i
i
e
e
d
d
s
s
t
t
y
y
l
l
e
e
i
i
n
n
d
d
o
o
c
c
u
u
m
m
e
e
n
n
t
t
.
.
2.4.2.22 LE LTK Request Reply ................................................................................................ 53
2.4.2.23 SMP Reject Response ............................................................................................... 53
2.4.3 BLE GATT Profile commands ............................................................................................ 55
2.4.3.1 Query profiles list ......................................................................................................... 55
2.4.3.2 Query Profile................................................................................................................ 56
2.4.3.3 Query Characteristic Services ....................................................................................... 57
2.4.3.4 Query Include Services ................................................................................................. 59
2.4.3.5 Read Characteristic Value by UUID ............................................................................... 61
2.4.3.6 Query Attribute............................................................................................................ 62
2.4.3.7 Query Attribute Value .................................................................................................. 63
2.4.3.8 Query Multiple Attribute Values ................................................................................... 64
2.4.3.9 Query Long Attribute Value .......................................................................................... 65
2.4.3.10 Set Attribute Value .................................................................................................. 66
2.4.3.11 Set Attribute Value no Ack ........................................................................................ 67
2.4.3.12 Set Long Attribute Value .......................................................................................... 67
2.4.3.13 Set Prepare Long Attribute Value ............................................................................. 68
2.4.3.14 Execute Long Attribute Value ................................................................................... 69
2.4.4 BLE Create New Service Commands ................................................................................. 69
2.4.4.1 Add GATT Service Record ............................................................................................. 69
2.4.4.2 Add Attribute Record ................................................................................................... 71
2.4.4.3 Set Local Attribute Value .............................................................................................. 72
2.4.4.4 Get Local Attribute Value ............................................................................................. 72
2.4.5 BLE Core Events ............................................................................................................... 73
2.4.5.1 Advertise Report Event ................................................................................................ 73
2.4.5.2 Connection Complete Event ......................................................................................... 74
2.4.5.3 Disconnected ............................................................................................................... 75
2.4.5.4 SMP Request Event ...................................................................................................... 75
2.4.5.5 SMP Response Event .................................................................................................... 75
2.4.5.6 SMP Passkey Event....................................................................................................... 76
2.4.5.7 SMP Passkey Display Event........................................................................................... 76
2.4.5.8 SMP Failed Event ......................................................................................................... 77
2.4.5.9 SMP Encrypt Enabled Event.......................................................................................... 77
2.4.5.10 LE ping payload timeout ........................................................................................... 78
2.4.5.11 LE MTU Size.............................................................................................................. 78
2.4.5.12 LE LTK Request Event................................................................................................ 79
2.4.6 BLE GATT Events .............................................................................................................. 79
2.4.6.1 GATT Notification ......................................................................................................... 79
2.4.6.2 GATT Indication ........................................................................................................... 80
2.4.6.3 GATT Write .................................................................................................................. 80
2.4.6.4 GATT READ /Blob Read Request ................................................................................... 81
2.5 Bluetooth Generic Error Codes ................................................................................... 81
2.6 BLE Mode Error Codes ................................................................................................ 83
2.7 Power Save ................................................................................................................. 85
2.7.1 Power Save Operations .................................................................................................... 85
2.7.1.1 Power Save Mode 0 ..................................................................................................... 85
2.7.1.2 Power Save Mode 2 (GPIO based mode)....................................................................... 85
2.7.1.3 Power Save Mode 3 (Message based mode) ................................................................. 85
2.7.1.4 Power Save Mode 8 (GPIO based mode)....................................................................... 86
2.7.1.5 Power Save Mode 9 (Message based mode) ................................................................. 86
3 Bluetooth API Library ............................................................................................. 87
3.1 API File Organization .................................................................................................. 87
3.2 API Prototypes ............................................................................................................ 87