From 5cd3cb1f9209e6dbdf19c02417e87791b8349a5c Mon Sep 17 00:00:00 2001 From: tick Date: Mon, 12 Nov 2007 09:41:54 +0000 Subject: gsmd: adding sleep mode into libgsmd-tool shell mode(Tick) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3393 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/shell.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/util') diff --git a/src/util/shell.c b/src/util/shell.c index 0e77c44..4f133d3 100644 --- a/src/util/shell.c +++ b/src/util/shell.c @@ -346,6 +346,7 @@ static int shell_help(void) "\tP\tPrint current operator\n" "\tL\tDetect available operators\n" "\tQ\tRead signal quality\n" + "\tS\tSleep (S[=second], default 5)\n" "\tT\tSend DTMF Tone\n" "\tn\tPrint subscriber numbers\n" "\tpd\tPB Delete (pb=index)\n" @@ -473,6 +474,14 @@ int shell_main(struct lgsm_handle *lgsmh) lgsm_signal_quality(lgsmh); } else if (!strcmp(buf, "q")) { exit(0); + } else if (buf[0] == 'S' ) { + if(!strchr(buf,'=') || atoi((strchr(buf,'=')+1)) < 0) { + printf("Sleep 5 secs\n"); + sleep(5); + }else { + printf("Sleep %d secs\n",atoi(strchr(buf,'=')+1)); + sleep(atoi(strchr(buf,'=')+1)); + } } else if (buf[0] == 'T') { if (strlen(buf) < 2) continue; -- cgit v1.2.3