Chris Styles
/
DemoBoard_HTTP_RPC
Diff: main.cpp
- Revision:
- 1:3a52abf35e4f
- Parent:
- 0:cf26091e3c21
diff -r cf26091e3c21 -r 3a52abf35e4f main.cpp --- a/main.cpp Sat Sep 19 00:47:41 2009 +0000 +++ b/main.cpp Tue Sep 22 12:02:37 2009 +0000 @@ -1,4 +1,4 @@ -#include "Objects.h" +#include "DemoBoard.h" /* * This project uses an RFID tag reader and the USB interface as a HID keyboard @@ -8,6 +8,27 @@ int main() { + // Create a HTTPServer on default Port + HTTPServer *http = new HTTPServer(); + + // Register RPC in /rpc space + http->addHandler(new HTTPRPC()); + + // Register local filesystem to all places which are not in /rpc + http->addHandler(new HTTPFileSystemHandler("/", "/local/")); + + // Register the HTTPServer on the Network device (will hopfully disappear in the next Version) + http->bind(); + + NetServer *net = NetServer::get(); + + lcd.locate(0,1); + lcd.printf("%hhu.%hhu.%hhu.%hhu\n", (net->getIPAddr().addr)&0xFF, (net->getIPAddr().addr>>8)&0xFF, (net->getIPAddr().addr>>16)&0xFF, (net->getIPAddr().addr>>24)&0xFF); + + while(1) { + http->poll(); + } + }