1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
Index: gsm/src/gsmd/atcmd.c
===================================================================
--- gsm.orig/src/gsmd/atcmd.c 2007-04-02 09:59:16.000000000 +0200
+++ gsm/src/gsmd/atcmd.c 2007-04-02 10:10:54.000000000 +0200
@@ -207,7 +207,7 @@
* TBD
*/
- if (buf[0] == '+' || buf[0] == '%') {
+ if (buf[0] == '+' || buf[0] == '%' || buf[0] == '@') {
/* an extended response */
const char *colon = strchr(buf, ':');
if (!colon) {
@@ -269,14 +269,13 @@
memcpy(cmd->buf, buf, len);
}
} else {
- if (!strcmp(buf, "RING")) {
+ if (!strcmp(buf, "RING") || buf[0] == '2') {
/* this is the only non-extended unsolicited return
* code, part of Case 'B' */
return unsolicited_parse(g, buf, len, NULL);
}
- if (!strcmp(buf, "ERROR") ||
- ((g->flags & GSMD_FLAG_V0) && buf[0] == '4')) {
+ if (!strcmp(buf, "ERROR") || buf[0] == '4') {
/* Part of Case 'C' */
DEBUGP("unspecified error\n");
if (cmd)
@@ -285,8 +284,7 @@
goto final_cb;
}
- if (!strncmp(buf, "OK", 2)
- || ((g->flags & GSMD_FLAG_V0) && buf[0] == '0')) {
+ if (!strncmp(buf, "OK", 2) || buf[0] == '0') {
/* Part of Case 'C' */
if (cmd)
cmd->ret = 0;
@@ -296,13 +294,13 @@
/* FIXME: handling of those special commands in response to
* ATD / ATA */
- if (!strncmp(buf, "NO CARRIER", 11)) {
+ if (!strncmp(buf, "NO CARRIER", 11) || buf[0] == '3') {
/* Part of Case 'D' */
final = 1;
goto final_cb;
}
- if (!strncmp(buf, "BUSY", 4)) {
+ if (!strncmp(buf, "BUSY", 4) || buf[0] == '7') {
/* Part of Case 'D' */
final = 1;
goto final_cb;
|