浏览代码

断网后300秒重启网卡

vothin 1 年之前
父节点
当前提交
a14a49832e
共有 3 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      jni/logic/statusbar.cc
  2. 二进制
      libs/armeabi/libzkgui.so
  3. 二进制
      obj/activity/statusbar.o

+ 10 - 0
jni/logic/statusbar.cc

@@ -156,7 +156,17 @@ static void updateNetState(){
 		//5分钟仍然断网,则重启
 		if (netOffCount > netOffMax){
 			netOffCount = 0;
+
+			// 网卡重启
+			LOGD("断网300秒,网卡断电重启");
+			std::string heartStr = "NETRESET,1F";
+			LOGD("=====> the heartStr == %s", heartStr.c_str());
+			const char* sendMsg = heartStr.c_str();
+			sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
+
 			//重启
+			sleep(3);
+			LOGD("网卡重启无效,程序内部重启");
 			sync();
 			reboot(RB_AUTOBOOT);
 		}

二进制
libs/armeabi/libzkgui.so


二进制
obj/activity/statusbar.o