From: Denis Kenzior Date: Sat, 29 Aug 2009 15:44:44 +0000 (-0500) Subject: Fix a problem with CtrlZ echo X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~3280 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2b6bdad0116ca1c42a72b6cc60a5268e61ff219;p=profile%2Fivi%2Fconnman.git 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. --- diff --git a/gatchat/gatsyntax.c b/gatchat/gatsyntax.c index 5db01a7..d7c9ee2 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: