Table of Contents
1 Version History - WF121 SW API __________________________________________________________ 5
2 Introduction to Bluegiga Wi-Fi software ______________________________________________________ 7
2.1 Bluegiga Wi-Fi Stack _______________________________________________________________ 7
2.2 Bluegiga BGAPI protocol ____________________________________________________________ 8
2.3 Bluegiga BGLib library ______________________________________________________________ 9
2.4 Bluegiga BGScript scripting language _________________________________________________ 10
3 Understanding Endpoints _______________________________________________________________ 11
3.1 Predefined Endpoints ______________________________________________________________ 12
4 API Definition -- Wi-Fi __________________________________________________________________ 13
4.1 BGAPI protocol definition -- Wi-Fi _____________________________________________________ 13
4.1.1 Packet format _____________________________________________________________ 13
4.1.2 Message types ____________________________________________________________ 13
4.1.3 Command Class IDs ________________________________________________________ 14
4.1.4 Packet Exchange __________________________________________________________ 14
4.1.5 Introduction to BGAPI over SPI ________________________________________________ 15
4.2 BGLIB functions definition -- Wi-Fi ____________________________________________________ 16
4.3 BGScript API definition -- Wi-Fi ______________________________________________________ 17
4.4 Data types -- Wi-Fi ________________________________________________________________ 18
5 API Reference -- Wi-Fi _________________________________________________________________ 20
5.1 System--Wi-Fi ____________________________________________________________________ 21
5.1.1 Commands--system--Wi-Fi ___________________________________________________ 21
5.1.2 Events--system--Wi-Fi _______________________________________________________ 27
5.2 Configuration--Wi-Fi _______________________________________________________________ 30
5.2.1 Commands--config--Wi-Fi ____________________________________________________ 30
5.2.2 Events--config--Wi-Fi ________________________________________________________ 33
5.3 Wi-Fi--Wi-Fi _____________________________________________________________________ 34
5.3.1 Commands--SME--Wi-Fi _____________________________________________________ 34
5.3.2 Events--SME--Wi-Fi ________________________________________________________ 65
5.4 TCP stack--Wi-Fi _________________________________________________________________ 88
5.4.1 Commands--TCP/IP--Wi-Fi ___________________________________________________ 88
5.4.2 Events--TCP/IP--Wi-Fi ______________________________________________________ 117
5.5 Endpoint--Wi-Fi __________________________________________________________________ 130
5.5.1 Commands--endpoint--Wi-Fi _________________________________________________ 130
5.5.2 Events--endpoint--Wi-Fi ____________________________________________________ 141
5.5.3 Enumerations--endpoint--Wi-Fi _______________________________________________ 146
5.6 Hardware--Wi-Fi _________________________________________________________________ 147
5.6.1 Commands--hardware--Wi-Fi ________________________________________________ 147
5.6.2 Enumerations--hardware--Wi-Fi ______________________________________________ 175
5.6.3 Events--hardware--Wi-Fi ____________________________________________________ 176
5.7 I2C--Wi-Fi ______________________________________________________________________ 181
5.7.1 Commands--I2C--Wi-Fi _____________________________________________________ 181
5.8 Wired Ethernet--Wi-Fi _____________________________________________________________ 185
5.8.1 Commands--Ethernet--Wi-Fi _________________________________________________ 185
5.8.2 Events--Ethernet--Wi-Fi _____________________________________________________ 189
5.9 HTTP Server--Wi-Fi ______________________________________________________________ 190
5.9.1 Commands--HTTPS--Wi-Fi __________________________________________________ 190
5.9.2 Events--HTTPS--Wi-Fi _____________________________________________________ 195
5.10 Persistent Store--Wi-Fi ___________________________________________________________ 199
5.10.1 Commands--Flash--Wi-Fi __________________________________________________ 199
5.10.2 Enumerations--Flash--Wi-Fi ________________________________________________ 207
5.10.3 Events--Flash--Wi-Fi ______________________________________________________ 209
5.11 Device Firmware Upgrade--Wi-Fi ___________________________________________________ 212
5.11.1 Commands--DFU--Wi-Fi ___________________________________________________ 212
5.11.2 Events--DFU--Wi-Fi _______________________________________________________ 216
5.12 Utilities for BGScript--Wi-Fi ________________________________________________________ 217
5.12.1 Commands--Util--Wi-Fi ____________________________________________________ 217
5.13 SD card--Wi-Fi _________________________________________________________________ 219
5.13.1 Commands--SDHC--Wi-Fi __________________________________________________ 219