This commit is contained in:
zhanglianghy 2019-10-12 11:57:02 +08:00
commit 47f4a96444
1 changed files with 15 additions and 11 deletions

View File

@ -156,7 +156,7 @@ ret_code LTE_json_parse(pointer input, uint *conf_type, int action)
return ret; return ret;
} }
void killpid() /*void killpid()
{ {
char pid[10] = {0}; char pid[10] = {0};
char cmd[20] = {0}; char cmd[20] = {0};
@ -173,7 +173,7 @@ void killpid()
sprintf(cmd,"kill %d",pid_int); sprintf(cmd,"kill %d",pid_int);
system(cmd); system(cmd);
pclose(fp); pclose(fp);
} }*/
ret_code start_lte() ret_code start_lte()
{ {
@ -209,7 +209,9 @@ ret_code start_lte()
} }
else if(strstr(result,"start pppd ppp0") != NULL) else if(strstr(result,"start pppd ppp0") != NULL)
{ {
while(i < 120) pclose(f);
return RET_OK;
/* while(i < 120)
{ {
if(access(file_path,0) != -1) if(access(file_path,0) != -1)
{ {
@ -227,12 +229,12 @@ ret_code start_lte()
//ɱËÀ½ø³Ì //ɱËÀ½ø³Ì
killpid(); killpid();
rpc_log_info("please check the sim card\n"); rpc_log_info("please check the sim card\n");
return RET_EXEC_SHELL_ERR; return RET_EXEC_SHELL_ERR;*/
} }
else else
{ {
pclose(f); pclose(f);
return RET_UNKNOWN; return RET_EXEC_SHELL_ERR;
} }
} }
@ -269,7 +271,7 @@ ret_code stop_lte()
else else
{ {
pclose(f); pclose(f);
return RET_UNKNOWN; return RET_EXEC_SHELL_ERR;
} }
} }
@ -302,14 +304,16 @@ ret_code restart_lte()
return RET_NO_LTE_MODULE_ERR; return RET_NO_LTE_MODULE_ERR;
} }
else if(strstr(result,"pppd apparently already active, start aborted!") != NULL) else if(strstr(result,"pppd apparently already active") != NULL)
{ {
pclose(f); pclose(f);
return RET_ALREADY_START_ERR; return RET_ALREADY_START_ERR;
} }
else if(strstr(result,"start pppd ppp0") != NULL) else if(strstr(result,"start pppd ppp0") != NULL)
{ {
while(i < 120) pclose(f);
return RET_OK;
/* while(i < 120)
{ {
if(access(file_path,0) != -1) if(access(file_path,0) != -1)
{ {
@ -326,13 +330,13 @@ ret_code restart_lte()
//ɱËÀ½ø³Ì //ɱËÀ½ø³Ì
killpid(); killpid();
rpc_log_info("please check the sim card\n"); rpc_log_info("please check the sim card\n");
return RET_EXEC_SHELL_ERR; return RET_EXEC_SHELL_ERR;*/
} }
else else
{ {
pclose(f); pclose(f);
return RET_UNKNOWN; return RET_EXEC_SHELL_ERR;
} }
} }