|
4 | 4 |
|
5 | 5 | The WifiInterface provides a simple C++ API for connecting to the internet over a Wi-Fi device.
|
6 | 6 |
|
7 |
| -There are multiple [Wi-Fi components](https://os.mbed.com/components/cat/wifi/) that implement the WiFiInterface class. The example below uses the [ESP8266Interface](https://github.com/armmbed/esp8266-driver) and |
8 |
| -[OdinWiFiInterface](https://github.com/u-blox/ublox-odin-w2-drivers-docs-mbed-5). |
9 |
| - |
10 |
| -ESP8266Interface uses AT commands over serial interface to connect to external Wi-Fi device. OdinWiFiInterface provides Ethernet like driver to Mbed OS network stack. Network stack uses the driver to connect to Wi-Fi. |
11 |
| - |
12 | 7 | ### Wi-Fi class reference
|
13 | 8 |
|
14 | 9 | [](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/class_wi_fi_interface.html)
|
15 | 10 |
|
16 | 11 | ### Usage
|
17 | 12 |
|
18 |
| -To bring up the network interface of external Wi-Fi device (for example, the ESP8266Interface): |
| 13 | +To bring up the network interface of an external Wi-Fi device (for example, the ESP8266Interface): |
19 | 14 |
|
20 | 15 | 1. Instantiate an implementation of the WiFiInterface class.
|
21 |
| - 1. Initialises AT command parser. |
| 16 | + 1. Initialize the AT command parser. |
22 | 17 | 1. Call the `connect` function with an SSID and password for the Wi-Fi network.
|
23 |
| - 1. Commands Wi-Fi device to connect to network. |
24 |
| -1. Once connected, the WiFiInterface can be used as a target for opening [network sockets](/docs/development/reference/network-socket.html). |
| 18 | + 1. Command the Wi-Fi device to connect to network. |
| 19 | +1. Once connected, you can use the WiFiInterface as a target for opening [network sockets](/docs/development/reference/network-socket.html). |
25 | 20 |
|
26 |
| -To bring up the network interface of Ethernet like driver (for example, the OdinWiFiInterface): |
| 21 | +To bring up the network interface of an Ethernet-like driver (for example, the OdinWiFiInterface): |
27 | 22 |
|
28 | 23 | 1. Instantiate an implementation of the WiFiInterface class.
|
29 |
| - 1. Initialises Wifi driver for the target. |
30 |
| - 1. Initialises network stack (LWIP). |
| 24 | + 1. Initialize the Wi-Fi driver for the target. |
| 25 | + 1. Initialize network stack (LWIP). |
31 | 26 | 1. Call the `connect` function with an SSID and password for the Wi-Fi network.
|
32 |
| - 1. Wi-Fi driver connects to Wi-Fi network. |
33 |
| - 2. Network stack accuires IP address and DNS server address. |
34 |
| - |
35 |
| -1. Once connected, the WiFiInterface can be used as a target for opening [network sockets](/docs/development/reference/network-socket.html). |
| 27 | + 1. Connect the Wi-Fi driver to the Wi-Fi network. |
| 28 | + 2. Ensure the network stack acquires the IP address and DNS server address. |
| 29 | +1. Once connected, you can use the WiFiInterface as a target for opening [network sockets](/docs/development/reference/network-socket.html). |
36 | 30 |
|
37 | 31 | ### Troubleshooting information
|
38 | 32 |
|
39 | 33 | Network interface `connect` failure reasons:
|
40 |
| -1. Check that SSID and password are correct. |
| 34 | + |
| 35 | +1. Check that the SSID and password are correct. |
41 | 36 | 1. Check that the IP address configuration service is working.
|
42 | 37 |
|
43 | 38 | ### Wi-Fi example
|
44 | 39 |
|
45 |
| -Here is an example of an HTTP client program. The program brings up an ESP8266 as the underlying network interface, and uses it to perform an HTTP transaction over a TCPSocket: |
| 40 | +Here is an example of an HTTP client program. The program brings up an ESP8266 as the underlying network interface, and uses it to perform an HTTP transaction over a TCPSocket. There are multiple [Wi-Fi components](https://os.mbed.com/components/cat/wifi/) that implement the WiFiInterface class. The example below uses the [ESP8266Interface](https://github.com/armmbed/esp8266-driver) and [OdinWiFiInterface](https://github.com/u-blox/ublox-odin-w2-drivers-docs-mbed-5). |
| 41 | + |
| 42 | +The ESP8266Interface uses AT commands over serial interface to connect to an external Wi-Fi device. The OdinWiFiInterface provides an Ethernet-like driver to the Mbed OS network stack. The network stack uses the driver to connect to Wi-Fi: |
46 | 43 |
|
47 | 44 | [](https://os.mbed.com/teams/mbed_example/code/TCPSocketWiFi_Example/file/6a4e57edc2b2/main.cpp)
|
48 | 45 |
|
|
0 commit comments