Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ATParser by
Revision 13:46a18ad08efc, committed 2016-02-18
- Comitter:
- Christopher Haster
- Date:
- Thu Feb 18 16:01:03 2016 -0600
- Parent:
- 12:7d3c3f7ce928
- Child:
- 14:6b8190f55d83
- Commit message:
- Added better handling of binary data
Changed in this revision
| ATParser.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ATParser.cpp Thu Feb 18 15:59:15 2016 -0600
+++ b/ATParser.cpp Thu Feb 18 16:01:03 2016 -0600
@@ -229,10 +229,6 @@
int j = 0;
while (true) {
- // Ran out of space
- if (j+1 >= _buffer_size - offset) {
- return false;
- }
// Recieve next character
int c = getc();
if (c < 0) {
@@ -260,8 +256,11 @@
break;
}
- // Clear the buffer when we hit a newline
- if (strcmp(&_buffer[offset + j-_delim_size], _delimiter) == 0) {
+ // Clear the buffer when we hit a newline or ran out of space
+ // running out of space usually means we ran into binary data
+ if (j+1 >= _buffer_size - offset ||
+ strcmp(&_buffer[offset + j-_delim_size], _delimiter) == 0) {
+
debug_if(dbg_on, "AT< %s", _buffer+offset);
j = 0;
}
