From 5540e791be5b08fc3f8efcc5daf7c1015e79018c Mon Sep 17 00:00:00 2001 From: laforge Date: Tue, 31 Jul 2007 07:07:24 +0000 Subject: the latest gsmd sends the alive detector's ATE0 to the GSM modem, even if interpreter_ready == 0. The attached patch sees to it that if interpreter_ready is zero, gsmd_alive_start is only called once the "AT-Command Interpreter ready" message was seen. (Philipp Zabel) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2578 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/atcmd.c | 1 + src/gsmd/gsmd.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gsmd') diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c index 44e215c..085b382 100644 --- a/src/gsmd/atcmd.c +++ b/src/gsmd/atcmd.c @@ -185,6 +185,7 @@ static int ml_parse(const char *buf, int len, void *ctx) !strcmp(buf, "AT-Command Interpreter ready")) { g->interpreter_ready = 1; gsmd_initsettings(g); + gmsd_alive_start(g); return 0; } diff --git a/src/gsmd/gsmd.c b/src/gsmd/gsmd.c index 9e2f7d6..eaf1334 100644 --- a/src/gsmd/gsmd.c +++ b/src/gsmd/gsmd.c @@ -128,7 +128,7 @@ static void alive_interval_tmr_cb(struct gsmd_timer *tmr, void *data) gsmd_timer_register(tmr); } -static int gmsd_alive_start(struct gsmd *gsmd) +int gmsd_alive_start(struct gsmd *gsmd) { struct timeval tv; @@ -472,10 +472,11 @@ int main(int argc, char **argv) /* select a vendor plugin */ gsmd_vendor_plugin_find(&g); - if (g.interpreter_ready) + if (g.interpreter_ready) { gsmd_initsettings(&g); - gmsd_alive_start(&g); + gmsd_alive_start(&g); + } gsmd_opname_init(&g); -- cgit v1.2.3