r3498 - trunk/src/target/gsm/src/util
mickey at sita.openmoko.org
mickey at sita.openmoko.org
Fri Nov 23 21:30:34 CET 2007
Author: mickey
Date: 2007-11-23 21:30:33 +0100 (Fri, 23 Nov 2007)
New Revision: 3498
Modified:
trunk/src/target/gsm/src/util/event.c
trunk/src/target/gsm/src/util/libgsmd-tool.c
trunk/src/target/gsm/src/util/shell.c
Log:
gsmd: fix typos and indentation
Modified: trunk/src/target/gsm/src/util/event.c
===================================================================
--- trunk/src/target/gsm/src/util/event.c 2007-11-23 20:17:13 UTC (rev 3497)
+++ trunk/src/target/gsm/src/util/event.c 2007-11-23 20:30:33 UTC (rev 3498)
@@ -238,7 +238,7 @@
if(aux->u.cme_err.number)
printf("cme error: %u\n", aux->u.cme_err.number);
else if(aux->u.cms_err.number)
- printf("cme error: %u\n", aux->u.cms_err.number);
+ printf("cms error: %u\n", aux->u.cms_err.number);
return 0;
}
Modified: trunk/src/target/gsm/src/util/libgsmd-tool.c
===================================================================
--- trunk/src/target/gsm/src/util/libgsmd-tool.c 2007-11-23 20:17:13 UTC (rev 3497)
+++ trunk/src/target/gsm/src/util/libgsmd-tool.c 2007-11-23 20:30:33 UTC (rev 3498)
@@ -94,7 +94,7 @@
char *pin = NULL;
int rc, i, mode, shellwait = 0;
- printf("libgsm-tool - (C) 2006 by Harald Welte\n"
+ printf("libgsm-tool - (C) 2006-2007 by Harald Welte and OpenMoko, Inc.\n"
"This program is Free Software and has ABSOLUTELY NO WARRANTY\n\n");
while (1) {
Modified: trunk/src/target/gsm/src/util/shell.c
===================================================================
--- trunk/src/target/gsm/src/util/shell.c 2007-11-23 20:17:13 UTC (rev 3497)
+++ trunk/src/target/gsm/src/util/shell.c 2007-11-23 20:30:33 UTC (rev 3498)
@@ -354,17 +354,17 @@
printf( "\tA\tAnswer incoming call\n"
"\tD\tDial outgoing number\n"
"\tH\tHangup call\n"
- "\tO\tPower On\n"
- "\to\tPower Off\n"
+ "\tO\tAntenna Power On\n"
+ "\to\tAntenna Power Off\n"
"\tM\tModem Power On\n"
"\tm\tModem Power Off\n"
"\tr\tRegister to network\n"
"\tR\tRegister to given operator (R=number)\n"
"\tU\tUnregister from netowrk\n"
"\tP\tPrint current operator\n"
- "\tL\tDetect available operators\n"
+ "\tL\tList available operators\n"
"\tQ\tRead signal quality\n"
- "\tS\tSleep (S[=second], default 5)\n"
+ "\tS\tSleep (S[=second], default 5)\n"
"\tT\tSend DTMF Tone\n"
"\tn\tPrint subscriber numbers\n"
"\tpd\tPB Delete (pb=index)\n"
@@ -426,7 +426,7 @@
* on to the library */
rc = read(gsm_fd, buf, sizeof(buf));
if (rc <= 0) {
- printf("ERROR reding from gsm_fd\n");
+ printf("ERROR reading from gsm_fd\n");
break;
}
rc = lgsm_handle_packet(lgsmh, buf, rc);
@@ -495,14 +495,14 @@
pending_responses ++;
} 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] == '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;
@@ -610,18 +610,16 @@
strncpy(sms.addr, fcomma+1, lcomma-fcomma-1);
sms.addr[lcomma-fcomma-1] = '\0';
/* todo define \" to allow " in text */
- if (lcomma[1]=='"' &&
- !strchr(lcomma+2, '"')) {
- /* read until closing '"' */
- rc = fscanf(stdin, "%[^\"]\"",
- lcomma+strlen(lcomma));
- if (rc == EOF) {
- printf("EOF\n");
- return -1;
- }
- /* remove brackets */
- lcomma++;
- lcomma[strlen(lcomma)] = '\0';
+ if (lcomma[1]=='"' && !strchr(lcomma+2, '"')) {
+ /* read until closing '"' */
+ rc = fscanf(stdin, "%[^\"]\"", lcomma+strlen(lcomma));
+ if (rc == EOF) {
+ printf("EOF\n");
+ return -1;
+ }
+ /* remove brackets */
+ lcomma++;
+ lcomma[strlen(lcomma)] = '\0';
}
printf("Send SMS\n");
packing_7bit_character(lcomma+1, &sms);
@@ -677,12 +675,12 @@
printf("Get imsi\n");
lgsm_get_imsi(lgsmh);
pending_responses ++;
- } else if (!strncmp(buf, "M", 1)) {
- printf("Modem Power On\n");
- lgsm_modem_power(lgsmh, 1);
- } else if (!strncmp(buf, "m", 1)) {
- printf("Modem Power Off\n");
- lgsm_modem_power(lgsmh, 0);
+ } else if (!strncmp(buf, "M", 1)) {
+ printf("Modem Power On\n");
+ lgsm_modem_power(lgsmh, 1);
+ } else if (!strncmp(buf, "m", 1)) {
+ printf("Modem Power Off\n");
+ lgsm_modem_power(lgsmh, 0);
} else {
printf("Unknown command `%s'\n", buf);
}
More information about the commitlog
mailing list