CLI example for NNN50
Dependencies: NNN50_WIFI_API
Fork of NNN50_WiFi_HelloWorld by
Revision 3:9bd3e863e15b, committed 2017-04-02
- Comitter:
- tsungta
- Date:
- Sun Apr 02 10:16:20 2017 +0000
- Parent:
- 2:92946804ed6f
- Child:
- 4:11b81280c65b
- Commit message:
- Revise main to fix bug (empty getIPAddress, etc); Update NNN50_WIFI_API to revision 18 (revision 20 have bug)
Changed in this revision
| NNN50_WIFI_API.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/NNN50_WIFI_API.lib Mon Dec 19 03:56:13 2016 +0000 +++ b/NNN50_WIFI_API.lib Sun Apr 02 10:16:20 2017 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/Delta/code/NNN50_WIFI_API/#752e003bb0bc +https://developer.mbed.org/teams/Delta/code/NNN50_WIFI_API/#eb59b255b9e3
--- a/main.cpp Mon Dec 19 03:56:13 2016 +0000
+++ b/main.cpp Sun Apr 02 10:16:20 2017 +0000
@@ -32,22 +32,24 @@
WIFIDevice wifi;
uart.baud(9600);
-
+
eth.init();
- uart.printf("MAC: %s\n", eth.getMACAddress());
wifi.apScan(scanCallback);
wifi.setNetwork(M2M_WIFI_SEC_WPA_PSK, "TP-LINK_2.4G_TTWU", "0972753720");
- eth.connect();
- printf("IP: %s\n", eth.getIPAddress());
- printf("Gateway: %s\n", eth.getGateway());
- printf("NetworkMask: %s\n", eth.getNetworkMask());
+
+ eth.connect();
if(wifi.is_AP_connected())
uart.printf("Connect Success! \n");
else
- uart.printf("Connect Fail! \n");
+ uart.printf("Connect Fail! \n");
+
+ uart.printf("MAC: %s\n", eth.getMACAddress());
+ uart.printf("IP: %s\n", eth.getIPAddress());
+ uart.printf("Gateway: %s\n", eth.getGateway());
+ uart.printf("NetworkMask: %s\n", eth.getNetworkMask());
UDPSocket sock;
sock.init();
