Merge "[Feature][S300][task-view-1920][app] fix BJMTN locknet dial error"
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 7bea811..7daccb4 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
@@ -3300,6 +3300,33 @@
}
+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;
@@ -3313,6 +3340,12 @@
cfg_get_item("mnc", mnc, sizeof(mnc));
at_print(AT_DEBUG, "start_pdp_auto_dial mcc=%s,mnc=%s\n", mcc, mnc);
+ if(strlen(mcc) == 0 || strlen(mnc) == 0)
+ {
+ CreateSoftTimer(AtMccMncTimeID, TIMER_FLAG_ONCE, 500, &check_mcc_mnc_timer_cb, NULL);
+ return;
+ }
+
ret = is_valid_plmn(mcc, mnc);
if(0 == ret)
{
diff --git a/lynq/S300/ap/app/zte_comm/at_ctl/inc/at_context.h b/lynq/S300/ap/app/zte_comm/at_ctl/inc/at_context.h
index 08685e6..3cffa4e 100755
--- a/lynq/S300/ap/app/zte_comm/at_ctl/inc/at_context.h
+++ b/lynq/S300/ap/app/zte_comm/at_ctl/inc/at_context.h
@@ -35,6 +35,7 @@
#define PbsmsInitTimerID 71 //pbºÍsms³õʼ»¯¿ªÊ¼¶¨Ê±Æ÷£¬ÑÓ»ºPBºÍSMS¿ª»ú³õʼ»¯µã£¬ÒԼӿ쿪»ú
#define AtWaitRspTimeID 72 //µÈ´ýÓ¦´ð½á¹û×Ö·û´®³¬Ê±¶¨Ê±Æ÷£¬³£ÓÃÓÚsend_reqat_to_farpsÖÐ
#define AtShutdownTimeID 73
+#define AtMccMncTimeID 74
#define AtWaitCompleteStart 80 //farps½ÓÊÕÍⲿMCUÇëÇóÃüÁʱ¶¨Ê±Æ÷Æðʼid
#define AtWaitCompleteEnd 100 //farps½ÓÊÕÍⲿMCUÇëÇóÃüÁʱ¶¨Ê±Æ÷½áÊøid