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:
18:bc165829bb88
Parent:
0:4c9bfcb3e759
Child:
20:f2dbbd852e08
--- a/main.cpp	Tue Feb 25 22:49:31 2014 +0000
+++ b/main.cpp	Wed Feb 26 05:45:38 2014 +0000
@@ -18,6 +18,9 @@
  
  #include "MBEDEndpoint.h"
  
+ #include <string.h>
+ #include <stdlib.h>
+ 
  // Ethernet Interface
  EthernetInterface ethernet;
  
@@ -32,6 +35,14 @@
  // Instances for the Endpoint
  ErrorHandler *error_handler = NULL;
  MBEDEndpoint *endpoint = NULL;
+ 
+ // cannot seem to find strdup() anywhere..
+ char* strdup (const char *str) {
+    char *result = (char*)(malloc (strlen (str) + 1));
+    if (result != NULL)
+        strcpy (result,str);
+    return result;
+ }
 
  // ErrorHandler (logger)
  ErrorHandler *logger() { return error_handler; }