summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-06-06 19:42:14 +0000
committerlaforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-06-06 19:42:14 +0000
commit3ec5e2150581bebdd3a3ed8530d1adffc8665936 (patch)
tree0a76833c0c7be9df517b6d7e9b9078e1d244fce3
parentafdbbbc6242433463cd0f18920aacbbf579306f5 (diff)
Ignore 1:1 echos of commands sent. This is mainly to work around modems that
are initially in 'E1' state, i.e. have echo enabled. This means that our first ATE0V1 command will get echoed before we receive OK. (Philipp Zabel) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2180 99fdad57-331a-0410-800a-d7fa5415bdb3
-rw-r--r--src/gsmd/atcmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c
index 4df12dc..44e215c 100644
--- a/src/gsmd/atcmd.c
+++ b/src/gsmd/atcmd.c
@@ -194,6 +194,11 @@ static int ml_parse(const char *buf, int len, void *ctx)
cmd = llist_entry(g->busy_atcmds.next,
struct gsmd_atcmd, list);
+ if (cmd && !strcmp(buf, cmd->buf)) {
+ DEBUGP("ignoring echo\n");
+ return 0;
+ }
+
/* we have to differentiate between the following cases:
*
* A) an information response ("+whatever: ...")
personal git repositories of Harald Welte. Your mileage may vary