summaryrefslogtreecommitdiff
path: root/src/gsmd
diff options
context:
space:
mode:
authorerin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-10 06:36:38 +0000
committererin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2007-12-10 06:36:38 +0000
commitccfdb913d1a78e349c1ceabcfa392c086c454178 (patch)
tree570bf7b768f423ababd196b7939904feb1ff7f1a /src/gsmd
parent41c5469e5688149d38eb86d7b7d589c19a674fa1 (diff)
gsmd: Bug 1082 - PIN Status Missing (Erin Yueh)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3621 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/gsmd')
-rw-r--r--src/gsmd/usock.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c
index fd602b5..76adc9b 100644
--- a/src/gsmd/usock.c
+++ b/src/gsmd/usock.c
@@ -383,6 +383,14 @@ static int get_imsi_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
cmd->id, strlen(resp) + 1, resp);
}
+static int get_cpin_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
+{
+ DEBUGP("resp: %s\n", resp);
+
+ return gsmd_ucmd_submit(ctx, GSMD_MSG_PHONE, GSMD_PIN_GET_STATUS,
+ cmd->id, strlen(resp) + 1, resp);
+}
+
static int usock_rcv_phone(struct gsmd_user *gu, struct gsmd_msg_hdr *gph,
int len)
{
@@ -402,7 +410,10 @@ static int usock_rcv_phone(struct gsmd_user *gu, struct gsmd_msg_hdr *gph,
case GSMD_PHONE_GET_IMSI:
cmd = atcmd_fill("AT+CIMI", 7 + 1, &get_imsi_cb, gu, 0, NULL);
break;
-
+
+ case GSMD_PIN_GET_STATUS:
+ cmd = atcmd_fill("AT+CPIN?", 8 + 1, &get_cpin_cb, gu, 0, NULL);
+ break;
default:
return -EINVAL;
}
personal git repositories of Harald Welte. Your mileage may vary