Browse Source

Merge branch 'AW-Regular' of https://git.phihong.com.tw:30000/System_Integration/CSU3_AM335x into AW-Regular

8009 5 năm trước cách đây
mục cha
commit
e01d58edea

+ 35 - 35
EVSE/Modularization/Module_4g.c

@@ -1060,17 +1060,6 @@ int main(void)
 
 		return 0;
 	}
-	else if(Load4gConfiguration() == FAIL)
-	{
-		DEBUG_ERROR("4G configuration value NG\n");
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.Telecom4GModuleCommFail=1;
-		}
-		sleep(5);
-
-		return 0;
-	}
 
 	for(;;)
 	{
@@ -1185,37 +1174,48 @@ int main(void)
 					}
 					else
 					{
-						#ifdef SystemLogMessage
-						DEBUG_WARN("PPP interface not found.\n");
-						#endif
-
-						memset(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress, 0 , sizeof ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
-
-						Dongle.cnt_pppFail++;
-						if(Dongle.cnt_pppFail > 5)
+						if(Load4gConfiguration() == FAIL)
+						{
+							DEBUG_ERROR("4G configuration value NG.\n");
+							if(ShmStatusCodeData!=NULL)
+							{
+								ShmStatusCodeData->AlarmCode.AlarmEvents.bits.Telecom4GModuleCommFail=1;
+							}
+						}
+						else
 						{
 							#ifdef SystemLogMessage
-							DEBUG_INFO("Dongle hardware reset...\n");
+							DEBUG_WARN("PPP interface not found.\n");
 							#endif
 
-							rstModule();
-						}
+							memset(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress, 0 , sizeof ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
 
-						system("killall 4GDetection");
-						sleep(2);
+							Dongle.cnt_pppFail++;
+							if(Dongle.cnt_pppFail > 5)
+							{
+								#ifdef SystemLogMessage
+								DEBUG_INFO("Dongle hardware reset...\n");
+								#endif
 
-						if(Dongle.Model == DONGLE_QUECTEL)
-						{
-							system("/root/ppp/4GDetection /dev/ttyUSB3 &");
-							printf("4GDetection for primary device.\n");
-						}
-						else if(Dongle.Model == DONGLE_UBLOX)
-						{
-							system("/root/ppp/4GDetection /dev/ttyACM0 &");
-							printf("4GDetection for second device.\n");
+								rstModule();
+							}
+
+							system("killall 4GDetection");
+							sleep(2);
+
+							if(Dongle.Model == DONGLE_QUECTEL)
+							{
+								system("/root/ppp/4GDetection /dev/ttyUSB3 &");
+								printf("4GDetection for primary device.\n");
+							}
+							else if(Dongle.Model == DONGLE_UBLOX)
+							{
+								system("/root/ppp/4GDetection /dev/ttyACM0 &");
+								printf("4GDetection for second device.\n");
+							}
+							else
+							{}
 						}
-						else
-						{}
 
 						sleep(CheckConnectionInterval);
 					}

+ 3 - 1
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -38,6 +38,8 @@
 #include	"TransactionQueue.h"
 
 
+
+
 #define PASS				1
 #define FAIL				-1
 
@@ -11413,7 +11415,7 @@ int initialConfigurationTable(void)
 		// MinimumStatusDuration
 		ShmOCPP16Data->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemAccessibility = 1;
 		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemName, "MinimumStatusDuration");
-		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemData, "0" );
+		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemData, "120" );
 		server_cycle_Status = 120; //StatusNotification cycle
 		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","MinimumStatusDuration", "false", "120");
 

+ 1 - 5
EVSE/Modularization/ocppfiles/Module_OcppBackend.c

@@ -89,10 +89,6 @@ 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;
@@ -1742,7 +1738,7 @@ int main(void)
 			// Check System Value, process offline Transaction
 			CheckSystemValue();
 			lws_service(context, 10000);//timeout_ms
-			usleep(1000);
+			usleep(5000);
 		}
 
 		if(( (BootNotificationInterval != 0  && ((time((time_t*)NULL)-startTime.bootNotification)>=BootNotificationInterval) )  || ((time((time_t*)NULL)-startTime.bootNotification)>=defaultWaitingTime) ) && ((server_sign == FALSE)/*|| (server_pending == TRUE)*/))