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 _____________________________________________________________ 10
2.4 Bluegiga BGScript scripting language _________________________________________________ 11
3 Understanding Endpoints _______________________________________________________________ 12
3.1 Predefined Endpoints ______________________________________________________________ 13
4 API Definition -- Wi-Fi __________________________________________________________________ 14
4.1 BGAPI protocol definition -- Wi-Fi _____________________________________________________ 14
4.1.1 Packet format _____________________________________________________________ 14
4.1.2 Message types ____________________________________________________________ 14
4.1.3 Command Class IDs ________________________________________________________ 15
4.1.4 Packet Exchange __________________________________________________________ 15
4.1.5 Introduction to BGAPI over SPI ________________________________________________ 16
4.2 BGLIB functions definition -- Wi-Fi ____________________________________________________ 16
4.3 BGScript API definition -- Wi-Fi ______________________________________________________ 18
4.4 Data types -- Wi-Fi ________________________________________________________________ 19
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 ________________________________________________________ 63
5.4 TCP stack--Wi-Fi _________________________________________________________________ 86
5.4.1 Commands--TCP/IP--Wi-Fi ___________________________________________________ 86
5.4.2 Events--TCP/IP--Wi-Fi ______________________________________________________ 111
5.5 Endpoint--Wi-Fi __________________________________________________________________ 122
5.5.1 Commands--endpoint--Wi-Fi _________________________________________________ 122
5.5.2 Events--endpoint--Wi-Fi ____________________________________________________ 132
5.5.3 Enumerations--endpoint--Wi-Fi _______________________________________________ 137
5.6 Hardware--Wi-Fi _________________________________________________________________ 138
5.6.1 Commands--hardware--Wi-Fi ________________________________________________ 138
5.6.2 Enumerations--hardware--Wi-Fi ______________________________________________ 167
5.6.3 Events--hardware--Wi-Fi ____________________________________________________ 168
5.7 I2C--Wi-Fi ______________________________________________________________________ 173
5.7.1 Commands--I2C--Wi-Fi _____________________________________________________ 173
5.8 Wired Ethernet--Wi-Fi _____________________________________________________________ 177
5.8.1 Commands--Ethernet--Wi-Fi _________________________________________________ 177
5.8.2 Events--Ethernet--Wi-Fi _____________________________________________________ 181
5.9 HTTP Server--Wi-Fi ______________________________________________________________ 182
5.9.1 Commands--HTTPS--Wi-Fi __________________________________________________ 182
5.9.2 Events--HTTPS--Wi-Fi _____________________________________________________ 188
5.10 Persistent Store--Wi-Fi ___________________________________________________________ 192
5.10.1 Commands--Flash--Wi-Fi __________________________________________________ 192
5.10.2 Enumerations--Flash--Wi-Fi ________________________________________________ 199
5.10.3 Events--Flash--Wi-Fi ______________________________________________________ 201
5.11 Device Firmware Upgrade--Wi-Fi ___________________________________________________ 204
5.11.1 Commands--DFU--Wi-Fi ___________________________________________________ 204
5.11.2 Events--DFU--Wi-Fi _______________________________________________________ 208
5.12 Utilities for BGScript--Wi-Fi ________________________________________________________ 209
5.12.1 Commands--Util--Wi-Fi ____________________________________________________ 209
5.13 SD card--Wi-Fi _________________________________________________________________ 211
5.13.1 Commands--SDHC--Wi-Fi __________________________________________________ 211