diff options
author | tick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-11-27 08:24:57 +0000 |
---|---|---|
committer | tick <tick@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-11-27 08:24:57 +0000 |
commit | ed45d021e84b497e75ff4342ad369c615cc174a3 (patch) | |
tree | 48da3b00a6f6c55e523ee9724b24eb3e7720a802 /src/util | |
parent | a78ac8ad867bb77c6bce88e66879e7afa8474301 (diff) |
gsmd: Refactorying get_imsi from PHONEBOOK to PHONE (tick)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@3519 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/shell.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/util/shell.c b/src/util/shell.c index 40dddaf..62e7b0f 100644 --- a/src/util/shell.c +++ b/src/util/shell.c @@ -131,11 +131,6 @@ static int pb_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh) nFIND = 0; break; - case GSMD_PHONEBOOK_GET_IMSI: - payload = (char *)gmh + sizeof(*gmh); - printf("imsi <%s>\n", payload); - pending_responses --; - break; default: return -EINVAL; } @@ -349,6 +344,20 @@ static int net_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh) } } +static int phone_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh) { + char *payload; + switch (gmh->msg_subtype) { + case GSMD_PHONE_GET_IMSI: + payload = (char *)gmh + sizeof(*gmh); + printf("imsi <%s>\n", payload); + pending_responses --; + break; + default: + return -EINVAL; + } + return 0; +} + static int shell_help(void) { printf( "\tA\tAnswer incoming call\n" @@ -405,6 +414,7 @@ int shell_main(struct lgsm_handle *lgsmh, int sync) lgsm_register_handler(lgsmh, GSMD_MSG_PHONEBOOK, &pb_msghandler); lgsm_register_handler(lgsmh, GSMD_MSG_SMS, &sms_msghandler); lgsm_register_handler(lgsmh, GSMD_MSG_NETWORK, &net_msghandler); + lgsm_register_handler(lgsmh, GSMD_MSG_PHONE, &phone_msghandler); fcntl(0, F_SETFD, O_NONBLOCK); fcntl(gsm_fd, F_SETFD, O_NONBLOCK); |