summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-02-18 02:43:12 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-02-18 02:43:12 +0100
commit74aa03cc358f7da62fd5977904fa4acaf916fdea (patch)
tree379da4db6ac57c684ddcda33f3564ee5f35b60d4
parent7f749c770b4c4ea9e99efecb35e03d0c6e46d3fb (diff)
add a command to get the imsi
-rw-r--r--commands-dms.c16
-rw-r--r--commands-dms.h4
2 files changed, 19 insertions, 1 deletions
diff --git a/commands-dms.c b/commands-dms.c
index 483dea0..f26b066 100644
--- a/commands-dms.c
+++ b/commands-dms.c
@@ -71,3 +71,19 @@ cmd_dms_verify_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct
qmi_set_dms_uim_verify_pin_request(msg, &data);
return QMI_CMD_REQUEST;
}
+
+static void cmd_dms_get_imsi_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+ struct qmi_dms_uim_get_imsi_response res;
+
+ qmi_parse_dms_uim_get_imsi_response(msg, &res);
+ if (res.data.imsi)
+ blobmsg_add_string(&status, "number", res.data.imsi);
+}
+
+static enum qmi_cmd_result
+cmd_dms_get_imsi_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+ qmi_set_dms_uim_get_imsi_request(msg);
+ return QMI_CMD_REQUEST;
+}
diff --git a/commands-dms.h b/commands-dms.h
index 14949cf..ebad9cb 100644
--- a/commands-dms.h
+++ b/commands-dms.h
@@ -1,10 +1,12 @@
#define __uqmi_dms_commands \
__uqmi_command(dms_get_pin_status, get-pin-status, no, QMI_SERVICE_DMS), \
__uqmi_command(dms_verify_pin1, verify-pin1, required, QMI_SERVICE_DMS), \
- __uqmi_command(dms_verify_pin2, verify-pin2, required, QMI_SERVICE_DMS) \
+ __uqmi_command(dms_verify_pin2, verify-pin2, required, QMI_SERVICE_DMS), \
+ __uqmi_command(dms_get_imsi, get-imsi, no, QMI_SERVICE_DMS) \
#define dms_helptext \
" --get-pin-status: Get PIN verification status\n" \
" --verify-pin1: Verify PIN1\n" \
" --verify-pin2: Verify PIN2\n" \
+ " --get-imsi: Get International Mobile Subscriber ID\n" \