Table of Contents
1 Version History - WF121 SW API __________________________________________________________ 4
2 Introduction to Bluegiga Wi-Fi software ______________________________________________________ 5
2.1 Bluegiga Wi-Fi Stack ________________________________________________________________ 5
2.2 Bluegiga BGAPI protocol _____________________________________________________________ 6
2.3 Bluegiga BGLib library _______________________________________________________________ 8
2.4 Bluegiga BGScript scripting language ___________________________________________________ 9
3 Understanding Endpoints _______________________________________________________________ 10
3.1 Predefined Endpoints ______________________________________________________________ 11
4 API Definition -- WIFI ___________________________________________________________________ 12
4.1 BGAPI protocol definition -- WIFI _____________________________________________________ 12
4.1.1 Packet format _______________________________________________________________ 12
4.1.2 Message types ______________________________________________________________ 12
4.1.3 Command Class IDs _________________________________________________________ 13
4.1.4 Packet Exchange ____________________________________________________________ 13
4.1.5 Introduction to BGAPI over SPI _________________________________________________ 14
4.2 BGLIB functions definition -- WIFI _____________________________________________________ 14
4.3 BGScript API definition -- WIFI _______________________________________________________ 16
4.4 Data types -- WIFI _________________________________________________________________ 17
5 API Reference -- WIFI __________________________________________________________________ 18
5.1 System--WIFI ____________________________________________________________________ 19
5.1.1 Commands--system--WIFI _____________________________________________________ 19
5.1.2 Events--system--WIFI ________________________________________________________ 23
5.2 Configuration--WIFI ________________________________________________________________ 26
5.2.1 Commands--config--WIFI ______________________________________________________ 26
5.2.2 Events--config--WIFI _________________________________________________________ 29
5.3 Wi-Fi--WIFI ______________________________________________________________________ 30
5.3.1 Commands--sme--WIFI _______________________________________________________ 30
5.3.2 Events--sme--WIFI ___________________________________________________________ 56
5.4 TCP stack--WIFI __________________________________________________________________ 79
5.4.1 Commands--tcpip--WIFI _______________________________________________________ 79
5.4.2 Events--tcpip--WIFI __________________________________________________________ 93
5.5 Endpoint--WIFI ___________________________________________________________________ 98
5.5.1 Commands--endpoint--WIFI ____________________________________________________ 98
5.5.2 Events--endpoint--WIFI ______________________________________________________ 107
5.5.3 Enumerations--endpoint--WIFI _________________________________________________ 112
5.6 Hardware--WIFI __________________________________________________________________ 113
5.6.1 Commands--hardware--WIFI __________________________________________________ 113
5.6.2 Enumerations--hardware--WIFI ________________________________________________ 139
5.6.3 Events--hardware--WIFI ______________________________________________________ 140
5.7 I2C--WIFI _______________________________________________________________________ 143
5.7.1 Commands--i2c--WIFI _______________________________________________________ 143
5.8 Wired Ethernet--WIFI _____________________________________________________________ 147
5.8.1 Commands--ethernet--WIFI ___________________________________________________ 147
5.8.2 Events--ethernet--WIFI _______________________________________________________ 150
5.9 HTTP Server--WIFI _______________________________________________________________ 151
5.9.1 Commands--https--WIFI ______________________________________________________ 151
5.9.2 Events--https--WIFI _________________________________________________________ 153
5.10 Persistent Store--WIFI _____________________________________________________________ 155
5.10.1 Commands--flash--WIFI ______________________________________________________ 155
5.10.2 Enumerations--flash--WIFI ____________________________________________________ 162
5.10.3 Events--flash--WIFI _________________________________________________________ 164
5.11 Device Firmware Upgrade--WIFI _____________________________________________________ 166
5.11.1 Commands--dfu--WIFI _______________________________________________________ 166
5.11.2 Events--dfu--WIFI ___________________________________________________________ 170
5.12 Error codes -- WIFI _______________________________________________________________ 171
5.12.1 BGAPI Errors--WIFI _________________________________________________________ 171
5.12.2 Hardware Errors--WIFI _______________________________________________________ 172
5.12.3 TCP IP Errors--WIFI _________________________________________________________ 172