reef monitor

Dependencies:   mbed-rtos EthernetInterface FatFileSystemCpp MCP23S17 SDFileSystem mbed

Fork of HTTPServerHelloWorld by Donatien Garnier

Revision:
4:a19825caaf41
Parent:
3:5dc0023e6284
Child:
11:9366140ebe5f
--- a/main.cpp	Fri Jan 31 23:19:28 2014 +0000
+++ b/main.cpp	Sat Feb 01 17:29:15 2014 +0000
@@ -1,47 +1,8 @@
-#include "mbed.h"
-#include "HTTPServer.h"
-#include "EthernetService.h"
-#include "NTPClient.h"
+#include "Application.h"
 
-EthernetService ethernetService;
-
-DigitalOut led1(LED1);
-DigitalOut led4(LED4);
+Application* application;
 
 int main() {
-    printf("Setting up Ethernet ...\n");
-    if(!ethernetService.setup()) {
-        printf("Error starting ethernet service\n");
-    } else {
-        ethernetService.setRtcTime();
-    }
-  
-
-
-Ethernet ethf;
-HTTPServer svr;
-  
-  svr.addHandler<SimpleHandler>("/"); //Default handler
-  svr.bind(80);
-  
-  printf("Listening on port 80 ...\n");
-    
-  Timer tm;
-  tm.start();
-  //Listen indefinitely
-  while(true)
-  {
-    if(ethf.link()) {
-        led4 = 1;
-    } else {
-        led4 = 0;
-    }
-    
-    Net::poll();
-    if(tm.read()>.5)
-    {
-      led1=!led1; //Show that we are alive
-      tm.start();
-    }
-  }
-}
+    application = new Application();
+    application->run();
+}
\ No newline at end of file