Fix network state change IND.
Change-Id: I27e36f4cf72735efd1c1bd07685e37ec53eb1e81
diff --git a/mbtk/mbtk_rild/src/main.c b/mbtk/mbtk_rild/src/main.c
index afff8d5..7a9cbdf 100755
--- a/mbtk/mbtk_rild/src/main.c
+++ b/mbtk/mbtk_rild/src/main.c
@@ -299,7 +299,7 @@
if(cgact_wait.cid != 0)
{
data_pdp = cgact_wait.cid + 200;
- urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
+ urc_msg_distribute(true, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
}
}
} else if(strStartsWith(s, "+CGEV: NW MODIFY ")) { // +CGEV: NW MODIFY 1,4
@@ -415,7 +415,7 @@
}
data_pdp = data[1] + 200;
- urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
+ urc_msg_distribute(true, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
data[1] = 0;
}
} else {
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index f935a65..9eb165c 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -6101,6 +6101,7 @@
return 0;
#else
+
if(async_process) {
info_urc_msg_t *urc = (info_urc_msg_t*)malloc(sizeof(info_urc_msg_t));
if(!urc)
@@ -6539,7 +6540,7 @@
}
*/
-static void net_ifc_state_change(bool act, int cid)
+static void net_ifc_state_change(bool act, int cid, mbtk_pdp_act_info_t *act_info)
{
if(cid < MBTK_APN_CID_MIN || cid > MBTK_APN_CID_MAX) { // No nothing for cid 1 and 8
return;
@@ -6588,6 +6589,12 @@
}
}
#endif
+
+ if(act_info) {
+ memcpy(&(act_info->ipv4), &ipv4, sizeof(mbtk_ipv4_info_t));
+ memcpy(&(act_info->ipv6), &ipv6, sizeof(mbtk_ipv6_info_t));
+ }
+
// Config IPv4 address.
if(ipv4.valid) {
char ip[20] = {0};
@@ -6663,14 +6670,20 @@
LOG("Active cid : %d", cid);
cgact_wait.waitting = true;
cgact_wait.cid = cid;
- net_ifc_state_change(false, cid);
+ net_ifc_state_change(false, cid, NULL);
data_pdp = cid + 100;
urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
req_data_call_start(cid, NULL);
wait_cgact_complete(10);
- net_ifc_state_change(true, cid);
+
+ mbtk_pdp_act_info_t act_info;
+ memset(&act_info, 0, sizeof(mbtk_pdp_act_info_t));
data_pdp = cid + 220;
- urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &data_pdp, sizeof(uint8));
+ act_info.state = data_pdp;
+
+ net_ifc_state_change(true, cid, &act_info);
+
+ urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &act_info, sizeof(mbtk_pdp_act_info_t));
}
}
at_process = false;
@@ -6697,7 +6710,28 @@
bool act = data[0];
int cid = data[1];
if(cid > 0) {
- net_ifc_state_change(act, cid);
+ net_ifc_state_change(act, cid, NULL);
+ }
+ break;
+ }
+ case INFO_URC_MSG_PDP_STATE:
+ {
+ // pdp_state_change
+ mbtk_pdp_act_info_t act_info;
+ memset(&act_info, 0, sizeof(mbtk_pdp_act_info_t));
+ int cme_err = MBTK_INFO_ERR_CME_NON;
+ uint8 cid = *((uint8*)(msg->data));
+ act_info.state = cid;
+#if 0
+ if(cid > 220) {
+ cid -= 220;
+ } else { // > 200
+ cid -= 200;
+ }
+#endif
+ if(!req_data_call_state_get(cid, &(act_info.ipv4), &(act_info.ipv6), &cme_err) && cme_err == MBTK_INFO_ERR_CME_NON)
+ {
+ pdp_state_change(&act_info, sizeof(mbtk_pdp_act_info_t));
}
break;
}