summaryrefslogtreecommitdiff
path: root/src/gsmd
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-04-15 09:57:12 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-04-15 09:57:12 +0000
commitbba162cb3e66b58e1cb7470fd9cb136a22df7f25 (patch)
tree9488d13eb6074b71d046b2ef849c65235f225551 /src/gsmd
parentf243da86ed3c515740870ce0a817f2e768b420fe (diff)
parse numeric responses for RING, NO CARRIER and BUSY (Philip Zabel)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@1766 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/gsmd')
-rw-r--r--src/gsmd/atcmd.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index 53a7501..27c0a41 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -269,7 +269,8 @@ static int ml_parse(const char *buf, int len, void *ctx)
memcpy(cmd->buf, buf, len);
}
} else {
- if (!strcmp(buf, "RING")) {
+ if (!strcmp(buf, "RING") ||
+ ((g->flags & GSMD_FLAG_V0) && buf[0] == '2')) {
/* this is the only non-extended unsolicited return
* code, part of Case 'B' */
return unsolicited_parse(g, buf, len, NULL);
@@ -285,8 +286,8 @@ static int ml_parse(const char *buf, int len, void *ctx)
goto final_cb;
}
- if (!strncmp(buf, "OK", 2)
- || ((g->flags & GSMD_FLAG_V0) && buf[0] == '0')) {
+ if (!strncmp(buf, "OK", 2) ||
+ ((g->flags & GSMD_FLAG_V0) && buf[0] == '0')) {
/* Part of Case 'C' */
if (cmd)
cmd->ret = 0;
@@ -296,13 +297,15 @@ static int ml_parse(const char *buf, int len, void *ctx)
/* FIXME: handling of those special commands in response to
* ATD / ATA */
- if (!strncmp(buf, "NO CARRIER", 11)) {
+ if (!strncmp(buf, "NO CARRIER", 11) ||
+ ((g->flags & GSMD_FLAG_V0) && buf[0] == '3')) {
/* Part of Case 'D' */
final = 1;
goto final_cb;
}
- if (!strncmp(buf, "BUSY", 4)) {
+ if (!strncmp(buf, "BUSY", 4) ||
+ ((g->flags & GSMD_FLAG_V0) && buf[0] == '7')) {
/* Part of Case 'D' */
final = 1;
goto final_cb;
personal git repositories of Harald Welte. Your mileage may vary