summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Wojak <uwojak@eltec.de>2014-10-30 10:17:51 +0100
committerJohn Crispin <blogic@openwrt.org>2014-10-30 11:49:13 +0100
commite353a88321ac091d0708bb2271a1bbb471107a69 (patch)
treefc17526154b5b30ea8a32ebd2d3dceb0c1583ac1
parent50c1e167be97a7d189c8322adca8f34625149f33 (diff)
Added command "--get-iccid" to read the SIM serial number.
-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 5373df7..563321e 100644
--- a/commands-dms.c
+++ b/commands-dms.c
@@ -127,6 +127,22 @@ cmd_dms_unblock_pin2_prepare(struct qmi_dev *qmi, struct qmi_request *req, struc
return QMI_CMD_REQUEST;
}
+static void cmd_dms_get_iccid_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+ struct qmi_dms_uim_get_iccid_response res;
+
+ qmi_parse_dms_uim_get_iccid_response(msg, &res);
+ if (res.data.iccid)
+ blobmsg_add_string(&status, NULL, res.data.iccid);
+}
+
+static enum qmi_cmd_result
+cmd_dms_get_iccid_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+ qmi_set_dms_uim_get_iccid_request(msg);
+ 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;
diff --git a/commands-dms.h b/commands-dms.h
index 2b9d83c..1f21b13 100644
--- a/commands-dms.h
+++ b/commands-dms.h
@@ -1,4 +1,4 @@
-#define __uqmi_dms_commands \
+#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), \
@@ -6,6 +6,7 @@
__uqmi_command(dms_unblock_pin2, unblock-pin2, no, QMI_SERVICE_DMS), \
__uqmi_command(dms_set_puk, puk, required, CMD_TYPE_OPTION), \
__uqmi_command(dms_set_new_pin, new-pin, required, CMD_TYPE_OPTION), \
+ __uqmi_command(dms_get_iccid, get-iccid, no, QMI_SERVICE_DMS), \
__uqmi_command(dms_get_imsi, get-imsi, no, QMI_SERVICE_DMS), \
__uqmi_command(dms_set_operating_mode, set-device-operating-mode, required, QMI_SERVICE_DMS), \
__uqmi_command(dms_reset, reset-dms, no, QMI_SERVICE_DMS) \
@@ -20,6 +21,7 @@
" --unblock-pin2: Unblock PIN2\n" \
" --puk <puk>: PUK needed to unblock\n" \
" --new-pin <new pin>: New pin\n" \
+ " --get-iccid: Get the ICCID\n" \
" --get-imsi: Get International Mobile Subscriber ID\n" \
" --reset-dms: Reset the DMS service\n" \
" --set-device-operating-mode <m> Set the device operating mode\n" \