HTTP server example program for WIZwiki-W7500

Dependencies:   WIZnetInterface SDFileSystem httpServer mbed-src

Fork of TCPEchoServer-WIZwiki-W7500 by WIZnet

This is HTTP server example program for WIZwiki-W7500.

In this example, only you can control RGB LED on/off.

Sample html pages and image are needed. So download samples.

  • index.html
  • dio_page.html
  • image

https://github.com/WIZnet-MbedEthernet/httpServer-WIZwiki-W7500

This example use SD card. So copy html and image files to SD card. If not WIZwiki-W7500 platform, copy html and image files to local filesystem.

There are Korean language in index.html

Files at this revision

API Documentation at this revision

Comitter:
mbedAustin
Date:
Mon May 04 22:47:02 2015 +0000
Parent:
6:5dae237341f7
Child:
8:f837e0d255e8
Commit message:
updated example code to be more verbose

Changed in this revision

EthernetInterface.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-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/EthernetInterface.lib	Tue Jun 04 16:07:06 2013 +0100
+++ b/EthernetInterface.lib	Mon May 04 22:47:02 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/EthernetInterface/
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/EthernetInterface/#2fc406e2553f
--- a/main.cpp	Tue Jun 04 16:07:06 2013 +0100
+++ b/main.cpp	Mon May 04 22:47:02 2015 +0000
@@ -7,7 +7,7 @@
     EthernetInterface eth;
     eth.init(); //Use DHCP
     eth.connect();
-    printf("IP Address is %s\n", eth.getIPAddress());
+    printf("\nServer IP Address is %s\n", eth.getIPAddress());
     
     TCPSocketServer server;
     server.bind(ECHO_SERVER_PORT);
@@ -25,6 +25,22 @@
             int n = client.receive(buffer, sizeof(buffer));
             if (n <= 0) break;
             
+            // print received message to terminal
+            buffer[n] = '\0';
+            printf("Received message from Client :'%s'\n",buffer);
+            
+            // reverse the message
+            char temp;
+            for(int f = 0, l = n-1; f<l; f++,l--){
+                temp = buffer[f];
+                buffer[f] = buffer[l];
+                buffer[l] = temp;
+                }
+            
+            // print reversed message to terminal
+            printf("Sending message to Client: '%s'\n",buffer);
+            
+            // Echo received message back to client
             client.send_all(buffer, n);
             if (n <= 0) break;
         }
--- a/mbed-rtos.lib	Tue Jun 04 16:07:06 2013 +0100
+++ b/mbed-rtos.lib	Mon May 04 22:47:02 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed-rtos/#557d5b275f31
--- a/mbed.bld	Tue Jun 04 16:07:06 2013 +0100
+++ b/mbed.bld	Mon May 04 22:47:02 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/8ab26030e058
\ No newline at end of file