CLI example for NNN50

Dependencies:   NNN50_WIFI_API

Fork of NNN50_WiFi_HelloWorld by Delta

Revision:
3:9bd3e863e15b
Parent:
2:92946804ed6f
Child:
4:11b81280c65b
--- 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();