From ce08f5ee38bca622527551b28678f4e3a283fca1 Mon Sep 17 00:00:00 2001 From: tick Date: Tue, 20 Nov 2007 04:19:04 +0000 Subject: [gsmd] Adding waiting mode for libgsmd-tool shell. (Andrzej Zaborowski) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3448 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/libgsmd-tool.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/util/libgsmd-tool.c') diff --git a/src/util/libgsmd-tool.c b/src/util/libgsmd-tool.c index c48bf8e..d29dfdc 100644 --- a/src/util/libgsmd-tool.c +++ b/src/util/libgsmd-tool.c @@ -74,6 +74,7 @@ static struct option opts[] = { { "verbose", 0, 0, 'v' }, { "mode", 1, 0, 'm' }, { "pin", 1, 0, 'p' }, + { "wait", 0, 0, 'w' }, { 0, 0, 0, 0 } }; @@ -84,20 +85,21 @@ static void help(void) "\t-V\t--version\tPrint version number\n" "\t-v\t--verbose\tBe more verbose\n" "\t-m\t--mode\tSet mode {shell,eventlog,atcmd}\n" + "\t-w\t--wait\tIn shell mode wait for responses on exit\n" ); } int main(int argc, char **argv) { char *pin = NULL; - int rc, i, mode; + int rc, i, mode, shellwait = 0; printf("libgsm-tool - (C) 2006 by Harald Welte\n" "This program is Free Software and has ABSOLUTELY NO WARRANTY\n\n"); while (1) { int c, option_index = 0; - c = getopt_long(argc, argv, "vVhm:p:", opts, &option_index); + c = getopt_long(argc, argv, "vVhwm:p:", opts, &option_index); if (c == -1) break; @@ -122,6 +124,9 @@ int main(int argc, char **argv) case 'p': pin = optarg; break; + case 'w': + shellwait = 1; + break; } } @@ -139,7 +144,7 @@ int main(int argc, char **argv) atcmd_main(lgsmh); break; case MODE_SHELL: - shell_main(lgsmh); + shell_main(lgsmh, shellwait); break; } -- cgit v1.2.3