Added command "--get-iccid" to read the SIM serial number.
authorUwe Wojak <uwojak@eltec.de>
Thu, 30 Oct 2014 09:17:51 +0000 (10:17 +0100)
committerJohn Crispin <blogic@openwrt.org>
Thu, 30 Oct 2014 10:49:13 +0000 (11:49 +0100)
commands-dms.c
commands-dms.h

index 5373df7de8928e7942b593e2e9e87811964b2a7c..563321e5c76bbece2f2bc3eea3dc1c0ce57081fe 100644 (file)
@@ -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;
index 2b9d83c98fdd12507193bcc31889b3b9c1fd6149..1f21b1361d0ad5fab4cfee8a2f900bae335774eb 100644 (file)
@@ -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" \