CE_Test_UDP add mult-AP setting

Dependencies:   NNN50_WIFI_API mbed

Fork of NNN50_CE_Test_UDP by Tsungta Wu

Revision:
4:da5d554dae5a
Parent:
3:ad0fd3c1247f
--- a/main.cpp	Thu Mar 02 10:20:15 2017 +0000
+++ b/main.cpp	Thu Mar 09 10:09:44 2017 +0000
@@ -15,8 +15,17 @@
 #include "EthernetInterface.h"
 #include "WIFIDevice.h"
 
-const char* ECHO_SERVER_ADDRESS = "172.20.10.3";
-const int ECHO_SERVER_PORT = 1030;
+#if 1
+const char* ECHO_SERVER_ADDRESS = "192.168.100.2";
+char* AP_SSID = "HAME_A2_a5d1";
+char* PASSWD  = "12345678";
+const int ECHO_SERVER_PORT = 5001;
+#else
+const char* ECHO_SERVER_ADDRESS = "172.20.10.4";
+char* AP_SSID = "Gaan";
+char* PASSWD  = "12348888";
+const int ECHO_SERVER_PORT = 5001;
+#endif
 
 Serial uart(p17, p16);//temporary define for alpha release
 
@@ -30,7 +39,9 @@
     eth.init();
     uart.printf("MAC: %s\n", eth.getMACAddress());
 
-    wifi.setNetwork(M2M_WIFI_SEC_WPA_PSK, "Tsungta_iPhone", "icq87001"); 
+    //wifi.setNetwork(M2M_WIFI_SEC_WPA_PSK, "Tsungta_iPhone", "icq87001"); 
+    //wifi.setNetwork(M2M_WIFI_SEC_WPA_PSK, "Gaan", "12348888"); 
+    wifi.setNetwork(M2M_WIFI_SEC_WPA_PSK, AP_SSID, PASSWD);
     
     eth.connect();
     printf("IP: %s\n", eth.getIPAddress());