Dependencies:   EthernetNetIf mbed HTTPServer

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Mon Jun 14 10:26:12 2010 +0000
Child:
1:da03e7b8c23c
Commit message:

Changed in this revision

EthernetNetIf.lib Show annotated file Show diff for this revision Revisions of this file
HTTPServer.lib Show annotated file Show diff for this revision Revisions of this file
HTTPServerHelloWorld.cpp 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Mon Jun 14 10:26:12 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPServer.lib	Mon Jun 14 10:26:12 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPServer/#d753966e4d97
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPServerHelloWorld.cpp	Mon Jun 14 10:26:12 2010 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPServer.h"
+
+EthernetNetIf eth;  
+HTTPServer svr;
+
+DigitalOut led1(LED1);
+
+int main() {
+  printf("Setting up...\n");
+  EthernetErr ethErr = eth.setup();
+  if(ethErr)
+  {
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  printf("Setup OK\n");
+  
+  svr.addHandler<SimpleHandler>("/"); //Default handler
+  svr.bind(80);
+  
+  printf("Listening...\n");
+    
+  Timer tm;
+  tm.start();
+  //Listen indefinitely
+  while(true)
+  {
+    Net::poll();
+    if(tm.read()>.5)
+    {
+      led1=!led1; //Show that we are alive
+      tm.start();
+    }
+  }
+  
+  return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jun 14 10:26:12 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/029aa53d7323