Jelajahi Sumber

断网300秒后,重启网卡

vothin 1 tahun lalu
induk
melakukan
947ac43457
3 mengubah file dengan 10 tambahan dan 0 penghapusan
  1. 10 0
      jni/logic/statusbar.cc
  2. TEMPAT SAMPAH
      libs/armeabi/libzkgui.so
  3. TEMPAT SAMPAH
      obj/activity/statusbar.o

+ 10 - 0
jni/logic/statusbar.cc

@@ -156,7 +156,17 @@ static void updateNetState(){
 		//5分钟仍然断网,则重启
 		//5分钟仍然断网,则重启
 		if (netOffCount > netOffMax){
 		if (netOffCount > netOffMax){
 			netOffCount = 0;
 			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();
 			sync();
 			reboot(RB_AUTOBOOT);
 			reboot(RB_AUTOBOOT);
 		}
 		}

TEMPAT SAMPAH
libs/armeabi/libzkgui.so


TEMPAT SAMPAH
obj/activity/statusbar.o