Non-blocking example of the LWIPInterface
Dependencies: LWIPInterface NetworkSocketAPI mbed-rtos mbed
Non-blocking example for the NetworkSocketAPI. Attempts to get the device's public facing IP address from ifcfg.me using the Happy Eyeballs algorithm to fetch an IPv4 or IPv6 address.
Diff: main.cpp
- Revision:
- 11:b7e531a4d661
- Parent:
- 9:da5a230fa4f4
- Child:
- 14:c47437f5dae8
--- a/main.cpp Wed Jun 17 23:40:46 2015 +0000 +++ b/main.cpp Thu Jun 18 15:25:36 2015 +0000 @@ -52,7 +52,7 @@ //Socket socket; char buf[1024]; - wifi.connect(*wifi.endpoint); + wifi.open(*wifi.endpoint); wifi.recv(buf, 1024); wifi.send(buf, sizeof(buf)); wifi.close(*wifi.endpoint);