From df2acb0b0e907082be5157b326a063c3387107f9 Mon Sep 17 00:00:00 2001 From: tick Date: Wed, 31 Oct 2007 06:42:58 +0000 Subject: gsmd: Adding IMSI support (Jim Rayner) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3309 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/gsmd/usock.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/gsmd') diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c index a07fd6f..5b7edd4 100644 --- a/src/gsmd/usock.c +++ b/src/gsmd/usock.c @@ -1317,6 +1317,26 @@ static int phonebook_list_storage_cb(struct gsmd_atcmd *cmd, return 0; } +static int get_imsi_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp) +{ + struct gsmd_user *gu = ctx; + struct gsmd_ucmd *ucmd; + + DEBUGP("resp: %s\n", resp); + + ucmd = gsmd_ucmd_fill(strlen(resp)+1, GSMD_MSG_PHONEBOOK, + GSMD_PHONEBOOK_GET_IMSI, 0); + if (!ucmd) + return -ENOMEM; + + strcpy(ucmd->buf, resp); + + usock_cmd_enqueue(ucmd, gu); + + return 0; +} + + static int usock_rcv_phonebook(struct gsmd_user *gu, struct gsmd_msg_hdr *gph,int len) { @@ -1491,6 +1511,11 @@ static int usock_rcv_phonebook(struct gsmd_user *gu, usock_cmd_enqueue(ucmd, gu); break; + + case GSMD_PHONEBOOK_GET_IMSI: + cmd = atcmd_fill("AT+CIMI", 7 + 1, &get_imsi_cb, gu, 0); + break; + default: return -EINVAL; } -- cgit v1.2.3