From babd25d431a4453ce79f5281e1f7b0a39d2edbef Mon Sep 17 00:00:00 2001 From: laforge Date: Fri, 17 Aug 2007 08:34:52 +0000 Subject: Wait for the AT Interpreter Ready message. git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2729 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/gsmd.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gsmd/gsmd.c b/src/gsmd/gsmd.c index de0d25e..d428bd8 100644 --- a/src/gsmd/gsmd.c +++ b/src/gsmd/gsmd.c @@ -317,6 +317,7 @@ static struct option opts[] = { { "leak-report", 0, NULL, 'L' }, { "vendor", 1, NULL, 'v' }, { "machine", 1, NULL, 'm' }, + { "wait", 1, NULL, 'w' }, { 0, 0, 0, 0 } }; @@ -344,6 +345,7 @@ static void print_usage(void) "\t-l file\t--logfile file\tSpecify a logfile to log to\n" "\t-v\t--vendor v\tSpecify GSM modem vendor plugin\n" "\t-m\t--machine m\tSpecify GSM modem machine plugin\n" + "\t-w\t--wait m\tWait for the AT Interpreter Ready message\n" ); } @@ -373,6 +375,7 @@ int main(int argc, char **argv) char *logfile = "syslog"; char *vendor_name = NULL; char *machine_name = NULL; + int wait = -1; signal(SIGTERM, sig_handler); signal(SIGINT, sig_handler); @@ -385,7 +388,7 @@ int main(int argc, char **argv) print_header(); /*FIXME: parse commandline, set daemonize, device, ... */ - while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:", opts, NULL)) != -1) { + while ((argch = getopt_long(argc, argv, "FVLdhp:s:l:v:m:w:", opts, NULL)) != -1) { switch (argch) { case 'V': print_version(); @@ -423,6 +426,9 @@ int main(int argc, char **argv) case 'm': machine_name = optarg; break; + case 'w': + wait = atoi(optarg); + break; } } @@ -467,6 +473,9 @@ int main(int argc, char **argv) exit(1); } + if (wait >= 0) + g.interpreter_ready = !wait; + if (atcmd_init(&g, fd) < 0) { fprintf(stderr, "can't initialize UART device\n"); exit(1); -- cgit v1.2.3