Commented out the body of bool MODSERIAL::claim (FILE *stream) since it causes problems with the latest mbed library

Dependents:   ATT_Cellular_IOT_Button Avnet_ATT_Cellular_Pubnub Hiking_Pal Avnet_ATT_Cellular_IOT ... more

Fork of MODSERIAL by Erik -

Revision:
31:b90b20f78f04
Parent:
27:9c93ce7cb9d8
Child:
42:ae4c4f174d1f
--- a/MODSERIAL.cpp	Sun Sep 01 12:24:12 2013 +0000
+++ b/MODSERIAL.cpp	Fri Oct 11 18:31:01 2013 +0000
@@ -93,4 +93,27 @@
 }
 
 
+bool MODSERIAL::claim (FILE *stream) {
+    if ( _name == NULL) {
+        error("claim requires a name to be given in the instantiator of the MODSERIAL instance!\r\n");
+    }
+    
+    //Add '/' before name:
+    char *path = new char[strlen(_name) + 2];
+    sprintf(path, "/%s", _name);
+    
+    if (freopen(path, "w", stream) == NULL) {
+        // Failed, should not happen
+        return false;
+    }
+    
+    delete(path);
+    
+    //No buffering
+    setvbuf(stdout, NULL, _IONBF, buffer_size[TxIrq]);
+    return true;
+} 
+
+
+
 }; // namespace AjK ends