[Feature][S300][task-view-1920][app] fix BJMTN locknet dial error

Change-Id: I79f4691c32ca00eb356ef08fb84ce0511c8db3e3
diff --git a/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c b/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c
index 57944da..67ea375 100755
--- a/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c
+++ b/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c
@@ -88,6 +88,8 @@
 #endif

 extern struct defcid_mng_t g_defcid_mng;

 char imsi[50] = {0};

+extern int is_valid_plmn(char *mcc, char *mnc);

+extern int mccmnc_empty_flag;

 //zdm ÇëÕ×·áÈ·ÈÏÊÇ·ñÐèҪͬ²½µ½AP²à

 //ºóÐøÓÃËøÍøÌæ´ú£¬ÆÕͨ°æ±¾²»Ëø

 char* zurdy_convert_cmd(void *msg,struct at_context *context)

@@ -1977,6 +1979,8 @@
 	char needCopsNumFormat[10] = {0};

 	T_zAt_CopsReadRes  copsReadPara = {0};

 	T_zAt_OperatorName operatorName = {0};

+    int ret = 0;

+    char ppp_status[20] = {0};

 	

 	void *p[5] = {&copsReadPara.mode,&copsReadPara.format,copsReadPara.oper,&copsReadPara.act,&copsReadPara.subact};

 	at_print(AT_DEBUG,"normal_recvcopsreadrsp at_paras=%s!\n",at_paras);

@@ -2032,6 +2036,21 @@
     }

     at_print(AT_DEBUG,"normal_recvcopsreadrsp send to mmi MSG_CMD_GET_NET_PROVIDER\n");

     ipc_send_message(MODULE_ID_AT_CTL,MODULE_ID_MMI,MSG_CMD_GET_NET_PROVIDER, 0, NULL,0);   

+

+    if(1 == mccmnc_empty_flag)

+    {

+        mccmnc_empty_flag = 0;

+        cfg_get_item(NV_PPP_STATUS, ppp_status, sizeof(ppp_status));

+		if(0 == strcmp(PPP_DISCONNECTED, ppp_status))

+        {

+            ret = is_valid_plmn(sMCC, sMNC);

+

+            if(ret)

+            {

+                ipc_send_message(MODULE_ID_WEB_CGI, MODULE_ID_AT_CTL, MSG_CMD_PDP_ACT_REQ, 0, NULL, 0);   

+            }

+        }

+    }

 }

 

 

diff --git a/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c b/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c
index 7daccb4..b8ec416 100755
--- a/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c
+++ b/lynq/S300/BJMTN/ap/app/zte_comm/at_ctl/src/atconfig/ps_pdp.c
@@ -39,6 +39,7 @@
 #define MAX_AT_IPV6_SIZE    64  // ´ÓATÏìÓ¦ÃüÁî»ñÈ¡µÄIPV6µØÖ·³¤¶È

 #define MAX_AT_IPV4V6_SIZE  80  // ´ÓATÏìÓ¦ÃüÁî»ñÈ¡µÄIPV4V6µØÖ·³¤¶È£¬16(IPV4) + 64(IPV6)

 

+int mccmnc_empty_flag = 0;

 extern int is_valid_plmn(char *mcc, char *mnc);

 

 enum

@@ -3300,33 +3301,6 @@
 

 }

 

-static void *check_mcc_mnc_timer_cb(void *arg)

-{

-	char network_type[20] = {0};

-	char mcc[4] = {0};

-	char mnc[4] = {0};

-

-	cfg_get_item("network_type", network_type, sizeof(network_type));

-	if(0 == strcmp(network_type, "No Service") || 0 == strcmp(network_type, "Limited Service"))

-	{

-		return ZUFI_NULL;

-	}

-

-	cfg_get_item("mcc", mcc, sizeof(mcc));

-	cfg_get_item("mnc", mnc, sizeof(mnc));

-

-	if(strlen(mcc) && strlen(mnc))

-	{

-		start_pdp_auto_dial();

-	}

-	else

-	{

-		CreateSoftTimer(AtMccMncTimeID, TIMER_FLAG_ONCE, 500, &check_mcc_mnc_timer_cb, NULL);

-	}

-	

-	return ZUFI_NULL;

-}

-

 void start_pdp_auto_dial(void)

 {

 	int ret = 0;

@@ -3342,9 +3316,13 @@
 

 	if(strlen(mcc) == 0 || strlen(mnc) == 0)

 	{

-		CreateSoftTimer(AtMccMncTimeID, TIMER_FLAG_ONCE, 500, &check_mcc_mnc_timer_cb, NULL);

+		mccmnc_empty_flag = 1;

 		return;

 	}

+	else

+	{

+		mccmnc_empty_flag = 0;

+	}

 

 	ret = is_valid_plmn(mcc, mnc);

 	if(0 == ret)