Own fork of C027_Support

Dependents:   MbedSmartRestMain MbedSmartRestMain

Fork of C027_Support by u-blox

Revision:
14:69c3e57ef0f5
Parent:
13:e2446fcdc246
Child:
15:5eda64e5b9d1
--- a/SerialPipe.cpp	Tue Nov 19 08:34:51 2013 +0000
+++ b/SerialPipe.cpp	Tue Nov 19 09:02:35 2013 +0000
@@ -104,16 +104,21 @@
 
 int SerialPipeEx::getLine(char* buffer, int length)
 {
+    return getLine(buffer, length, &_pipeRx);
+}
+
+int SerialPipeEx::getLine(char* buffer, int length, Pipe<char>* pipe)
+{
     int o = 0;
     int i = 0;
-    int l = _pipeRx.start();
+    int l = pipe->start();
     while ((i < l) && (o < length))
     {
-        int t = _pipeRx.next();
+        int t = pipe->next();
         i ++;
         if (t == '\r')     // terminate commands with carriage return
         {
-            _pipeRx.done();
+            pipe->done();
             if (length > o)
                 buffer[o] = '\0';
             return o;          // if enter send the zero char