Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 2.45 KB

File metadata and controls

32 lines (19 loc) · 2.45 KB

u-blox Wi-Fi driver

The Wi-Fi driver provides functionality to initialize, configure and manage a Wireless LAN connection using the ODIN-W2 module. A supplicant is included to enable authentication and encryption handling.

The Wi-Fi support conforms to IEEE 802.11a/b/g/n and has dual-band 2.4 GHz and 5GHz operation. The driver can either operate as a Station or an Access Point.

The Wi-Fi driver is typically used together with a TCP/IP stack. For Arm Mbed OS 5 the OdinWiFiInterface class uses the included IP-stack.

The following chapters describes the usage with the C API. For the C++ API see header files and example in mbed-os.

General initialization

The Wi-Fi driver is initialized with a call to cbMAIN_initWlan. Note that cbWLAN_init must not be called since this is done from inside cbMAIN_initWlan.

In order to get status updates it's necessary to register via the cbWLAN_registerStatusCallback function.

Once the driver has been initialized and a status handler been registered it can be started with cbMAIN_startWlan. When starting is finished a status event/callback is received.

If the driver is not intended to be in use any more it is wise to stop it with cbWLAN_stop to lower power consumption.

For the OdinWiFiInterface class all of the functions above is done in the constructor and destructor.

Station mode

The station mode is entered by calling any of the cbWLAN_connectXXX functions. Whenever a connection is dropped the application will be notified and the driver will re-connect until a connection is re-established. The connection can be cancelled or terminated by calling cbWLAN_disconnect.

Although a scan is not necessary prior to a connection establishment it might be required if full information about the access point is needed.

802.11r (over the DS/AIR)

Roaming capability is always turned on while working in station mode. If an access point is 802.11r supported, connection between station and access point will be established using this feature by default. Connections with access points that do not support 802.11r will be established without using this roaming capability.

Acess Point (Pending release)

The AP mode requires macro DEVICE_WIFI_AP to be defined in mbed_app.json . To enter AP mode ap_start should be called. To stop the AP mode ap_stop needs to be called. A public example for AP is available here.