summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-06-19 21:10:51 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-06-19 21:14:00 -0500
commitc91ae28018ee40c8d46e3450b0a3c53647c43060 (patch)
tree67d2667e08f16ab1fb881b62b0897f66a74f82ca
parentee65dc3524ef9be946b8fbefa52db4588a518755 (diff)
downloadofono-c91ae28018ee40c8d46e3450b0a3c53647c43060.tar.bz2
Fixes to parser state when command prompt is used
-rw-r--r--gatchat/gatchat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c
index 0a373721..b400157d 100644
--- a/gatchat/gatchat.c
+++ b/gatchat/gatchat.c
@@ -606,13 +606,14 @@ static inline void parse_char(GAtChat *chat, char byte)
chat->state = PARSER_STATE_PROMPT_COMPLETE;
else
chat->state = PARSER_STATE_RESPONSE;
+ break;
case PARSER_STATE_RESPONSE_COMPLETE:
case PARSER_STATE_PDU_COMPLETE:
case PARSER_STATE_MULTILINE_COMPLETE:
default:
/* This really shouldn't happen */
- assert(TRUE);
+ assert(FALSE);
return;
}
}
@@ -678,6 +679,8 @@ static void new_bytes(GAtChat *p)
ring_buffer_drain(p->buf, p->read_so_far);
p->read_so_far = 0;
+
+ p->state = PARSER_STATE_IDLE;
}
}