Support for LISA-N101
Fork of C027_Support by
This is a variant of the C027 driver code for the C027N version, i.e. the one with the Neul/Huawei/u-blox Cellular Internet of Things module on board. The AT command interface for this module is entirely different to the AT interface for the other u-blox modules, hence this fork of the driver. Work is underway to rearchitect the original C027 driver so that a merge can be done.
Diff: SerialPipe.cpp
- 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