A simple HTTP server echoing received requests. Ethernet connection is over an ENC28J60 board. Usage: Type the server's IP address into you web browser and hit <ENTER>.

Dependencies:   UIPEthernet

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Tue Sep 03 09:43:41 2019 +0000
Parent:
7:f6058bcaa614
Child:
9:66b6c19e9bb7
Commit message:
Updated to use the latest version of the UIPEthernet library.

Changed in this revision

UIPEthernet.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
--- a/UIPEthernet.lib	Fri Aug 30 14:14:59 2019 +0000
+++ b/UIPEthernet.lib	Tue Sep 03 09:43:41 2019 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/hudakz/code/UIPEthernet/#647d53d146f1
+http://mbed.org/users/hudakz/code/UIPEthernet/#7648334eb41b
--- a/main.cpp	Fri Aug 30 14:14:59 2019 +0000
+++ b/main.cpp	Tue Sep 03 09:43:41 2019 +0000
@@ -39,6 +39,9 @@
     printf("IP address: %s\r\n", ip ? ip : "None");
     printf("Netmask: %s\r\n", netmask ? netmask : "None");
     printf("Gateway: %s\r\n\r\n", gateway ? gateway : "None");
+    printf("------------------------------------------------------\r\n");
+    printf("Usage: Type %s into your web browser and hit ENTER\r\n", net.get_ip_address());
+    printf("------------------------------------------------------\r\n");
 
     /* Open the server on ethernet stack */
     server.open(&net);
@@ -68,8 +71,7 @@
                 client->send((uint8_t*)receiveBuf, receiveLen);
                 printf("Echo done.\r\n");
             }
+            client->close();
         }
-
-        client->close();
     }
 }