فهرست منبع

2020-04-15 / Kathy Yeh
1. modify cpu high utilization(when url is not setted, cpu utilization is high.)

Kathy_Yeh 5 سال پیش
والد
کامیت
ebbde2333b
1فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 8 2
      EVSE/Modularization/ocppfiles/Module_OcppBackend.c

+ 8 - 2
EVSE/Modularization/ocppfiles/Module_OcppBackend.c

@@ -89,6 +89,10 @@ struct StartTime
 	unsigned int bootNotification;
 }startTime;
 
+#if 0
+unsigned char *SendBuffer;
+int SendBufLen=(1024*4);//(1024*3);
+#endif
 int SendBufLen=(1024*4);//(1024*3);
 unsigned char SendBuffer[1024*4]={0};
 static int ConnectionEstablished=0;
@@ -1722,7 +1726,7 @@ int main(void)
 
 	for(;;)
 	{
-		while((ConnectionEstablished==0)&&(GetInternetConn() == 1)) // Check InternetConn 0: disconnected, 1: connected
+		while(ConnectionEstablished==0) // Check InternetConn 0: disconnected, 1: connected
 		{
 			SetOcppConnStatus(FALSE);
 			if((time((time_t*)NULL)-startTime.connect)>=60)
@@ -1737,8 +1741,10 @@ int main(void)
 
 			// Check System Value, process offline Transaction
 			CheckSystemValue();
-			lws_service(context, 10000);//timeout_ms
 			usleep(5000);
+			lws_service(context, 10000);//timeout_ms
+			//lws_service(context, 100);//timeout_ms
+
 		}
 
 		if(( (BootNotificationInterval != 0  && ((time((time_t*)NULL)-startTime.bootNotification)>=BootNotificationInterval) )  || ((time((time_t*)NULL)-startTime.bootNotification)>=defaultWaitingTime) ) && ((server_sign == FALSE)/*|| (server_pending == TRUE)*/))