Rob Toulson / Mbed 2 deprecated PE_12-10_FileServerSetup

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
robt
Date:
Sun Jun 16 15:33:22 2013 +0000
Commit message:
by Rob Toulson and Tim Wilmshurst from textbook "Fast and Effective Embedded Systems Design: Applying the ARM mbed"

Changed in this revision

main.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/main.cpp	Sun Jun 16 15:33:22 2013 +0000
@@ -0,0 +1,24 @@
+/* Program Example: 12.10 mbed file server setup
+                                                           */
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPServer.h"
+LocalFileSystem fs("webfs");
+EthernetNetIf eth(
+  IpAddr(192,168,0,101),      //IP Address
+  IpAddr(255,255,255,0),      //Network Mask
+  IpAddr(192,168,0,1),        //Gateway
+  IpAddr(192,168,0,1)         //DNS
+);
+HTTPServer svr;
+int main() {
+  eth.setup();
+  FSHandler::mount("/webfs", "/");    //Mount webfs path on root path
+  svr.addHandler<FSHandler>("/");     //Default handler
+  svr.bind(80);
+  while(1)
+  {
+    Net::poll();                  // poll for internet data exchange requests
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jun 16 15:33:22 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/b3110cd2dd17
\ No newline at end of file