[OpenWrt-Devel] [PATCH uqmi] Add command --get-msisdn for getting phone number

2014-11-18 Thread SÅ‚awomir Demeszko
---
For two SIM cards from the same operator (Plus GSM) I get error message:
Not provisioned, when try to get MSISDN. Real phone with these cards
inserted also cannot display a phone number. I can make calls normally.
And other two (different operators) works correctly.
Is anybody know why this happens?

 commands-dms.c | 16 
 commands-dms.h |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/commands-dms.c b/commands-dms.c
index 563321e..ad5c89d 100644
--- a/commands-dms.c
+++ b/commands-dms.c
@@ -159,6 +159,22 @@ cmd_dms_get_imsi_prepare(struct qmi_dev *qmi, struct 
qmi_request *req, struct qm
return QMI_CMD_REQUEST;
 }
 
+static void cmd_dms_get_msisdn_cb(struct qmi_dev *qmi, struct qmi_request 
*req, struct qmi_msg *msg)
+{
+   struct qmi_dms_get_msisdn_response res;
+
+   qmi_parse_dms_get_msisdn_response(msg, res);
+   if (res.data.msisdn)
+   blobmsg_add_string(status, NULL, res.data.msisdn);
+}
+
+static enum qmi_cmd_result
+cmd_dms_get_msisdn_prepare(struct qmi_dev *qmi, struct qmi_request *req, 
struct qmi_msg *msg, char *arg)
+{
+   qmi_set_dms_get_msisdn_request(msg);
+   return QMI_CMD_REQUEST;
+}
+
 #define cmd_dms_reset_cb no_cb
 static enum qmi_cmd_result
 cmd_dms_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct 
qmi_msg *msg, char *arg)
diff --git a/commands-dms.h b/commands-dms.h
index 1f21b13..c20d007 100644
--- a/commands-dms.h
+++ b/commands-dms.h
@@ -8,6 +8,7 @@
__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_get_msisdn, get-msisdn, 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) \
 
@@ -23,6 +24,7 @@
--new-pin new pin:New pin\n \
  --get-iccid:  Get the ICCID\n \
  --get-imsi:   Get International Mobile 
Subscriber ID\n \
+  --get-msisdn: Get the MSISDN (telephone number)\n \
  --reset-dms:  Reset the DMS service\n \
  --set-device-operating-mode m   Set the device operating 
mode\n \
(modes: online, low_power, 
factory_test, offline\n \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH uqmi] Add command --get-msisdn for getting phone number

2014-11-18 Thread John Crispin


On 18/11/2014 17:02, SÅ‚awomir Demeszko wrote:
 --- For two SIM cards from the same operator (Plus GSM) I get error
 message: Not provisioned, when try to get MSISDN. Real phone with
 these cards inserted also cannot display a phone number. I can make
 calls normally. And other two (different operators) works
 correctly. Is anybody know why this happens?


Hi,

i tested this on my eplus sim card and it seems to work well. looking
at the code it also look correct. i will merge the patch in the hope
that this is related to the sim card and/or modem and not the actual
qmi call. if you figure out anything new related to this don't forget
to send an update please.

John

 
 commands-dms.c | 16  commands-dms.h |  2 ++ 2 files
 changed, 18 insertions(+)
 
 diff --git a/commands-dms.c b/commands-dms.c index 563321e..ad5c89d
 100644 --- a/commands-dms.c +++ b/commands-dms.c @@ -159,6 +159,22
 @@ cmd_dms_get_imsi_prepare(struct qmi_dev *qmi, struct qmi_request
 *req, struct qm return QMI_CMD_REQUEST; }
 
 +static void cmd_dms_get_msisdn_cb(struct qmi_dev *qmi, struct
 qmi_request *req, struct qmi_msg *msg) +{ +   struct
 qmi_dms_get_msisdn_response res; + +
 qmi_parse_dms_get_msisdn_response(msg, res); +   if
 (res.data.msisdn) +   blobmsg_add_string(status, NULL,
 res.data.msisdn); +} + +static enum qmi_cmd_result 
 +cmd_dms_get_msisdn_prepare(struct qmi_dev *qmi, struct qmi_request
 *req, struct qmi_msg *msg, char *arg) +{ +
 qmi_set_dms_get_msisdn_request(msg); +return QMI_CMD_REQUEST; +} 
 + #define cmd_dms_reset_cb no_cb static enum qmi_cmd_result 
 cmd_dms_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req,
 struct qmi_msg *msg, char *arg) diff --git a/commands-dms.h
 b/commands-dms.h index 1f21b13..c20d007 100644 ---
 a/commands-dms.h +++ b/commands-dms.h @@ -8,6 +8,7 @@ 
 __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_get_msisdn, get-msisdn,
 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) \
 
 @@ -23,6 +24,7 @@ --new-pin new pin:New pin\n
 \   --get-iccid:  Get the ICCID\n \ 
 --get-imsi:   Get International Mobile
 Subscriber ID\n \ +  --get-msisdn: Get
 the MSISDN (telephone number)\n \   --reset-dms:
 Reset the DMS service\n \   --set-device-operating-mode m   Set
 the device operating mode\n \ 
 (modes: online, low_power, factory_test, offline\n \
 
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel