data_call: fix no Internet connection after redialing
Change-Id: Ic98d1b6ea57689a34d3f604d7febc1c0483a4a91
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
old mode 100644
new mode 100755
index 1eccc1b..a5ebae0
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -6349,36 +6349,6 @@
return NULL;
}
-static void data_call_restart()
-{
-#if 0
- // Waitting for network ok.
- mbtk_net_info_t info;
- int cme_err;
- int i = 0;
- while(i < 15) { // 15s timeout
- cme_err = MBTK_INFO_ERR_CME_NON;
- memset(&info, 0, sizeof(mbtk_net_info_t));
- if(!req_net_sel_mode_get(&info, &cme_err) && cme_err == MBTK_INFO_ERR_CME_NON)
- {
- if(info.net_type >= 2) {
- break;
- }
- }
-
- sleep(1);
- i++;
- }
-#endif
- // +CGACT
- int cid;
- LOGD("Start active APN.");
- for(cid = MBTK_APN_CID_MIN; cid <= MBTK_APN_CID_MAX && cid_active[cid]; cid++) {
- LOG("Active cid : %d", cid);
- req_data_call_start(cid, NULL);
- }
-}
-
/*
void mbtk_radio_ready_cb()
{
@@ -6406,6 +6376,7 @@
return;
}
+#if 0
if(act)
{
cid_active[cid] = 1;
@@ -6416,6 +6387,7 @@
cid_active[cid] = 0;
mbtk_set_default_pdp_state(false, cid);
}
+#endif
char dev[20] = {0};
sprintf(dev, "ccinet%d", cid - 1);
if(act) { // Config IP.
@@ -6477,6 +6449,8 @@
LOGD("Config %s IPv6 %s success.", dev, ip);
}
}
+
+ mbtk_qser_route_config(cid, &ipv4, &ipv6);
}
} else { // Del IP
if(mbtk_ifc_configure2(dev, NULL, 0, NULL, NULL)) {
@@ -6487,6 +6461,44 @@
}
}
+static void data_call_restart()
+{
+#if 0
+ // Waitting for network ok.
+ mbtk_net_info_t info;
+ int cme_err;
+ int i = 0;
+ while(i < 15) { // 15s timeout
+ cme_err = MBTK_INFO_ERR_CME_NON;
+ memset(&info, 0, sizeof(mbtk_net_info_t));
+ if(!req_net_sel_mode_get(&info, &cme_err) && cme_err == MBTK_INFO_ERR_CME_NON)
+ {
+ if(info.net_type >= 2) {
+ break;
+ }
+ }
+
+ sleep(1);
+ i++;
+ }
+#endif
+ // +CGACT
+ int cid;
+ LOGD("Start active APN.");
+ at_process = true;
+ cgact_wait.act = true;
+ for(cid = MBTK_APN_CID_MIN; cid <= MBTK_APN_CID_MAX && cid_active[cid]; cid++) {
+ LOG("Active cid : %d", cid);
+ cgact_wait.waitting = true;
+ cgact_wait.cid = cid;
+ net_ifc_state_change(false, cid);
+ req_data_call_start(cid, NULL);
+ wait_cgact_complete(10);
+ net_ifc_state_change(true, cid);
+ }
+ at_process = false;
+}
+
static void urc_msg_process(info_urc_msg_t *msg)
{
uint8 *data = NULL;