summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorerin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-12 12:48:10 +0000
committererin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-12 12:48:10 +0000
commit30c802206150291d388c14d9588faf32804d4b18 (patch)
treef8b707fb50991afd2d49ba849f04a1cbafd47c81 /src/util
parent3a4c4251d068f481ddef3c355d8e0936c5b3440b (diff)
gsmd: 2nd try for retrieving PIN status (Erin Yueh)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3636 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r--src/util/shell.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/util/shell.c b/src/util/shell.c
index 34f7e12..fec445e 100644
--- a/src/util/shell.c
+++ b/src/util/shell.c
@@ -356,10 +356,6 @@ 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_PIN_GET_STATUS:
- payload = (char *)gmh + sizeof(*gmh);
- printf("%s\n", payload);
- break;
case GSMD_PHONE_POWERUP:
if (*intresult)
printf("Modem power-up failed: %i\n", *intresult);
@@ -382,11 +378,19 @@ static int phone_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
static int pin_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
{
int result = *(int *) gmh->data;
-
- if (result)
- printf("PIN error %i\n", result);
- else
- printf("PIN accepted!\n");
+ switch (gmh->msg_subtype) {
+ case GSMD_PIN_GET_STATUS:
+ printf("PIN STATUS: %i\n", result);
+ break;
+ case GSMD_PIN_INPUT:
+ if (result)
+ printf("PIN error %i\n", result);
+ else
+ printf("PIN accepted!\n");
+ break;
+ default:
+ return -EINVAL;
+ }
pending_responses --;
return 0;
}
personal git repositories of Harald Welte. Your mileage may vary