diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-17 08:34:52 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-17 08:34:52 +0000 |
commit | babd25d431a4453ce79f5281e1f7b0a39d2edbef (patch) | |
tree | cab19f4492cd0b3ee9d7e2f3b732a6858c8bc71d /src/gsmd | |
parent | 94bfe1d72a36b701430f5f73a71431f1c4881ef1 (diff) |
Wait for the AT Interpreter Ready message.
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2729 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/gsmd')
-rw-r--r-- | src/gsmd/gsmd.c | 11 |
1 files changed, 10 insertions, 1 deletions
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); |