NNN40_WiFi_Demo

Dependencies:   WIFI_API_32kRAM mbed

Fork of NNN40_WiFi by Delta

Files at this revision

API Documentation at this revision

Comitter:
gordonlu
Date:
Thu Aug 20 02:54:14 2015 +0000
Parent:
10:fff1a8a4b003
Commit message:
NNN40_WIFI_DEMO_1 (32?RAM)

Changed in this revision

WIFI_API.lib Show diff for this revision Revisions of this file
WIFI_API_32kRAM.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
mbed-src.lib Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r fff1a8a4b003 -r 0d4c4bc2274a WIFI_API.lib
--- a/WIFI_API.lib	Thu Jul 02 03:10:05 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://developer.mbed.org/users/Marcomissyou/code/WIFI_API/#a2de37bf5f3d
diff -r fff1a8a4b003 -r 0d4c4bc2274a WIFI_API_32kRAM.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WIFI_API_32kRAM.lib	Thu Aug 20 02:54:14 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Delta/code/WIFI_API_32kRAM/#1cc76b1199e6
diff -r fff1a8a4b003 -r 0d4c4bc2274a main.cpp
--- a/main.cpp	Thu Jul 02 03:10:05 2015 +0000
+++ b/main.cpp	Thu Aug 20 02:54:14 2015 +0000
@@ -10,77 +10,69 @@
 
 DigitalOut LED01(p13);
 DigitalOut LED02(p7);
+Serial pc(USBTX, USBRX);//debug port , 9600
 
 
 int main(void)
 {   
-
+      
     EthernetInterface eth;
     eth.init(); //Use DHCP
     wait(1);
-    DPRINT(N_ERR, "Hello World, NNN40_WiFi\n");
+    printf( "Hello World, NNN40_WiFi\n");
     // set given SSID and PW as the highest priority  
     //wifi.setNetwork("KORYO-Guest", "koryo123", 0);
-    wifi.setNetwork("Gordon Airport Network", "password", 0);
+    wifi.setNetwork("Airport123", "12345678", 0);
     wait(1);
    
     eth.connect(40000);
-    DPRINT(N_ERR, "****IP Address:%s\n",eth.getIPAddress());
-    DPRINT(N_ERR, "****MAC Address:%s\n",eth.getMACAddress());
+    printf("****IP Address:%s\n",eth.getIPAddress());
+    printf("****MAC Address:%s\n",eth.getMACAddress());
 
-    LED01 = 1;
-    TCPSocketConnection socket1;     
+  
+    
+    TCPSocketConnection socket1; 
+    printf("Connect to %s:%d\n",PC_SERVER_ADDRESS_1,PC_PORT);    
     if(0 == socket1.connect(PC_SERVER_ADDRESS_1,PC_PORT))
     {
-         
-         DPRINT(N_ERR, "****socket1 connect ok!!!\n");
+         LED01 = 1;
+         printf("****socket1 connect ok!!!\n");
     }
     else
     {
-        DPRINT(N_ERR, "****socket connect1 failed !!\n");
+        printf("****socket connect1 failed !!\n");
     }
    
-    TCPSocketConnection socket2;     
+    TCPSocketConnection socket2;   
+    printf("Connect to %s:%d\n",PC_SERVER_ADDRESS_2,PC_PORT);     
     if(0 == socket2.connect(PC_SERVER_ADDRESS_2,PC_PORT))
     {
          
          LED02 = 1;
-         DPRINT(N_ERR, "****socket2 connect ok!!!\n");
+         printf("****socket2 connect ok!!!\n");
     }
     else
     {
-        DPRINT(N_ERR, "****socke2 connect failed !!\n");
+        printf("****socke2 connect failed !!\n");
     }
    
     char msg[] = "Hello World";
     char buf[1024];
-    //socket.send(msg, sizeof(msg));
-
-    /*
-    if(socket.receive(rx, sizeof(msg)) != -1)
-    {
-         DPRINT(N_ERR, "****RX data :%s\n",&rx[0]);
-    }
-    else
-    {
-         DPRINT(N_ERR, "****RX error\n");
-    }
-    */
+    
     int i = 1;
     while(1)
     {
         wait(1);
         int j = sprintf(buf, "Hello World : %d\n",i);
-        DPRINT(N_ERR, "******************Send Message : %d \n", i++);
-        //socket.send(msg, sizeof(msg));   
+        printf("******************Send Message : %d \n", i++);
         socket1.send(buf, j);    
         socket2.send(buf, j);   
         
         if(i%2 == 0 )  LED02 = 1;
         else LED02 = 0; 
     }
-    DPRINT(N_ERR, "****socket close \n");
-    socket1.close();
+    printf("****socket close \n");
+    //socket1.close();
     //socket2.close();
     eth.disconnect();
     wifi.sleep();
diff -r fff1a8a4b003 -r 0d4c4bc2274a mbed-src.lib
--- a/mbed-src.lib	Thu Jul 02 03:10:05 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-src/#f7652ef73633
diff -r fff1a8a4b003 -r 0d4c4bc2274a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 20 02:54:14 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b9ad9a133dc7
\ No newline at end of file