Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Diff: main.cpp
- Revision:
- 160:24337c83dd1d
- Parent:
- 159:329e3271c87e
- Child:
- 162:ba089a5e3da7
--- a/main.cpp Mon Jun 30 22:17:32 2014 +0000 +++ b/main.cpp Tue Jul 01 17:12:18 2014 +0000 @@ -24,20 +24,19 @@ #ifdef CELLULAR_NETWORK // MDMSerial #include "MDM.h" - MDMSerial modem; // GPSParser - //#include "GPS.h" - //GPSParser gps; - void *gps = NULL; + #include "GPS.h" #else // Ethernet Interface #include "EthernetInterface.h" EthernetInterface ethernet; #endif - + + #ifdef NETWORK_MUTEX // Mutex for the network as RTOS doesnt play well with threads... Mutex *network_mutex = NULL; + #endif #ifdef _ENDPOINT_UBLOX_PLATFORM // Serial Console Support @@ -91,7 +90,9 @@ // close down the application and exit void closedown(int code) { if (endpoint != NULL) { +#ifdef EH_USE_MUTEXES error_handler->releaseMutexes(); +#endif error_handler->log("Closing down Endpoint..."); delete endpoint; } @@ -132,7 +133,9 @@ #endif error_handler = new ErrorHandler(&pc,&lcd); #ifdef CELLULAR_NETWORK - endpoint = new MBEDEndpoint(error_handler,&modem,&gps); + MDMSerial modem; + modem.setDebug(4); // enable this for debugging issues + endpoint = new MBEDEndpoint(error_handler,&modem,NULL); #else endpoint = new MBEDEndpoint(error_handler,ðernet,NULL); #endif