From 30c802206150291d388c14d9588faf32804d4b18 Mon Sep 17 00:00:00 2001 From: erin_yueh Date: Wed, 12 Dec 2007 12:48:10 +0000 Subject: 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 --- src/util/shell.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/util') 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; } -- cgit v1.2.3