[Feature][ZXW-192]Add asynchronous setup_data_call interface

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

Change-Id: If97bccaeedba046911f9f2bb4743fa381f12133e
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
index 138514d..cae5273 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
@@ -834,7 +834,7 @@
 {
     int handle = -1;
     int ret = 0;
-    lynq_data_call_response_v11_t data_urc_info;
+    lynq_data_call_response_v11_t data_urc_info = {0};
     qser_data_call_state_s data_cb_state;
     while (s_qser_data_cb_thread_status)
     {
@@ -848,11 +848,16 @@
         {
             continue;
         }
-
+        LYINFLOG("[thread_wait_cb_status]: handle = %d", handle);
+        memset(&data_urc_info, 0, sizeof(data_urc_info));
+        memset(&data_cb_state, 0, sizeof(data_cb_state));
         lynq_get_data_call_list(&handle,&data_urc_info);
         /*compare paramter*/
         data_cb_state.profile_idx = (char)handle;
-
+        LYINFLOG("[thread_wait_cb_status]: status=%d, suggestedRetryTime=%d, cid=%d, active=%d, type=%s, ifname=%s, addresses=%s, dnses=%s, gateways=%s, pcscf=%s, mtu=%d\n",
+        data_urc_info.status, data_urc_info.suggestedRetryTime, data_urc_info.cid, data_urc_info.active, 
+        data_urc_info.type, data_urc_info.ifname, data_urc_info.addresses, data_urc_info.dnses, data_urc_info.gateways, data_urc_info.pcscf, 
+        data_urc_info.mtu);
         memcpy(data_cb_state.name,data_urc_info.ifname,strlen(data_urc_info.ifname)+1);
         if ((strcmp(data_urc_info.type,"IPV4") == 0) || (strcmp(data_urc_info.type,"IP") == 0))
         {
@@ -862,17 +867,16 @@
         {
             data_cb_state.ip_family = QSER_DATA_CALL_TYPE_IPV6;
         }
-        else if (strcmp(data_urc_info.type,"IPV4V6"))
+        else if (!strcmp(data_urc_info.type,"IPV4V6"))
         {
             data_cb_state.ip_family = QSER_DATA_CALL_TYPE_IPV4V6;
         }
         else
         {
-            LYERRLOG("unknow data call type");
-            continue;
+            LYERRLOG("unknow data call type: %s", data_urc_info.type);
         }
 
-        if (data_urc_info.status != 0)
+        if (data_urc_info.active != 0)
         {
             data_cb_state.state = QSER_DATA_CALL_CONNECTED;
         }
@@ -1037,6 +1041,44 @@
     return ret;
 }
 
+int qser_data_call_start_async(qser_data_call_s *data_call, qser_data_call_error_e *err)
+{
+    int ret = -1;
+    int handle = 0;
+    if (NULL == data_call || NULL == err)
+    {
+        LYERRLOG("call start incoming paramters error");
+        if(err != NULL)
+        {
+            *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
+        }
+        return ret;
+    }
+    if (data_call->profile_idx == 0)
+    {
+        ret = lynq_setup_data_call_sp_t106_async(&handle,"default","default",NULL,NULL,NULL,NULL,NULL);
+    }
+    else
+    {
+        char pdptype[16];
+        qser_apn_info_s apn_info;
+        ret = qser_apn_get(data_call->profile_idx,&apn_info);
+        if (ret != 0)
+        {
+            LYERRLOG("qser_apn_get error");
+            *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
+            return ret;
+        }
+        judge_pdp_type(apn_info.pdp_type,pdptype);
+        ret = lynq_setup_data_call_sp_t106_async(&handle,apn_info.apn_name,apn_info.apn_type,apn_info.username,apn_info.password,NULL,pdptype,pdptype);
+    }
+    if (ret != 0)
+    {
+        *err = QSER_DATA_CALL_ERROR_INVALID_PARAMS;
+    }
+    return ret;
+}
+
 int qser_data_call_stop(char profile_idx, qser_data_call_ip_family_e ip_family, qser_data_call_error_e *err)
 {
     int ret = 0;