r1766 - trunk/src/target/gsm/src/gsmd
laforge at sita.openmoko.org
laforge at sita.openmoko.org
Sun Apr 15 11:57:14 CEST 2007
Author: laforge
Date: 2007-04-15 11:57:12 +0200 (Sun, 15 Apr 2007)
New Revision: 1766
Modified:
trunk/src/target/gsm/src/gsmd/atcmd.c
Log:
parse numeric responses for RING, NO CARRIER and BUSY (Philip Zabel)
Modified: trunk/src/target/gsm/src/gsmd/atcmd.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/atcmd.c 2007-04-15 09:47:23 UTC (rev 1765)
+++ trunk/src/target/gsm/src/gsmd/atcmd.c 2007-04-15 09:57:12 UTC (rev 1766)
@@ -269,7 +269,8 @@
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 @@
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 @@
/* 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;
More information about the commitlog
mailing list