Simple HTTP server example with WIZ550io, W5500 (WIZnet chipset) .access the mbed via any browser, mbed echo back http request header.

Dependencies:   W5500Interface mbed

Fork of HTTPServer_echoback_WIZ550io by Bongjun Hur

Revision:
20:f0c3af075949
Parent:
19:59a668f08555
--- a/main.cpp	Wed Jul 23 07:31:24 2014 +0000
+++ b/main.cpp	Tue Sep 23 23:41:25 2014 +0000
@@ -1,11 +1,11 @@
 #include "mbed.h"
-//#include "EthernetInterface.h"
-#include "EthernetInterfaceW5500.h"
+#include "EthernetInterface.h"
+//#include "EthernetInterfaceW5500.h"
 #include <stdio.h>
 #include <string.h>
 
-#define PORT   80
-//#define PORT   888
+//#define PORT   80
+#define PORT   888
 #define _DHCP
 
 // move to main().
@@ -36,23 +36,21 @@
 {
 #if defined(TARGET_LPC1114)
     SPI spi(dp2, dp1, dp6); // mosi, miso, sclk
-    EthernetInterfaceW5500 eth(&spi, dp25, dp26); // spi, cs, reset
+    EthernetInterface eth(&spi, dp25, dp26); // spi, cs, reset
 
 #elif defined(TARGET_LPC1768)
     SPI spi(p11, p12, p13); // mosi, miso, sclk
-    EthernetInterfaceW5500 eth(&spi, p14, p15); // spi, cs, reset
+    EthernetInterface eth(&spi, p14, p15); // spi, cs, reset
 
 #elif defined(TARGET_LPC11U68)
     SPI spi(P0_9, P0_8, P1_29); // mosi, miso, sclk
-//WIZnetInterface eth(&spi, P0_2, P1_25); // spi, cs, reset
-//SPI spi(p5, p6, p7); // mosi, miso, sclk
-    EthernetInterfaceW5500 eth(&spi, P0_2, P1_28);//, nRESET(p9); // reset pin is dummy, don't affect any pin of WIZ550io
+    EthernetInterface eth(&spi, P0_2, P1_28);//, nRESET(p9); // reset pin is dummy, don't affect any pin of WIZ550io
     spi.format(8,0); // 8bit, mode 0
     spi.frequency(7000000); // 7MHz
     wait(1); // 1 second for stable state
 #elif defined (TARGET_NUCLEO_F030R8)
     SPI spi(SPI_MOSI, SPI_MISO, SPI_SCK); // mosi, miso, sclk
-    EthernetInterfaceW5500 eth(&spi, PB_6, PA_9);//, nRESET(p9); // reset pin is dummy, don't affect any pin of WIZ550io
+    EthernetInterface eth(&spi, PB_6, PA_9);//, nRESET(p9); // reset pin is dummy, don't affect any pin of WIZ550io
     spi.format(8,0); // 8bit, mode 0
     spi.frequency(7000000); // 7MHz
     wait(1); // 1 second for stable state
@@ -72,10 +70,14 @@
         printf("IP Address is %s\n\r", eth.getIPAddress());
     */
 
+    printf("Board is on\r\n");
+    
 #ifdef _DHCP 
 // didn't test yet in DHCP => TEST OK...
 
+    printf("eth.init()\r\n");
     eth.init(); //Use DHCP
+    printf("eth.connect()\r\n");
     eth.connect();
     //printf("IP Address is %s\n\r", eth.getIPAddress());
     printf("Initialized, MAC: %s\n", eth.getMACAddress());