Commit 26f505b7 authored by 957dd's avatar 957dd

4g gns update

parent b108cfbf
No preview for this file type
...@@ -109,6 +109,7 @@ int main(int argc, char *argv[]) { ...@@ -109,6 +109,7 @@ int main(int argc, char *argv[]) {
system("pkill firefox"); system("pkill firefox");
Delay_Ms(30,0); Delay_Ms(30,0);
reconnect_4g();
gStart=time(NULL);//开始时间戳 gStart=time(NULL);//开始时间戳
serial_Init();//串口初始化 serial_Init();//串口初始化
......
...@@ -49,3 +49,23 @@ void refresh_cam() ...@@ -49,3 +49,23 @@ void refresh_cam()
pclose(fp); pclose(fp);
printf("recam\n"); printf("recam\n");
} }
int reconnect_4g()
{
FILE *file = fopen("/etc/resolv.conf", "w");
if (file == NULL) {
perror("Failed to open /etc/resolv.conf");
return 1;
}
// 写入 nameserver 8.8.8.8
const char *nameserver = "nameserver 8.8.8.8\n";
if (fputs(nameserver, file) == EOF) {
perror("Failed to write to /etc/resolv.conf");
fclose(file);
return 1;
}
// 关闭文件
fclose(file);
}
...@@ -10,4 +10,5 @@ extern char gwebcam[100]; ...@@ -10,4 +10,5 @@ extern char gwebcam[100];
int opencamsh(); int opencamsh();
void refresh_cam(); void refresh_cam();
int reconnect_4g();
#endif #endif
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment