Selaa lähdekoodia

断网后300秒重启网卡

vothin 1 vuosi sitten
vanhempi
commit
a14a49832e
3 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      jni/logic/statusbar.cc
  2. BIN
      libs/armeabi/libzkgui.so
  3. BIN
      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);
 		}

BIN
libs/armeabi/libzkgui.so


BIN
obj/activity/statusbar.o