update data_call callback param
Change-Id: I0ce6612fd1a792490063ad6db2482748b655b4f0
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
index 5c1469a..48d3a7a 100755
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -5709,6 +5709,19 @@
cid_active[cid] = 1;
mbtk_set_default_pdp_state(true, cid);
mbtk_qser_route_config(cid, &ipv4, &ipv6);
+#ifdef MBTK_ALL_CID_SUPPORT
+ if(cid == 1) //cid 1 as a special treatment
+ {
+ mbtk_pdp_cb_info_s pdp_cb_info;
+ memset(&pdp_cb_info, 0x00, sizeof(mbtk_pdp_cb_info_s));
+ pdp_cb_info.cid = cid;
+ pdp_cb_info.auto_urc = false;
+ pdp_cb_info.connect_state = true;
+ memcpy(&(pdp_cb_info.ipv4), &ipv4, sizeof(mbtk_ipv4_info_t));
+ memcpy(&(pdp_cb_info.ipv6), &ipv6, sizeof(mbtk_ipv6_info_t));
+ pack_rsp_send(cli_info->fd , MBTK_INFO_ID_IND_PDP_STATE_CHANGE, &pdp_cb_info, sizeof(mbtk_pdp_cb_info_s));
+ }
+#endif
if(cli_info->fd != DATA_CALL_BOOTCONN_FD)
{
mbtk_net_led_set(MBTK_NET_LED_DATA_CONNECT);
@@ -5738,8 +5751,8 @@
if(cid == 1)
{
char dev[20] = {0};
- uint8 pdp_data = cid + 100;
- pack_rsp_send(cli_info->fd , MBTK_INFO_ID_IND_PDP_STATE_CHANGE, &pdp_data, sizeof(uint8));
+ mbtk_pdp_cb_info_s pdp_cb_info;
+ memset(&pdp_cb_info, 0x00, sizeof(mbtk_pdp_cb_info_s));
sprintf(dev, "ccinet%d", cid - 1);
@@ -5749,6 +5762,11 @@
} else {
LOGD("Config %s IPv4 0 success.", dev);
}
+ pdp_cb_info.cid = cid;
+ pdp_cb_info.connect_state = false;
+ pdp_cb_info.auto_urc = false;
+ pack_rsp_send(cli_info->fd , MBTK_INFO_ID_IND_PDP_STATE_CHANGE, &pdp_cb_info, sizeof(mbtk_pdp_cb_info_s));
+
cid_active[cid] = 0;
mbtk_set_default_pdp_state(false, cid);
mbtk_net_led_set(MBTK_NET_LED_NET_CONNECT);
@@ -6765,7 +6783,7 @@
}
*/
-static void net_ifc_state_change(bool act, int cid, mbtk_pdp_act_info_t *act_info)
+static void net_ifc_state_change(bool act, int cid, mbtk_pdp_cb_info_s *pdp_cb_info)
{
if(cid < MBTK_APN_CID_MIN || cid > MBTK_APN_CID_MAX) { // No nothing for cid 1 and 8
return;
@@ -6815,9 +6833,9 @@
}
#endif
- if(act_info) {
- memcpy(&(act_info->ipv4), &ipv4, sizeof(mbtk_ipv4_info_t));
- memcpy(&(act_info->ipv6), &ipv6, sizeof(mbtk_ipv6_info_t));
+ if(pdp_cb_info) {
+ memcpy(&(pdp_cb_info->ipv4), &ipv4, sizeof(mbtk_ipv4_info_t));
+ memcpy(&(pdp_cb_info->ipv6), &ipv6, sizeof(mbtk_ipv6_info_t));
}
// Config IPv4 address.
@@ -6885,33 +6903,34 @@
#endif
// +CGACT
int cid;
- uint8 data_pdp = 0;
+ mbtk_pdp_cb_info_s pdp_cb_info;
LOGD("Start active APN.");
- at_process = true;
+ //at_process = true;
cgact_wait.act = true;
- for(cid = MBTK_APN_CID_MIN; cid <= MBTK_APN_CID_MAX; cid++) {
+ for(cid = MBTK_APN_CID_MIN; cid <= MBTK_APN_CID_MAX; cid++)
+ {
if(cid_active[cid])
{
LOG("Active cid : %d", cid);
+ memset(&pdp_cb_info, 0x00, sizeof(mbtk_pdp_cb_info_s));
cgact_wait.waitting = true;
cgact_wait.cid = 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));
+ pdp_cb_info.cid = cid;
+ pdp_cb_info.connect_state = false;
+ pdp_cb_info.auto_urc = true;
+ urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &pdp_cb_info, sizeof(mbtk_pdp_cb_info_s));
+
req_data_call_start(cid, NULL);
wait_cgact_complete(10);
-
- mbtk_pdp_act_info_t act_info;
- memset(&act_info, 0, sizeof(mbtk_pdp_act_info_t));
- data_pdp = cid + 220;
- 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));
+
+ net_ifc_state_change(true, cid, &pdp_cb_info);
+ pdp_cb_info.connect_state = true;
+ urc_msg_distribute(false, INFO_URC_MSG_PDP_STATE, &pdp_cb_info, sizeof(mbtk_pdp_cb_info_s));
}
}
- at_process = false;
+ //at_process = false;
}
static void urc_msg_process(info_urc_msg_t *msg)
@@ -6932,32 +6951,21 @@
}
case INFO_URC_MSG_CGEV:
{
- bool act = data[0];
- int cid = data[1];
- if(cid > 0) {
- net_ifc_state_change(act, cid, NULL);
- }
+ mbtk_pdp_cb_info_s *pdp_cb_info = (mbtk_pdp_cb_info_s *)(msg->data);
+ net_ifc_state_change(pdp_cb_info->connect_state, pdp_cb_info->cid, NULL);
+ pdp_state_change(pdp_cb_info, sizeof(mbtk_pdp_cb_info_s));
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));
+ //data call connect success
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)
+ mbtk_pdp_cb_info_s *pdp_cb_info = (mbtk_pdp_cb_info_s *)(msg->data);
+ if(req_data_call_state_get(pdp_cb_info->cid, &(pdp_cb_info->ipv4), &(pdp_cb_info->ipv6), &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
{
- pdp_state_change(&act_info, sizeof(mbtk_pdp_act_info_t));
+ LOGE("[%s] req_data_call_state_get() fail.[%d]", __func__, cme_err);
}
+ pdp_state_change(pdp_cb_info, sizeof(mbtk_pdp_cb_info_s));
break;
}
case INFO_URC_MSG_NET_PS_REG_STATE: