summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorerin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2008-02-15 11:10:16 +0000
committererin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2008-02-15 11:10:16 +0000
commit9425af516e374f787bcb20244d931e7a355fd0f8 (patch)
tree1643a2db6e3d5c3dd57670e4ba4fb5e8c935d88e /src/util
parentcabd52f1f0682bac467126e45b56680936c77e0b (diff)
gsmd: add retrieving phone info (Erin Yueh)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@4067 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r--src/util/shell.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/util/shell.c b/src/util/shell.c
index b7d65f5..0601e6d 100644
--- a/src/util/shell.c
+++ b/src/util/shell.c
@@ -400,6 +400,22 @@ static int phone_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
payload = (char *)gmh + sizeof(*gmh);
printf("imsi <%s>\n", payload);
break;
+ case GSMD_PHONE_GET_MANUF:
+ payload = (char *)gmh + sizeof(*gmh);
+ printf("manufacturer: %s\n", payload);
+ break;
+ case GSMD_PHONE_GET_MODEL:
+ payload = (char *)gmh + sizeof(*gmh);
+ printf("model: %s\n", payload);
+ break;
+ case GSMD_PHONE_GET_REVISION:
+ payload = (char *)gmh + sizeof(*gmh);
+ printf("revision: %s\n", payload);
+ break;
+ case GSMD_PHONE_GET_SERIAL:
+ payload = (char *)gmh + sizeof(*gmh);
+ printf("serial: %s\n", payload);
+ break;
case GSMD_PHONE_POWERUP:
if (*intresult)
printf("Modem power-up failed: %i\n", *intresult);
@@ -551,6 +567,10 @@ static void shell_help(void)
"\tgvm\tGet Voicemail number\n"
"\tsvm\tSet Voicemail number(svm=number)\n"
"\tim\tGet imsi\n"
+ "\tmf\tGet manufacturer\n"
+ "\tml\tGet model\n"
+ "\trv\tGet revision\n"
+ "\tsn\tGet serial number\n"
"\tcs\tGet Call status\n"
"\tgp\tGet PIN status\n"
"\tRh\tRelease all held calls (+CHLD=0)\n"
@@ -864,6 +884,22 @@ int shell_main(struct lgsm_handle *lgsmh, int sync)
printf("Get imsi\n");
lgsm_get_imsi(lgsmh);
pending_responses ++;
+ } else if (!strncmp(buf, "mf", 2)) {
+ printf("Get manufacturer\n");
+ lgsm_get_manufacturer(lgsmh);
+ pending_responses ++;
+ } else if (!strncmp(buf, "ml", 2)) {
+ printf("Get model\n");
+ lgsm_get_model(lgsmh);
+ pending_responses ++;
+ } else if (!strncmp(buf, "rv", 2)) {
+ printf("Get revision\n");
+ lgsm_get_revision(lgsmh);
+ pending_responses ++;
+ } else if (!strncmp(buf, "sn", 2)) {
+ printf("Get serial number\n");
+ lgsm_get_serial(lgsmh);
+ pending_responses ++;
} else if ( strlen(buf)==1 && !strncmp(buf, "M", 1)) {
printf("Modem Power On\n");
lgsm_modem_power(lgsmh, 1);
personal git repositories of Harald Welte. Your mileage may vary