Dependencies:   mbed lwip

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Tue Sep 22 12:02:37 2009 +0000
Parent:
0:cf26091e3c21
Commit message:

Changed in this revision

Objects.cpp Show diff for this revision Revisions of this file
Objects.h Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r cf26091e3c21 -r 3a52abf35e4f Objects.cpp
--- a/Objects.cpp	Sat Sep 19 00:47:41 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#include "Objects.h"
-
-LocalFileSystem local("local");
-Serial pc(USBTX, USBRX);
-
-InterruptIn RedButton(p30,"redbutton");
-DigitalIn GreenButton(p29,"greenbutton");
-DigitalIn BlueButton(p28,"bluebutton");
-
-DigitalOut led1(LED1,"led1");
-DigitalOut led2(LED2,"led2");
-DigitalOut led3(LED3,"led3");
-DigitalOut led4(LED4,"led4");
-
-AnalogIn light(p16);
-AnalogIn pot(p20,"pot");
-
-RFID rfid (NC,p27);
-MobileLCD lcd(p11, p12, p13, p14, p15);
-LIS302 acc (p5,p6,p7,p8);
-RGBLED rgb (p24,p22,p23);
-Servo servo (p21);
-SRF05 srf (p10,p9);
-
-usbhid hid;
-
diff -r cf26091e3c21 -r 3a52abf35e4f Objects.h
--- a/Objects.h	Sat Sep 19 00:47:41 2009 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-#include "mbed.h"
-
-#include "HTTPServer.h"
-#include "HTTPRPC.h"
-#include "HTTPFS.h"
-
-#include "MobileLCD.h"
-#include "LIS302.h"
-#include "RFID.h"
-#include "RGBLED.h"
-#include "Servo.h"
-#include "usbhid.h"
-#include "SRF05.h"
-
-extern LocalFileSystem local;
-extern Serial pc;
-
-extern InterruptIn RedButton;
-extern DigitalIn GreenButton;
-extern DigitalIn BlueButton;
-
-extern DigitalOut led1;
-extern DigitalOut led2;
-extern DigitalOut led3;
-extern DigitalOut led4;
-
-extern AnalogIn light;
-extern AnalogIn pot;
-
-extern RFID rfid;
-extern MobileLCD lcd;
-extern LIS302 acc;
-extern RGBLED rgb;
-extern Servo servo;
-extern SRF05 srf;
-
-extern usbhid hid;
-
-
-
-
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();
+    }
+
 
 
 }