Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SocketModem mbed
Fork of MTS_Wifi_Connect_Example by
Revision 8:fa93a2d07116, committed 2014-01-04
- Comitter:
- mfiore
- Date:
- Sat Jan 04 21:37:02 2014 +0000
- Parent:
- 7:25269711fb2c
- Child:
- 9:b8765986190f
- Commit message:
- put Wifi::Connect call in loop for robustness
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Jan 04 21:12:06 2014 +0000 +++ b/main.cpp Sat Jan 04 21:37:02 2014 +0000 @@ -33,7 +33,11 @@ //Setup and check connection printf("Set Network: %s\n\r", getCodeNames(wifi->setNetwork(ssid, securityType, securityKey)).c_str()); printf("Set DHCP: %s\n\r", getCodeNames(wifi->setDeviceIP("DHCP")).c_str()); - printf("Connect: %s\n\r", wifi->connect() ? "Success" : "Failure"); + while (! wifi->connect()) { + printf("Connect: Failure\r\n"); + wait(1); + } + printf("Connect: Success\r\n"); printf("Is Connected: %s\n\r", wifi->isConnected() ? "True" : "False"); //Ping