diff options
author | Denis Kenzior <denis.kenzior@intel.com> | 2009-08-29 10:44:44 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-08-29 10:24:07 -0700 |
commit | b2b6bdad0116ca1c42a72b6cc60a5268e61ff219 (patch) | |
tree | 3c85fdb1439b65f8bc1df3477a6957a707c64ee8 /gatchat | |
parent | 51f653a6d38fa9e017980058a6c0adba9ea03820 (diff) | |
download | connman-b2b6bdad0116ca1c42a72b6cc60a5268e61ff219.tar.gz connman-b2b6bdad0116ca1c42a72b6cc60a5268e61ff219.tar.bz2 connman-b2b6bdad0116ca1c42a72b6cc60a5268e61ff219.zip |
Fix a problem with CtrlZ echo
When a PDU is submitted and echoed by the modem, the CtrlZ character
is also echoed back. Fix the parser to handle this case appropriately.
Diffstat (limited to 'gatchat')
-rw-r--r-- | gatchat/gatsyntax.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gatchat/gatsyntax.c b/gatchat/gatsyntax.c index 5db01a7f..d7c9ee23 100644 --- a/gatchat/gatsyntax.c +++ b/gatchat/gatsyntax.c @@ -182,6 +182,16 @@ static GAtSyntaxResult gsmv1_feed(GAtSyntax *syntax, case GSMV1_STATE_GARBAGE: if (byte == '\r') syntax->state = GSMV1_STATE_GARBAGE_CHECK_LF; + /* This handles the case of echo of the PDU terminated + * by CtrlZ character + */ + else if (byte == 26) { + syntax->state = GSMV1_STATE_IDLE; + res = G_AT_SYNTAX_RESULT_UNRECOGNIZED; + i += 1; + goto out; + } + break; case GSMV1_STATE_GARBAGE_CHECK_LF: |