|
|
|
@ -391,6 +391,39 @@ void _network_connect_4g()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _network_recovery_dial_file()
|
|
|
|
|
{
|
|
|
|
|
int i, num;
|
|
|
|
|
char src[128] = {0};
|
|
|
|
|
char cmd[256] = {0};
|
|
|
|
|
char file_path[128] = {0};
|
|
|
|
|
char file_name[][128] =
|
|
|
|
|
{
|
|
|
|
|
"quectel-chat-connect",
|
|
|
|
|
"quectel-chat-disconnect",
|
|
|
|
|
"quectel-dial",
|
|
|
|
|
"quectel-ppp"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
num = sizeof(file_name)/sizeof(file_name[0]);
|
|
|
|
|
//LOG("num=%d\n", num);
|
|
|
|
|
for (i = 0; i < num; i++)
|
|
|
|
|
{
|
|
|
|
|
snprintf(file_path, 128, "%s/%s", DIAL_PPP_PATH, file_name[i]);
|
|
|
|
|
|
|
|
|
|
if (access(file_path, F_OK))
|
|
|
|
|
{
|
|
|
|
|
snprintf(src, 128, "%s/%s", DIAL_PPP_BAK_PATH, file_name[i]);
|
|
|
|
|
if (access(src, F_OK) == 0)
|
|
|
|
|
{
|
|
|
|
|
snprintf(cmd, 256, "cp -rf %s %s", src, DIAL_PPP_PATH);
|
|
|
|
|
system(cmd);
|
|
|
|
|
LOG("exec:%s\n", cmd);
|
|
|
|
|
usleep(100*1000);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *_network_manage_thread(void *args)
|
|
|
|
|
{
|
|
|
|
@ -460,6 +493,7 @@ void *_network_manage_thread(void *args)
|
|
|
|
|
_network_usb_4g_power_on();
|
|
|
|
|
_network_usb_4g_reset();
|
|
|
|
|
}
|
|
|
|
|
_network_recovery_dial_file();
|
|
|
|
|
sleep(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|