diff options
author | Denis Kenzior <denis.kenzior@intel.com> | 2009-08-29 10:44:44 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-08-29 10:47:16 -0500 |
commit | 789610389eb623622fc3403c0415b43c46b153de (patch) | |
tree | 5cbc934f18d4639e9948e657ea288f0c40509c3a /gatchat/gatsyntax.c | |
parent | aef72327c2ba673c5fd51c616b78fde407c3e662 (diff) | |
download | ofono-789610389eb623622fc3403c0415b43c46b153de.tar.bz2 |
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/gatsyntax.c')
-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: |