[Bugfix][T106BUG-19]fix reset modem bug

    Only Configure:No
    Affected branch:master
    Affected module:No
    Is it affected on both ZXIC and MTK: only ZXIC
    Self-test: Yes
    Doc Update: No

Change-Id: I2b45491fdbf88c5d4ec9c57c8bb42b8b14d03ff5
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-sim/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-sim/makefile
index 5e40ec5..d28dbcb 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-sim/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-sim/makefile
@@ -14,7 +14,7 @@
 
 
 ifeq ($(strip $(TARGET_PLATFORM)), T106)
-LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0
+LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1 -DHAVE_ENDIAN_H -DHAVE_PTHREADS -DHAVE_SYS_UIO_H -DHAVE_POSIX_FILEMAP -DHAVE_STRLCPY -DHAVE_PRCTL -DHAVE_MEMSET16 -DHAVE_MEMSET32 -DANDROID_SMP=0 -DMOBILETEK_TARGET_PLATFORM_T106 
 endif
 
 $(warning ################# lynq sim ROOT: $(ROOT),includedir:$(includedir))
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-sim/src/lynq_sim.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-sim/src/lynq_sim.cpp
index 433764a..a32d152 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-sim/src/lynq_sim.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-sim/src/lynq_sim.cpp
@@ -788,6 +788,29 @@
     return;
 }
 
+#ifdef MOBILETEK_TARGET_PLATFORM_T106
+
+int lynq_reset_modem(void)
+{
+    if(g_lynq_sim_init_flag == 0)
+    {
+        return -1;
+    }
+
+    Parcel p;
+    int res = lynq_send_common_request(&p,RIL_REQUEST_RESET_RADIO,0,1,"");
+
+    if(res != 0)
+    {
+        RLOGD("function %s execute error", __FUNCTION__);
+        return res;
+    }
+
+    return res;
+
+}
+
+#else
 int lynq_reset_modem(void)
 {
     if(g_lynq_sim_init_flag == 0)
@@ -814,7 +837,7 @@
     RLOGD("function %s ret %d",__FUNCTION__, ret);
     return ret;
 }
-
+#endif
 /**
  * @brief                   handle shutdown buf
  * @param  options          type: [IN]My Param doc
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/lynq.h b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/lynq.h
index 0862651..a096d09 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/lynq.h
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/lynq.h
@@ -23,6 +23,8 @@
 #define LYNQ_LIST_SMS LYNQ_SMS + 5
 #define LYNQ_DELETE_SMS LYNQ_SMS + 6
 #define LYNQ_WAIT_SMS LYNQ_SMS + 7
+#define LYNQ_GET_SMSC_ADDRESS LYNQ_SMS + 8
+#define LYNQ_SET_SMSC_ADDRESS  LYNQ_SMS + 9
 
 #define LYNQ_NETWORK LYNQ_BASE + 30
 #define LYNQ_NETWORK_INIT LYNQ_NETWORK + 1
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/req_commands.h b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/req_commands.h
index 2151052..7254719 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/req_commands.h
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/req_commands.h
@@ -11,6 +11,8 @@
     {"LYNQ_LIST_SMS",list_sms, "list short message", LYNQ_LIST_SMS},
     {"LYNQ_DELETE_SMS",delete_sms, "delete short messsage", LYNQ_DELETE_SMS},
     {"LYNQ_WAIT_SMS",wait_sms, "wait short messsage", LYNQ_WAIT_SMS},
+    {"LYNQ_GET_SMSC_ADDRESS",get_smsc_address, "get smsc address", LYNQ_GET_SMSC_ADDRESS},
+    {"LYNQ_SET_SMSC_ADDRESS",set_smsc_address, "set smsc address", LYNQ_SET_SMSC_ADDRESS},
 //NETWORK
     {"LYNQ_NETWORK_INIT",init_network, "init the network lib", LYNQ_NETWORK_INIT},
     {"LYNQ_NETWORK_DEINIT",deinit_network, "deinit the network lib", LYNQ_NETWORK_DEINIT},
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.cpp b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.cpp
index ab1e4e7..cc1e461 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.cpp
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.cpp
@@ -47,7 +47,8 @@
     char iccid[SIM_BUF] = "";
     ret = lynq_get_iccid(iccid);
     printf("%s%d\n",TEST_RESULT,ret);
-    printf("[%s-%d] ICCID:%d\n", __FUNCTION__, __LINE__, iccid);
+    if(!ret)
+        printf("[%s-%d] ICCID:%s\n", __FUNCTION__, __LINE__, iccid);
 
     return ret;
 }
@@ -189,6 +190,15 @@
     return ret;
 }
 
+int reset_modem(int argc, char *argv[], int sp_test)
+{
+    printf("[%s][%d] enter!\n",__FUNCTION__,__LINE__);
+    char buf[128] = "";
+    int ret = -1;
+    ret = lynq_reset_modem();
+    printf("%s%d\n",TEST_RESULT,ret);
+    return ret;
+}
 
 //qser api
 sim_client_handle_type  ph_sim;
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.h b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.h
index 93fd530..ce6a254 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.h
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sim.h
@@ -17,6 +17,7 @@
 int query_phone_number_test(int argc, char *argv[], int sp_test);
 int deinit_sim(int argc, char *argv[], int sp_test);
 int get_version(int argc, char *argv[], int sp_test);
+int reset_modem(int argc, char *argv[], int sp_test);
 
 //QSER SIM
 int qser_init_sim(int argc, char *argv[], int sp_test);
diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.cpp b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.cpp
index 819fd38..c78a285 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.cpp
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.cpp
@@ -82,6 +82,30 @@
     return ret;

 }

 

+int get_smsc_address(int argc, char *argv[], int sp_test)

+{

+    printf("[%s][%d] enter!\n",__FUNCTION__,__LINE__);

+    int ret = -1;

+    //int handle = atoi(argv[1]);

+    char service_num[22] = "";

+    ret = lynq_get_smsc_address(service_num);

+    printf("%s%d\n",TEST_RESULT,ret);

+    printf("LYNQ_GET_SMSC_ADDRESS: %s\n", service_num);

+    return ret;

+}

+

+int set_smsc_address(int argc, char *argv[], int sp_test)

+{

+    printf("[%s][%d] enter!\n",__FUNCTION__,__LINE__);

+    int ret = -1;

+    //int handle = atoi(argv[1]);

+    char service_num[22] = "";

+    strncpy(service_num, argv[1], 22);

+    ret = lynq_set_smsc_address(service_num);

+    printf("%s%d\n",TEST_RESULT,ret);

+    return ret;

+}

+

 //QSER API

 sms_client_handle_type  ph_sms;

 int qser_init_sms(int argc, char *argv[], int sp_test)

diff --git a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.h b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.h
index 8dcb735..307ff56 100755
--- a/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.h
+++ b/cap/zx297520v3/src/lynq/packages/apps/Mobiletek_Tester_RDIT/sms.h
@@ -6,7 +6,8 @@
 int list_sms(int argc, char *argv[], int sp_test);

 int delete_sms(int argc, char *argv[], int sp_test);

 int wait_sms(int argc, char *argv[], int sp_test);

-

+int get_smsc_address(int argc, char *argv[], int sp_test);

+int set_smsc_address(int argc, char *argv[], int sp_test);

 //QSER SMS

 int qser_init_sms(int argc, char *argv[], int sp_test);

 int qser_deinit_sms(int argc, char *argv[], int sp_test);