reef monitor
Dependencies: mbed-rtos EthernetInterface FatFileSystemCpp MCP23S17 SDFileSystem mbed
Fork of HTTPServerHelloWorld by
Diff: Model/Application.cpp
- Revision:
- 5:df012c2caf40
- Parent:
- 4:a19825caaf41
- Child:
- 6:b2c4687b421d
diff -r a19825caaf41 -r df012c2caf40 Model/Application.cpp --- a/Model/Application.cpp Sat Feb 01 17:29:15 2014 +0000 +++ b/Model/Application.cpp Sat Feb 01 18:54:20 2014 +0000 @@ -11,17 +11,27 @@ loop(); ethernetService->poll(); if (ethernetService->isLinkRestored()) { + // if ethernet link is restored, application needs to be restarted applicationReset(); } } } void Application::setup() { + // setup ethernet ethernetService = new EthernetService(); if(!ethernetService->setup()) { applicationReset(); } + // set the system time from NTP ethernetService->setRtcTime(); + + // starting the file system + fileSystem = new LocalFileSystem("local"); + + // start the rest api server + restServer = new RestServer(fileSystem); + restServer->bind(); } void Application::loop() {