Silicon Labs Page of 3 220
Table of Contents
1 Version History________________________________________________________________________ 4
2 Introduction to Bluegiga Bluetooth Smart Software _________ ____________________________________ 7
2.1 The Bluegiga Bluetooth Smart Stack ___________________________________________________ 7
2.2 The Bluegiga Bluetooth Smart SDK ____________________________________________________ 8
2.3 The BGAPITM Protocol _____________________________________________________________ 9
2.4 The BGLIBTM Host Library _________________________________________________________ 10
2.5 The BGScriptTM Scripting Language __________________________________________________ 11
2.6 The Profile ToolkitTM ______________________________________________________________ 12
3 API definition _________________________________________________________________________ 13
3.1 The BGAPI protocol definition _______ ________________________________________________ 13
3.1.1 Message types ____________________________________________________________ 13
3.1.2 Command Class IDs ________________________________________________________ 15
3.1.3 Packet Exchange __________________________________________________________ 15
3.2 The BGLIB functions definition _______________________________________________________ 19
3.3 The BGScript API definition _________________________________________________________ 20
3.4 Data Types _______________________________________________________________________ 21
4 API Reference ________________________________________________________________________ 22
4.1 Attribute Client ___________________________________________________________________ 23
4.1.1 Commands--attclient ________________________________________________________ 23
4.1.2 Enumerations--attclient
______________________________________________________ 46
4.1.3 Events--attclient ____________________________________________________________ 47
4.2 Attribute Database
________________________________________________________________ 53
4.2.1 Commands--attributes _______________________________________________________ 53
4.2.2 Enumerations--attributes
_____________________________________________________ 61
4.2.3 Events--attributes
__________________________________________________________ 63
4.3 Connection
______________________________________________________________________ 66
4.3.1 Commands--connection
_____________________________________________________ 66
4.3.2 Enumerations--connection
___________________________________________________ 76
4.3.3 Events--connection
_________________________________________________________ 77
4.4 Generic Access Profile
_____________________________________________________________ 81
4.4.1 Commands--gap
___________________________________________________________ 81
4.4.2 Enumerations--gap
________________________________________________________ 101
4.4.3 Events--gap
______________________________________________________________ 110
4.5 Hardware
______________________________________________________________________ 111
4.5.1 Commands--hardware ______________________________________________________ 111
4.5.2 Events--hardware
_________________________________________________________ 142
4.6 Persistent Store
_________________________________________________________________ 148
4.6.1 Commands--flash
_________________________________________________________ 148
4.6.2 Events--flash
_____________________________________________________________ 157
4.7 Security Manager
________________________________________________________________ 158
4.7.1 Commands--sm ___________________________________________________________ 158
4.7.2 Enumerations--sm
_________________________________________________________ 169
4.7.3 Events--sm
______________________________________________________________ 172
4.8 System
________________________________________________________________________ 176
4.8.1 Commands--system
_______________________________________________________ 176
4.8.2 Enumerations--system
_____________________________________________________ 194
4.8.3 Events--system
___________________________________________________________ 195
4.9 Testing
________________________________________________________________________ 202
4.9.1 Commands--test
__________________________________________________________ 202
4.10 Device Firmware Upgrade
________________________________________________________ 208
4.10.1 Commands--dfu __________________________________________________________ 208
4.10.2 Events--dfu
_____________________________________________________________ 213
4.11 Error Codes
___________________________________________________________________ 214
4.11.1 BGAPI Errors ____________________________________________________________ 214
4.11.2 Bluetooth Errors
_________________________________________________________ 215
4.11.3 Security Manager Protocol Errors
____________________________________________ 217
4.11.4 Attribute Protocol Errors
___________________________________________________ 218