Parser for AT commands and similar protocols
Diff: ATParser.cpp
- Revision:
- 4:38acbd6f9d9e
- Parent:
- 3:32915b9467d2
- Child:
- 5:26bc9255b751
--- a/ATParser.cpp Fri Jul 17 16:31:58 2015 +0000 +++ b/ATParser.cpp Fri Jul 17 16:38:44 2015 +0000 @@ -26,7 +26,7 @@ // getc/putc handling with timeouts -int ATParser::_putc(char c) { +int ATParser::putc(char c) { Timer timer; timer.start(); @@ -39,7 +39,7 @@ } } -int ATParser::_getc() { +int ATParser::getc() { Timer timer; timer.start(); @@ -52,7 +52,7 @@ } } -void ATParser::_flush() { +void ATParser::flush() { while (_serial->readable()) _serial->getc(); } @@ -61,13 +61,13 @@ // getline/putline handling with timeouts/bounds checking bool ATParser::_putline(const char *line) { for (int i = 0; line[i]; i++) { - if (_putc(line[i]) < 0) + if (putc(line[i]) < 0) return false; } // Finish with newline for (int i = 0; _delimiter[i]; i++) { - if (_putc(_delimiter[i]) < 0) + if (putc(_delimiter[i]) < 0) return false; } @@ -82,7 +82,7 @@ int i = 0; while (i < size) { - int c = _getc(); + int c = getc(); if (c < 0) return false; @@ -107,7 +107,7 @@ va_list args; va_start(args, response); - _flush(); + flush(); // Create and send command if (command) {