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.
This commit is contained in:
Denis Kenzior 2009-08-29 10:44:44 -05:00 committed by Denis Kenzior
parent aef72327c2
commit 789610389e
1 changed files with 10 additions and 0 deletions

View File

@ -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: