Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Revision:
111:dac439bf902b
Parent:
81:9e902c2b855e
Child:
112:1fb53d4729af
--- a/main.cpp	Mon Mar 17 05:07:03 2014 +0000
+++ b/main.cpp	Mon Mar 17 16:56:41 2014 +0000
@@ -24,6 +24,9 @@
  // Ethernet Interface
  EthernetInterface ethernet;
  
+ // Mutex for the network as RTOS doesnt play well with threads...
+ Mutex *network_mutex = NULL;
+ 
  // Serial Console Support
  Serial pc(USBTX, USBRX);
  
@@ -81,6 +84,8 @@
 
  // Main Entry
  int main() {
+    network_mutex = new Mutex();
+    if (network_mutex != NULL) network_mutex->unlock();
 #ifdef MAC_ADDRESS
     mbed_mac_address(mac);
     memset(fmt_mac,0,RESOURCE_VALUE_LEN+1);