From a831d70619f614254692b75c1aca39f21c15fb55 Mon Sep 17 00:00:00 2001 From: laforge Date: Sat, 10 Mar 2007 02:21:28 +0000 Subject: * deal correctly with 'gsm power cycling' * consider % as prefix for extended response, even though non-standard git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@1313 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/atcmd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gsmd/atcmd.c') diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c index cc5d891..11e9251 100644 --- a/src/gsmd/atcmd.c +++ b/src/gsmd/atcmd.c @@ -176,8 +176,11 @@ static int ml_parse(const char *buf, int len, void *ctx) int rc = 0, final = 0; DEBUGP("buf=`%s'(%d)\n", buf, len); - - if (!strcmp(buf, "AT-Command Interpreter ready")) { + + /* FIXME: This needs to be part of the vendor plugin. If we receive + * an empty string or that 'ready' string, we need to init the modem */ + if (strlen(buf) == 0 || + !strcmp(buf, "AT-Command Interpreter ready")) { gsmd_initsettings(g); return 0; } @@ -239,7 +242,7 @@ static int ml_parse(const char *buf, int len, void *ctx) } if (cmd) { - if (cmd->buf[2] != '+') { + if (cmd->buf[2] != '+' && cmd->buf[2] != '%') { gsmd_log(GSMD_ERROR, "extd reply to non-extd command?\n"); return -EINVAL; } -- cgit v1.2.3