소스 검색

Merge branch 'master' of https://git.phihong.com.tw:30000/System_Integration/CSU3_AM335x

Conflicts:
	EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin
	EVSE/Projects/AW-CCS/Images/ramdisk.gz
vern.chang 3 년 전
부모
커밋
17009144ce
100개의 변경된 파일1830개의 추가작업 그리고 843개의 파일을 삭제
  1. 115 101
      EVSE/Modularization/ocppfiles/MessageHandler.c
  2. 3 3
      EVSE/Modularization/ocppfiles/Module_OcppBackend.c
  3. 115 101
      EVSE/Modularization/ocppph/MessageHandler.c
  4. 3 3
      EVSE/Modularization/ocppph/Module_OcppBackend.c
  5. 4 3
      EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c
  6. 215 32
      EVSE/Projects/AW-CCS/Apps/Module_AlarmDetect.c
  7. 78 27
      EVSE/Projects/AW-CCS/Apps/main.c
  8. 1 1
      EVSE/Projects/AW-CCS/Apps/main.h
  9. 85 51
      EVSE/Projects/AX80/Apps/LCM/Module_LcmControl.c
  10. 47 18
      EVSE/Projects/AX80/Apps/Module_AlarmDetect.c
  11. 7 1
      EVSE/Projects/AX80/Apps/Module_Cabinet.c
  12. 238 225
      EVSE/Projects/AX80/Apps/main.c
  13. 1 1
      EVSE/Projects/AX80/Apps/main.h
  14. BIN
      EVSE/Projects/DD360/Apps/CSU/.main.c.swp
  15. 22 9
      EVSE/Projects/DD360/Apps/CSU/Primary.c
  16. 16 8
      EVSE/Projects/DD360/Apps/CSU/main.c
  17. 1 0
      EVSE/Projects/DD360/Apps/CSU/main.h
  18. 4 2
      EVSE/Projects/DD360/Apps/Config.h
  19. 17 0
      EVSE/Projects/DD360/Apps/DebugLog.md
  20. 7 7
      EVSE/Projects/DD360/Apps/Define/define.c
  21. 65 35
      EVSE/Projects/DD360/Apps/Define/define.h
  22. 9 3
      EVSE/Projects/DD360/Apps/ModuleChkSysTask/Module_ChkSysTask.c
  23. 13 4
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c
  24. 2 1
      EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.h
  25. 2 1
      EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvRxComm.c
  26. 0 3
      EVSE/Projects/DD360/Apps/ModuleInternalComm/FanBoard.c
  27. 1 2
      EVSE/Projects/DD360/Apps/ModuleInternalComm/RelayBoard.c
  28. 102 7
      EVSE/Projects/DD360/Apps/ModuleLcmCtrl/Module_LcmControl.c
  29. 11 5
      EVSE/Projects/DD360/Apps/ModulePrimary/Module_PrimaryComm.c
  30. 30 5
      EVSE/Projects/DD360/Apps/ReadCmdline.c
  31. 2 0
      EVSE/Projects/DD360/Apps/Script/copy_from_d.sh
  32. 2 0
      EVSE/Projects/DD360/Apps/Script/copy_to_d.sh
  33. BIN
      EVSE/Projects/DD360/Apps/UnsafetyOutputTask
  34. BIN
      EVSE/Projects/DD360/Images/ramdisk.gz
  35. BIN
      EVSE/Projects/DD360/output/FactoryConfig
  36. BIN
      EVSE/Projects/DD360/output/Module_ChkSysTask
  37. BIN
      EVSE/Projects/DD360/output/Module_DoComm
  38. BIN
      EVSE/Projects/DD360/output/Module_EvComm
  39. BIN
      EVSE/Projects/DD360/output/Module_EventLogging
  40. BIN
      EVSE/Projects/DD360/output/Module_InternalComm
  41. BIN
      EVSE/Projects/DD360/output/Module_LcmControl
  42. BIN
      EVSE/Projects/DD360/output/Module_PrimaryComm
  43. BIN
      EVSE/Projects/DD360/output/Module_UpdateFW
  44. BIN
      EVSE/Projects/DD360/output/ReadCmdline
  45. BIN
      EVSE/Projects/DD360/output/UnsafetyOutputTask
  46. BIN
      EVSE/Projects/DD360/output/main
  47. BIN
      EVSE/Projects/DD360/output/simulation
  48. BIN
      EVSE/Projects/DD360Audi/Apps/CSU/.main.c.swp
  49. 22 9
      EVSE/Projects/DD360Audi/Apps/CSU/Primary.c
  50. 16 8
      EVSE/Projects/DD360Audi/Apps/CSU/main.c
  51. 1 0
      EVSE/Projects/DD360Audi/Apps/CSU/main.h
  52. 4 2
      EVSE/Projects/DD360Audi/Apps/Config.h
  53. 17 0
      EVSE/Projects/DD360Audi/Apps/DebugLog.md
  54. 7 7
      EVSE/Projects/DD360Audi/Apps/Define/define.c
  55. 65 35
      EVSE/Projects/DD360Audi/Apps/Define/define.h
  56. 9 3
      EVSE/Projects/DD360Audi/Apps/ModuleChkSysTask/Module_ChkSysTask.c
  57. 13 4
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c
  58. 2 1
      EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.h
  59. 2 1
      EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvRxComm.c
  60. 0 3
      EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/FanBoard.c
  61. 1 2
      EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/RelayBoard.c
  62. 102 7
      EVSE/Projects/DD360Audi/Apps/ModuleLcmCtrl/Module_LcmControl.c
  63. 11 5
      EVSE/Projects/DD360Audi/Apps/ModulePrimary/Module_PrimaryComm.c
  64. BIN
      EVSE/Projects/DD360Audi/Apps/Module_ChkSysTask
  65. BIN
      EVSE/Projects/DD360Audi/Apps/Module_DoComm
  66. BIN
      EVSE/Projects/DD360Audi/Apps/Module_EvComm
  67. BIN
      EVSE/Projects/DD360Audi/Apps/Module_EventLogging
  68. BIN
      EVSE/Projects/DD360Audi/Apps/Module_InternalComm
  69. BIN
      EVSE/Projects/DD360Audi/Apps/Module_UpdateFW
  70. 30 5
      EVSE/Projects/DD360Audi/Apps/ReadCmdline.c
  71. 2 0
      EVSE/Projects/DD360Audi/Apps/Script/copy_from_d.sh
  72. 2 0
      EVSE/Projects/DD360Audi/Apps/Script/copy_to_d.sh
  73. BIN
      EVSE/Projects/DD360Audi/Apps/main
  74. BIN
      EVSE/Projects/DD360ComBox/Apps/CSU/.main.c.swp
  75. 22 9
      EVSE/Projects/DD360ComBox/Apps/CSU/Primary.c
  76. 16 8
      EVSE/Projects/DD360ComBox/Apps/CSU/main.c
  77. 1 0
      EVSE/Projects/DD360ComBox/Apps/CSU/main.h
  78. 4 2
      EVSE/Projects/DD360ComBox/Apps/Config.h
  79. 17 0
      EVSE/Projects/DD360ComBox/Apps/DebugLog.md
  80. 7 7
      EVSE/Projects/DD360ComBox/Apps/Define/define.c
  81. 65 35
      EVSE/Projects/DD360ComBox/Apps/Define/define.h
  82. 9 3
      EVSE/Projects/DD360ComBox/Apps/ModuleChkSysTask/Module_ChkSysTask.c
  83. 13 4
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c
  84. 2 1
      EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.h
  85. 2 1
      EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvRxComm.c
  86. 0 3
      EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/FanBoard.c
  87. 1 2
      EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/RelayBoard.c
  88. 102 7
      EVSE/Projects/DD360ComBox/Apps/ModuleLcmCtrl/Module_LcmControl.c
  89. 11 5
      EVSE/Projects/DD360ComBox/Apps/ModulePrimary/Module_PrimaryComm.c
  90. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_ChkSysTask
  91. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_DoComm
  92. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_EvComm
  93. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_EventLogging
  94. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_InternalComm
  95. BIN
      EVSE/Projects/DD360ComBox/Apps/Module_UpdateFW
  96. 30 5
      EVSE/Projects/DD360ComBox/Apps/ReadCmdline.c
  97. 2 0
      EVSE/Projects/DD360ComBox/Apps/Script/copy_from_d.sh
  98. 2 0
      EVSE/Projects/DD360ComBox/Apps/Script/copy_to_d.sh
  99. BIN
      EVSE/Projects/DD360ComBox/Apps/UnsafetyOutputTask
  100. BIN
      EVSE/Projects/DD360ComBox/Apps/main

+ 115 - 101
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -90,6 +90,12 @@ static struct OCPPAuthLocalElemet
 	char idTagstatus[16];
 }idTagQuery;
 
+//============================================
+// OCPP MeterValue request flag
+//============================================
+uint8_t reqSampleMeter[CONNECTOR_QUANTITY]={0};
+uint8_t reqClockAlignMeter[CONNECTOR_QUANTITY]={0};
+
 //=============================================
 // OCPP HeartBeat Response Not Receive Counts
 //============================================
@@ -4403,9 +4409,6 @@ end:
 
 void CheckSystemValue(void)
 {
-	uint8_t reqSampleMeter[CONNECTOR_QUANTITY]={0};
-	uint8_t reqClockAlignMeter[CONNECTOR_QUANTITY]={0};
-
 	char filenmae[100]={0};
 	char str[100]={0};
 	int tempIndex = 0;
@@ -4423,6 +4426,107 @@ void CheckSystemValue(void)
 		HeartBeatWithNOResponse += 1;
 	}
 
+	for(int gun_index=0;gun_index < gunTotalNumber;gun_index++)
+	{
+		// ClockAlign MeterValue
+		if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
+		{
+			if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
+				{
+					tempIndex = ((gun_index==2) ? 1: 0);
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < CHAdeMO_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}// End for CHAdeMO
+			}
+			else if(gunType[gun_index] == GUN_TYPE_CCS)
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
+				{
+					tempIndex = ((gun_index==2) ? 1: 0);
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < CCS_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				} // End for CCS
+			}
+			else if(gunType[gun_index] == GUN_TYPE_GBT)
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
+				{
+					tempIndex = ((gun_index==2) ? 1: 0);
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < GB_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}// End for GB
+			}
+			else if(gunType[gun_index] == GUN_TYPE_DO)
+			{
+				tempIndex = gun_index;
+
+				for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}
+			}
+			else
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
+				{
+					tempIndex = 2;
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < AC_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}//End for AC
+			}
+		}
+	}
+
 	for(int gun_index=0;gun_index < gunTotalNumber ;gun_index++)
 	{
 		//==========================================
@@ -4827,104 +4931,7 @@ void CheckSystemValue(void)
 			cpinitateMsg.bits[gun_index].TriggerMeterValue = 0;
 		}
 
-		// ClockAlign MeterValue
-		if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
-		{
-			if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
-				{
-					tempIndex = ((gun_index==2) ? 1: 0);
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < CHAdeMO_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}// End for CHAdeMO
-			}
-			else if(gunType[gun_index] == GUN_TYPE_CCS)
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
-				{
-					tempIndex = ((gun_index==2) ? 1: 0);
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < CCS_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				} // End for CCS
-			}
-			else if(gunType[gun_index] == GUN_TYPE_GBT)
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
-				{
-					tempIndex = ((gun_index==2) ? 1: 0);
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < GB_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}// End for GB
-			}
-			else if(gunType[gun_index] == GUN_TYPE_DO)
-			{
-				tempIndex = gun_index;
-
-				for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}
-			}
-			else
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
-				{
-					tempIndex = 2;
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < AC_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}//End for AC
-			}
-		}
-
+		// Clock-aligned Meter value
 		if(isWebsocketSendable && (reqClockAlignMeter[gun_index] == 1))
 		{
 			sendMeterValuesRequest(gun_index, ReadingContext_Sample_Clock);
@@ -5050,6 +5057,7 @@ void CheckSystemValue(void)
 					sendMeterValuesRequest(gun_index, ReadingContext_Sample_Periodic);
 
 				storeTempStopTransaction(gun_index);
+				reqSampleMeter[gun_index] = 0;
 			}
 
 			refreshStartTimer(&clientTime.MeterValues[gun_index]);
@@ -12236,6 +12244,12 @@ int handleRemoteStartRequest(char *uuid, char *payload)
 						 strcpy(comfirmstr, RemoteStartStopStatusStr[RemoteStartStopStatus_Rejected]);
 					 }
 				 }
+				 else
+				 {
+					 refreshStartTimer(&clientTime.RemoteStartWait);
+					 ShmOCPP16Data->MsMsg.bits.isRemoteStartWaitReq = 1;
+					 strcpy(comfirmstr, RemoteStartStopStatusStr[RemoteStartStopStatus_Accepted]);
+				 }
 			 }
 			 else
 			 {

+ 3 - 3
EVSE/Modularization/ocppfiles/Module_OcppBackend.c

@@ -1521,6 +1521,9 @@ int main(void)
 				refreshStartTimer(&startTime.bootNotification);
 			}
 
+			// Check System Value
+			CheckSystemValue();
+
 			// On line operation
 			if(GetServerSign() == TRUE)
 			{
@@ -1532,9 +1535,6 @@ int main(void)
 					queueOpInfo.PreTransactionMessageResend = queueOpInfo.TransactionMessageResend;
 				}
 
-				// Check System Value
-				CheckSystemValue();
-
 				// PING packet
 				if(isWebsocketSendable && (0 < GetWebSocketPingInterval()) && ((GetWebSocketPingInterval()+counterPingSend) <= getDiffSecNow(startTime.pingOn)))
 				{

+ 115 - 101
EVSE/Modularization/ocppph/MessageHandler.c

@@ -91,6 +91,12 @@ static struct OCPPAuthLocalElemet
 	char idTagstatus[16];
 }idTagQuery;
 
+//============================================
+// OCPP MeterValue request flag
+//============================================
+uint8_t reqSampleMeter[CONNECTOR_QUANTITY]={0};
+uint8_t reqClockAlignMeter[CONNECTOR_QUANTITY]={0};
+
 //=============================================
 // OCPP HeartBeat Response Not Receive Counts
 //============================================
@@ -3922,9 +3928,6 @@ end:
 
 void CheckSystemValue(void)
 {
-	uint8_t reqSampleMeter[CONNECTOR_QUANTITY]={0};
-	uint8_t reqClockAlignMeter[CONNECTOR_QUANTITY]={0};
-
 	char filenmae[100]={0};
 	char str[100]={0};
 	int tempIndex = 0;
@@ -3942,6 +3945,107 @@ void CheckSystemValue(void)
 		HeartBeatWithNOResponse += 2;
 	}
 
+	for(int gun_index=0;gun_index < gunTotalNumber;gun_index++)
+	{
+		// ClockAlign MeterValue
+		if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
+		{
+			if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
+				{
+					tempIndex = ((gun_index==2) ? 1: 0);
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < CHAdeMO_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}// End for CHAdeMO
+			}
+			else if(gunType[gun_index] == GUN_TYPE_CCS)
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
+				{
+					tempIndex = ((gun_index==2) ? 1: 0);
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < CCS_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				} // End for CCS
+			}
+			else if(gunType[gun_index] == GUN_TYPE_GBT)
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
+				{
+					tempIndex = ((gun_index==2) ? 1: 0);
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < GB_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}// End for GB
+			}
+			else if(gunType[gun_index] == GUN_TYPE_DO)
+			{
+				tempIndex = gun_index;
+
+				for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}
+			}
+			else
+			{
+				if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
+				{
+					tempIndex = 2;
+				}
+				else
+				{
+					tempIndex = gun_index;
+				}
+
+				for (int index = 0; index < AC_QUANTITY; index++)
+				{
+					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
+					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
+					{
+						reqClockAlignMeter[gun_index] = 1;
+					}
+				}//End for AC
+			}
+		}
+	}
+
 	for(int gun_index=0;gun_index < gunTotalNumber ;gun_index++)
 	{
 		//==========================================
@@ -4347,104 +4451,7 @@ void CheckSystemValue(void)
 			cpinitateMsg.bits[gun_index].TriggerMeterValue = 0;
 		}
 
-		// ClockAlign MeterValue
-		if(isWebsocketSendable && (server_sign == TRUE) && ((atoi((char*)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData) > 0)?((getTimePassSinceToday(gun_index)%(atoi((char*)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData)))==0):FALSE))
-		{
-			if(gunType[gun_index] == GUN_TYPE_CHAdeMO)
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
-				{
-					tempIndex = ((gun_index==2) ? 1: 0);
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < CHAdeMO_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}// End for CHAdeMO
-			}
-			else if(gunType[gun_index] == GUN_TYPE_CCS)
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
-				{
-					tempIndex = ((gun_index==2) ? 1: 0);
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < CCS_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				} // End for CCS
-			}
-			else if(gunType[gun_index] == GUN_TYPE_GBT)
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[8] != '0')
-				{
-					tempIndex = ((gun_index==2) ? 1: 0);
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < GB_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}// End for GB
-			}
-			else if(gunType[gun_index] == GUN_TYPE_DO)
-			{
-				tempIndex = gun_index;
-
-				for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}
-			}
-			else
-			{
-				if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
-				{
-					tempIndex = 2;
-				}
-				else
-				{
-					tempIndex = gun_index;
-				}
-
-				for (int index = 0; index < AC_QUANTITY; index++)
-				{
-					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
-					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
-					{
-						reqClockAlignMeter[gun_index] = 1;
-					}
-				}//End for AC
-			}
-		}
-
+		// Clock-aligned Meter value
 		if(isWebsocketSendable && (reqClockAlignMeter[gun_index] == 1))
 		{
 			sendMeterValuesRequest(gun_index, ReadingContext_Sample_Clock);
@@ -4570,6 +4577,7 @@ void CheckSystemValue(void)
 					sendMeterValuesRequest(gun_index, ReadingContext_Sample_Periodic);
 
 				//storeTempStopTransaction(gun_index);
+				reqSampleMeter[gun_index] = 0;
 			}
 
 			refreshStartTimer(&clientTime.MeterValues[gun_index]);
@@ -11742,6 +11750,12 @@ int handleRemoteStartRequest(char *uuid, char *payload)
 						 strcpy(comfirmstr, RemoteStartStopStatusStr[RemoteStartStopStatus_Rejected]);
 					 }
 				 }
+				 else
+				 {
+					 refreshStartTimer(&clientTime.RemoteStartWait);
+					 ShmOCPP16DataPH->MsMsg.bits.isRemoteStartWaitReq = 1;
+					 strcpy(comfirmstr, RemoteStartStopStatusStr[RemoteStartStopStatus_Accepted]);
+				 }
 			 }
 			 else
 			 {

+ 3 - 3
EVSE/Modularization/ocppph/Module_OcppBackend.c

@@ -1510,6 +1510,9 @@ int main(void)
 				refreshStartTimer(&startTime.bootNotification);
 			}
 
+			// Check System Value
+			CheckSystemValue();
+
 			// On line operation
 			if(GetServerSign() == TRUE)
 			{
@@ -1521,9 +1524,6 @@ int main(void)
 					queueOpInfo.PreTransactionMessageResend = queueOpInfo.TransactionMessageResend;
 				}
 
-				// Check System Value
-				CheckSystemValue();
-
 				if(isWebsocketSendable && (0 < GetWebSocketPingInterval()) && ((GetWebSocketPingInterval()+counterPingSend) <= getDiffSecNow(startTime.pingOn)))
 				{
 					lws_callback_on_writable(wsi_client);

+ 4 - 3
EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c

@@ -2,9 +2,9 @@
  * Module_LcmControl.c
  *
  * Created on : 2020-10-20
- * Update on : 2021-12-24
+ * Update on : 2022-01-07
  * Author : Folus Wen, Eason Yang
- * Version : V0.25
+ * Version : V0.26
  *
  */
 
@@ -114,7 +114,7 @@ int Uart1Fd;
 //=======================================
 // Record version and date
 //=======================================
-char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.25", "2021-12-24", "REV.02.00"};
+char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.26", "2022-01-07", "REV.02.00"};
 
 //=======================================
 // Common routine
@@ -2656,6 +2656,7 @@ int main(void)
 			else
 			{
 				refreshStartTimer(&startTime[ShmCharger->gun_selectd][TMR_IDX_SHOW_AUTH_RESULT]);
+				ShmCharger->gun_info[ShmCharger->gun_selectd].isHandshakeTimerRefresh = NO;
 
 				switch(ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus)
 				{

+ 215 - 32
EVSE/Projects/AW-CCS/Apps/Module_AlarmDetect.c

@@ -49,6 +49,10 @@
 #define HYSTERETIC_OT		10
 #define HYSTERETIC_OC		10
 
+#define ALARM_OC_RETRY_COUNT 4
+
+//#define isDebugPrint
+
 struct{
 	unsigned short int	OV[3];
 	unsigned short int	UV[3];
@@ -63,8 +67,14 @@ struct{
 	unsigned short int	Relay_DrivingFault;
 	unsigned short int	CP_LevelFail;
 	unsigned short int	MCU_SelfTestFail;
+	unsigned short int	OC_Retry[3];
 }Alarm_Counter[2];
 
+struct{
+	uint16_t OC_BegThreshold; 	// OCP過電流門檻值 	單位0.01A	ex: 48 * 110 = 5280 (52.80A)
+	uint16_t OC_EndThreshold;	// OCP過電流門檻值 	單位0.01A	ex: 48 * 110 = 5280 (52.80A)
+}Over_Current[2];
+
 void trim(char *s);
 void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
 
@@ -74,6 +84,7 @@ struct OCPP16Data				*ShmOCPP16Data;
 struct OCPP20Data				*ShmOCPP20Data;
 struct Charger					*ShmCharger;
 unsigned long					previousAlarmCode[AC_QUANTITY];
+uint32_t OCP_Magnification = 0;		// Magnification
 
 int StoreLogMsg(const char *fmt, ...)
 {
@@ -283,6 +294,36 @@ int qca7000FlashCheck()
 	return result;
 }
 
+void ccsOverCurrentProtection(uint8_t gun_index)
+{	
+	if((ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'E') ||
+	   (ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'T') ||
+	   (ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'Z'))
+	{
+		Over_Current[gun_index].OC_BegThreshold = (ShmCharger->gun_info[gun_index].targetCurrent * OCP_Magnification) - 100;
+		Over_Current[gun_index].OC_EndThreshold = (ShmCharger->gun_info[gun_index].targetCurrent * OCP_Magnification) - 200;
+	}
+	else
+	{
+		if(ShmCharger->gun_info[gun_index].targetCurrent > 20)
+		{
+			Over_Current[gun_index].OC_BegThreshold = (ShmCharger->gun_info[gun_index].targetCurrent * OCP_Magnification) + 0;
+			Over_Current[gun_index].OC_EndThreshold = (ShmCharger->gun_info[gun_index].targetCurrent * OCP_Magnification) - 200;
+		}
+		else
+		{
+			Over_Current[gun_index].OC_BegThreshold = (ShmCharger->gun_info[gun_index].targetCurrent * 100) + 200;
+			Over_Current[gun_index].OC_EndThreshold = (ShmCharger->gun_info[gun_index].targetCurrent * 100) + 0;
+		}
+	}
+	
+	#ifdef isDebugPrint
+	DEBUG_INFO("Gun-[%d] OC_BegThreshold: %d \n", gun_index, Over_Current[gun_index].OC_BegThreshold);
+	DEBUG_INFO("Gun-[%d] OC_EndThreshold: %d \n", gun_index, Over_Current[gun_index].OC_EndThreshold);
+	#endif
+}
+	
+
 //==========================================
 // Main process
 //==========================================
@@ -301,6 +342,21 @@ int main(void)
 		sleep(5);
 		return FAIL;
 	}
+	
+	if((ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'E') ||
+	   (ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'T') ||
+	   (ShmSysConfigAndInfo->SysConfig.ModelName[3] == 'Z'))
+	{
+		// Europe
+		OCP_Magnification = 125;
+	}
+	else
+	{
+		// Other
+		OCP_Magnification = 110;
+	}
+	
+	DEBUG_INFO("OCP_Magnification: %d/100 => %.2f \n", OCP_Magnification,(float)(OCP_Magnification/100.0));
 
 	for(;;)
 	{
@@ -477,69 +533,196 @@ int main(void)
 						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_UNDER_VOLTAGE;
 						DEBUG_INFO("ALARM_L3_UNDER_VOLTAGE : recover \n");
 					}
-				}
-							
+				}			
 			}
 
 			//=====================================
 			// Over current detection
 			//=====================================
-			if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1 == ON)
+			ccsOverCurrentProtection(gun_index);
+			if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1 == ON) || ((uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrent*100.0) > Over_Current[gun_index].OC_BegThreshold))
 			{
-				if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
+				if((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC?(Alarm_Counter[gun_index].OC[0] > 60):(Alarm_Counter[gun_index].OC[0] > FILTER_SPEC)))
+				{
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
+					{
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
+						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_CURRENT;
+						if((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC?(Alarm_Counter[gun_index].OC_Retry[0]++):(Alarm_Counter[gun_index].OC_Retry[0]==0)));
+						
+						DEBUG_INFO("ALARM_L1_OVER_CURRENT : alarm \n");
+						DEBUG_INFO("Gun-[%d] PresentChargingCurrent: %d \n", gun_index, (uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrent*100.0));
+						DEBUG_INFO("Gun-[%d] OC_BegThreshold: %d \n", gun_index, Over_Current[gun_index].OC_BegThreshold);
+						DEBUG_INFO("Gun-[%d] OC_Connter[0]: %d \n", gun_index, Alarm_Counter[gun_index].OC[0]);
+						DEBUG_INFO("Gun-[%d] OC_Retry[0]: %d \n", gun_index, Alarm_Counter[gun_index].OC_Retry[0]);
+					}
+				}
+				else
 				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
-					ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_CURRENT;
-					DEBUG_INFO("ALARM_L1_OVER_CURRENT : alarm \n");
+					Alarm_Counter[gun_index].OC[0]++;
 				}
 			}
-			else
+			else if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1 == OFF) || ((uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrent*100.0) < Over_Current[gun_index].OC_EndThreshold))
 			{
-				if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
+				Alarm_Counter[gun_index].OC[0] = 0;
+				if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC)
+				{
+					if(Alarm_Counter[gun_index].OC_Retry[0] <= ALARM_OC_RETRY_COUNT)
+					{
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_OVER_CURRENT;
+							DEBUG_INFO("ALARM_L1_OVER_CURRENT : recover \n");
+						}
+					}
+					else
+					{
+						if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
+						{
+							Alarm_Counter[gun_index].OC_Retry[0] = 0;
+							if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
+							{
+								ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
+								ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_OVER_CURRENT;
+								DEBUG_INFO("ALARM_L1_OVER_CURRENT : recover latch \n");
+							}
+						}
+					}
+				}
+				else
 				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
-					ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_OVER_CURRENT;
-					DEBUG_INFO("ALARM_L1_OVER_CURRENT : recover \n");
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
+					{
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
+						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L1_OVER_CURRENT;
+						DEBUG_INFO("ALARM_L1_OVER_CURRENT : recover \n");
+					}
 				}
 			}
 
 			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
 			{
-				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2 == ON)
+				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2 == ON) || ((uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL2*100.0) > Over_Current[gun_index].OC_BegThreshold))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == OFF)
+					if((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC?(Alarm_Counter[gun_index].OC[1] > 60):(Alarm_Counter[gun_index].OC[1] > FILTER_SPEC)))
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = ON;
-						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_CURRENT;
-						DEBUG_INFO("ALARM_L2_OVER_CURRENT : alarm \n");
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == OFF)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = ON;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_CURRENT;
+							if((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC?(Alarm_Counter[gun_index].OC_Retry[1]++):(Alarm_Counter[gun_index].OC_Retry[1]==0)));
+							
+							DEBUG_INFO("ALARM_L2_OVER_CURRENT : alarm \n");
+							DEBUG_INFO("Gun-[%d] PresentChargingCurrentL2: %d \n", gun_index, (uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL2*100.0));
+							DEBUG_INFO("Gun-[%d] OC_BegThreshold: %d \n", gun_index, Over_Current[gun_index].OC_BegThreshold);
+							DEBUG_INFO("Gun-[%d] OC_Connter[1]: %d \n", gun_index, Alarm_Counter[gun_index].OC[1]);
+							DEBUG_INFO("Gun-[%d] OC_Retry[1]: %d \n", gun_index, Alarm_Counter[gun_index].OC_Retry[1]);
+						}
 					}
+					else
+					{
+						Alarm_Counter[gun_index].OC[1]++;
+					}
+					
 				}
-				else
+				else if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2 == OFF) || ((uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL2*100.0) < Over_Current[gun_index].OC_EndThreshold))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
+					Alarm_Counter[gun_index].OC[1] = 0;
+					if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC)
+					{
+						if(Alarm_Counter[gun_index].OC_Retry[1] <= ALARM_OC_RETRY_COUNT)
+						{
+							if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
+							{
+								ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
+								ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_CURRENT;
+								DEBUG_INFO("ALARM_L2_OVER_CURRENT : recover \n");
+							}
+						}
+						else
+						{
+							if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
+							{
+								Alarm_Counter[gun_index].OC_Retry[1] = 0;
+								if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
+								{
+									ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
+									ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_CURRENT;
+									DEBUG_INFO("ALARM_L2_OVER_CURRENT : recover latch \n");
+								}
+							}
+						}
+					}
+					else
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
-						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_CURRENT;
-						DEBUG_INFO("ALARM_L2_OVER_CURRENT : recover \n");
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L2_OVER_CURRENT;
+							DEBUG_INFO("ALARM_L2_OVER_CURRENT : recover \n");
+						}
 					}
 				}
 
-				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3 == ON)
+				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3 == ON) || ((uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL3*100.0) > Over_Current[gun_index].OC_BegThreshold))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == OFF)
+					if((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC?(Alarm_Counter[gun_index].OC[2] > 60):(Alarm_Counter[gun_index].OC[2] > FILTER_SPEC)))
+					{
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == OFF)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = ON;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_CURRENT;
+							if((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC?(Alarm_Counter[gun_index].OC_Retry[2]++):(Alarm_Counter[gun_index].OC_Retry[2]==0)));
+							
+							DEBUG_INFO("ALARM_L3_OVER_CURRENT : alarm \n");
+							DEBUG_INFO("Gun-[%d] PresentChargingCurrentL3: %d \n", gun_index, (uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL3*100.0));
+							DEBUG_INFO("Gun-[%d] OC_BegThreshold: %d \n", gun_index, Over_Current[gun_index].OC_BegThreshold);
+							DEBUG_INFO("Gun-[%d] OC_Connter[2]: %d \n", gun_index, Alarm_Counter[gun_index].OC[2]);
+							DEBUG_INFO("Gun-[%d] OC_Retry[2]: %d \n", gun_index, Alarm_Counter[gun_index].OC_Retry[2]);
+						}
+					}
+					else
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = ON;
-						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_CURRENT;
-						DEBUG_INFO("ALARM_L3_OVER_CURRENT : alarm \n");
+						Alarm_Counter[gun_index].OC[2]++;
 					}
 				}
-				else
+				else if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3 == OFF) || ((uint16_t)(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingCurrentL3*100.0) < Over_Current[gun_index].OC_EndThreshold))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
+					Alarm_Counter[gun_index].OC[2] = 0;
+					if(ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_HLC)
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = OFF;
-						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_CURRENT;
-						DEBUG_INFO("ALARM_L3_OVER_CURRENT : recover \n");
+						if(Alarm_Counter[gun_index].OC_Retry[2] <= ALARM_OC_RETRY_COUNT)
+						{
+							if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
+							{
+								ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = OFF;
+								ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_CURRENT;
+								DEBUG_INFO("ALARM_L3_OVER_CURRENT : recover \n");
+							}
+						}
+						else
+						{
+							if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
+							{
+								Alarm_Counter[gun_index].OC_Retry[2] = 0;
+								if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
+								{
+									ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = OFF;
+									ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_CURRENT;
+									DEBUG_INFO("ALARM_L3_OVER_CURRENT : recover latch \n");
+								}
+							}
+						}
+					}
+					else
+					{
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = OFF;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_L3_OVER_CURRENT;
+							DEBUG_INFO("ALARM_L3_OVER_CURRENT : recover \n");
+						}
 					}
 				}
 			}

+ 78 - 27
EVSE/Projects/AW-CCS/Apps/main.c

@@ -34,6 +34,7 @@
 #define TIMEOUT_SPEC_POWERSAVING_METER			120
 #define TIMEOUT_SPEC_POWERSAVING_LED_STATUS		120
 #define TIMEOUT_SPEC_CEHCK_POWER_CONSUMPTION	15
+#define TIMEOUT_SPEC_RESET_WIFI_MODULE			180
 
 //==========================
 // GPIO constant define
@@ -2451,26 +2452,29 @@ void InitEthernet()
 				if(cnt_pingDNS_Fail >= 3)
 				{
 					ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet=ON;
-					if((ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0))
+					if(!ShmSysConfigAndInfo->SysInfo.OcppConnStatus)
 					{
-						system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
-						sprintf(tmpbuf, "/sbin/udhcpc -i eth0 -x hostname:CSU3_%s -s /root/dhcp_script/eth0.script > /dev/null &", ShmSysConfigAndInfo->SysConfig.SystemId);
-						system(tmpbuf);
-					}
-					else
-					{
-						system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
-						memset(tmpbuf,0,256);
-						sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up &",
-								ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
-								ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
-						system(tmpbuf);
-						memset(tmpbuf,0,256);
-						sprintf(tmpbuf,"route add default gw %s eth0 &",
-						ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
-						system(tmpbuf);
+						if((ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0))
+						{
+							system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
+							sprintf(tmpbuf, "/sbin/udhcpc -i eth0 -x hostname:CSU3_%s -s /root/dhcp_script/eth0.script > /dev/null &", ShmSysConfigAndInfo->SysConfig.SystemId);
+							system(tmpbuf);
+						}
+						else
+						{
+							system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
+							memset(tmpbuf,0,256);
+							sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up &",
+									ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
+									ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
+							system(tmpbuf);
+							memset(tmpbuf,0,256);
+							sprintf(tmpbuf,"route add default gw %s eth0 &",
+							ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
+							system(tmpbuf);
+						}
+						cnt_pingDNS_Fail = 0;
 					}
-					cnt_pingDNS_Fail = 0;
 				}
 				else
 				{
@@ -2578,6 +2582,60 @@ void InitEthernet()
 				}
 			}
 
+			// Reset wifi function
+			if((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 1))
+			{
+				if((!ShmSysConfigAndInfo->SysInfo.OcppConnStatus) && 
+				   (ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi == ON) &&
+				   (ShmStatusCodeData->InfoCode.InfoEvents.bits.ApDisconnectViaWiFi == ON))
+				{
+					if((getDiffSecNow(startTime[0][TMR_IDX_RESET_WIFI]) > TIMEOUT_SPEC_RESET_WIFI_MODULE))
+					{
+						DEBUG_INFO("Wifi [Station] mode: Reset wifi power. \n");
+						DEBUG_INFO("The wifi interface may not be found. \n");
+						
+						system("echo 1 > /sys/class/gpio/gpio59/value");
+						sleep(3);
+						system("echo 0 > /sys/class/gpio/gpio59/value");
+
+						refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
+					}
+					else
+					{}
+				}
+				else
+				{
+					refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
+				}	
+			}
+			else if((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 2))
+			{
+				if((ShmStatusCodeData->InfoCode.InfoEvents.bits.ApDisconnectViaWiFi == ON))
+				{
+					if((getDiffSecNow(startTime[0][TMR_IDX_RESET_WIFI]) > TIMEOUT_SPEC_RESET_WIFI_MODULE))
+					{
+						DEBUG_INFO("Wifi [Access Point] mode: reset wifi power. \n");
+						DEBUG_INFO("The wifi interface may not be found. \n");
+						
+						system("echo 1 > /sys/class/gpio/gpio59/value");
+						sleep(3);
+						system("echo 0 > /sys/class/gpio/gpio59/value");
+
+						refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
+					}
+					else
+					{}
+				}
+				else
+				{
+					refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
+				}	
+			}
+			else
+			{
+				refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
+			}
+
 			sleep(5);
 		}
 	}
@@ -2914,7 +2972,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.59.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.60.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -3984,13 +4042,6 @@ void checkTask()
 		DEBUG_INFO("Module_PowerSharing not running, restart it.\n");
 		system ("/root/Module_PowerSharing &");
 	}
-
-	if((system("pidof -s Module_InitUpgrade > /dev/null") != 0) &&
-		ShmSysConfigAndInfo->SysConfig.isReqFirstUpgrade)
-	{
-		DEBUG_INFO("Module_InitUpgrade not running, restart it.\n");
-		system ("/root/Module_InitUpgrade &");
-	}
 }
 
 void checkConnectionTimeout()
@@ -5144,7 +5195,7 @@ int main(void)
 			if(ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_BOOTING)
 			{
 				// Alarm event check
-				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0) || ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
+				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0) || (ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode) || ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
 				{
 					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus != SYS_MODE_ALARM)
 					{

+ 1 - 1
EVSE/Projects/AW-CCS/Apps/main.h

@@ -236,7 +236,7 @@ enum TIMER_IDX
 	TMR_IDX_POWERSAVING_LED_STATUS,
 	TMR_IDX_CHECK_POWER_CONSUMPTION,
 	TMR_IDX_LCM_POWER_CONSUMPTION,
-	TMR_IDX_15,
+	TMR_IDX_RESET_WIFI,
 	TMR_IDX_16,
 	TMR_IDX_17,
 	TMR_IDX_18,

+ 85 - 51
EVSE/Projects/AX80/Apps/LCM/Module_LcmControl.c

@@ -2,9 +2,9 @@
  * Module_LcmControl.c
  *
  * Created on : 2020-10-20
- * Update on : 2021-12-20
+ * Update on : 2022-01-07
  * Author : Folus Wen, Eason Yang
- * Version : V0.24
+ * Version : V0.26
  *
  */
 
@@ -58,7 +58,6 @@ void setPriceFromWebsite(float monry_rate);
 void setAuthorizationPage(uint8_t gun_index);
 float getPresentFinalCost(uint8_t gun_index);
 void setGunPluginAnimation(uint8_t gun_index);
-void setPresentChargedEnergy(uint8_t gun_index);
 void setPresentChargedgPower(uint8_t gun_index);
 void setPlugAndChargeAnimation(uint8_t gun_index);
 void setPresentChargedDuration(uint8_t gun_index);
@@ -72,6 +71,7 @@ void setDefaultValue(uint8_t gun_index, uint8_t system_mode);
 void setQRcodeContent(char *input, uint8_t length, uint8_t mode);
 void setBillingFromBackend(uint8_t gun_index, uint8_t system_mode);
 void setConnectionAnimation(uint8_t gun_index, uint8_t system_mode);
+void setPresentChargedEnergy(uint8_t gun_index, uint8_t system_mode);
 void setMarqueeControl(uint16_t address, uint8_t gun_index, uint8_t type);
 void setCurrencyAndUnitFromBackend(uint8_t type_price,uint8_t type_currency_unit, uint8_t gun_index);
 
@@ -85,7 +85,7 @@ enum TMR_IDX
 	TMR_IDX_PLUGIN,
 	TMR_IDX_ALARM,
 	TMR_IDX_PRICE,
-	TMR_IDX_5,
+	TMR_IDX_REFRESH_INFO,
 	TMR_IDX_6,
 	TMR_IDX_7,
 	TMR_IDX_8,
@@ -100,6 +100,7 @@ struct timespec					startTime[AC_QUANTITY][TMR_IDX_SHOW_AUTH_RESULT];
 #define TIME_ANIMATION_ALARM			5 // Unit: Second
 #define TIME_REFRESH_TIME				5 // Unit: Second
 #define TIME_AUTH_RESULT_TIME			5 // Unit: Second
+#define TIME_REFRESH_INFO				3 // Unit: Second
 
 //=======================================
 // Declare Variable
@@ -113,7 +114,7 @@ int Uart1Fd;
 //=======================================
 // Record version and date
 //=======================================
-char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.24", "2021-12-14", "REV.02.00"};
+char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.26", "2022-01-07", "REV.02.00"};
 
 //=======================================
 // Common routine
@@ -420,6 +421,7 @@ void page_preparing(uint8_t gun_index, uint8_t system_mode)
 		else
 		{
 			setConnectionAnimation(gun_index, system_mode);
+			setPresentChargedEnergy(gun_index, system_mode);
 		}
 	}
 	else
@@ -435,12 +437,15 @@ void page_preparing(uint8_t gun_index, uint8_t system_mode)
 			setPresentConnectionTimeout(gun_index);
 			setConnectionAnimation(gun_index, system_mode);
 			setGunPluginAnimation(gun_index);
+			setPresentChargedEnergy(gun_index, system_mode);
 		}
 	}
 }
 
 void page_charging(uint8_t gun_index, uint8_t system_mode)
 {
+	static char runningCost[256] = {0};
+
 	if((getCurrentPage() != SYSTEM_SCREEN_CHARGING) && (!ShmCharger->isAuthrizing && !ShmCharger->isGetAuthResult))
 	{
 		setCurrentPage(SYSTEM_SCREEN_CHARGING);
@@ -451,37 +456,44 @@ void page_charging(uint8_t gun_index, uint8_t system_mode)
 	{
 		setConnectionAnimation(gun_index, system_mode);
 		setPresentChargedDuration(gun_index);
-		setPresentChargedEnergy(gun_index);
 		setPresentChargedgPower(gun_index);
 
-		if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
-		{
-			if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
-			{
-				setRunningCost(gun_index, TOTAL_COST);
-			}
-			else
-			{
-				// DISPLAY BY OCPP 2.0.1
-			}
-		}
-		else
+		if((getDiffSecNow(startTime[gun_index][TMR_IDX_REFRESH_INFO]) >= TIME_REFRESH_INFO) || (strcmp((char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description, runningCost) != 0))
 		{
-			if(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling == ON)
+			setPresentChargedEnergy(gun_index, system_mode);
+			memcpy((char*) runningCost,(char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description,ARRAY_SIZE(ShmOCPP16Data->Cost.RunningCost[gun_index].description));
+
+			if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
 			{
-				setDisplayValue(ICON_CHARGING_COST, APPEAR);
-				setPresentFinalCost(getPresentFinalCost(gun_index));
+				if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+				{
+					setRunningCost(gun_index, TOTAL_COST);
+				}
+				else
+				{
+					// DISPLAY BY OCPP 2.0.1
+				}
 			}
 			else
 			{
-				// User spend cost
-				setDisplayValue(ICON_CHARGING_COST, DISAPPEAR);
-				setDisplayValue(TEXT_CHARGING_COST, DISAPPEAR);
+				if(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling == ON)
+				{
+					setDisplayValue(ICON_CHARGING_COST, APPEAR);
+					setPresentFinalCost(getPresentFinalCost(gun_index));
+				}
+				else
+				{
+					// User spend cost
+					setDisplayValue(ICON_CHARGING_COST, DISAPPEAR);
+					setDisplayValue(TEXT_CHARGING_COST, DISAPPEAR);
 
-				// User account balance
-				setDisplayValue(ICON_COMPLETE_WALLET, DISAPPEAR);
-				setDisplayValue(TEXT_REMAINING_ACCOUNT_BALANCE, DISAPPEAR);
+					// User account balance
+					setDisplayValue(ICON_COMPLETE_WALLET, DISAPPEAR);
+					setDisplayValue(TEXT_REMAINING_ACCOUNT_BALANCE, DISAPPEAR);
+				}
 			}
+
+			refreshStartTimer(&startTime[gun_index][TMR_IDX_REFRESH_INFO]);
 		}
 	}
 }
@@ -513,7 +525,7 @@ void page_complete(uint8_t gun_index, uint8_t system_mode)
 	}
 
 	setPresentChargedDuration(gun_index);
-	setPresentChargedEnergy(gun_index);
+	setPresentChargedEnergy(gun_index, system_mode);
 
 	if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
 	{
@@ -562,7 +574,7 @@ void page_terminating(uint8_t gun_index, uint8_t system_mode)
 	else
 	{
 		setPresentChargedDuration(gun_index);
-		setPresentChargedEnergy(gun_index);
+		setPresentChargedEnergy(gun_index, system_mode);
 		setPresentChargedgPower(gun_index);
 
 		if((ShmSysConfigAndInfo->SysInfo.OcppConnStatus == ON))
@@ -1435,28 +1447,33 @@ void setRunningCost(uint8_t gun_index, uint8_t type)
 			}
 			else
 			{
-				if((strstr((char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description, "Total Cost:") > 0))
+				if(strlen((char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description) > 0)
 				{
-					// APPEAR COST ICON
-					setDisplayValue(ICON_CHARGING_COST, APPEAR);
+					if((strstr((char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description, "Total Cost:") > 0))
+					{
+						// APPEAR COST ICON
+						setDisplayValue(ICON_CHARGING_COST, APPEAR);
 
-					// APPEAR COST TEXT
-					strcpy((char*)tmp,(char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description);
-					split((char**)splitString, tmp, Symbol);
-					memcpy(input_data, splitString[3], strlen(splitString[3]));
-					length = strlen(input_data);
-					trim_string(input_data,length);
-					memcpy(output_data ,input_data, strlen(input_data));
-					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_COST, output_data, ARRAY_SIZE(output_data));
-				}
-				else
-				{
-					setDisplayValue(ICON_CHARGING_COST, APPEAR);
+						// APPEAR COST TEXT
+						strcpy((char*)tmp,(char*)ShmOCPP16Data->Cost.RunningCost[gun_index].description);
+						split((char**)splitString, tmp, Symbol);
+						memcpy(input_data, splitString[3], strlen(splitString[3]));
+						length = strlen(input_data);
+						trim_string(input_data,length);
+						memcpy(output_data ,input_data, strlen(input_data));
+						lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_COST, output_data, ARRAY_SIZE(output_data));
+					}
+					else
+					{
+						setDisplayValue(ICON_CHARGING_COST, APPEAR);
 
-					strcpy((char*)cost_empty, "-----");
-					string2ByteArray(cost_empty, output_data);
-					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_COST, output_data, ARRAY_SIZE(output_data));
+						strcpy((char*)cost_empty, "-----");
+						string2ByteArray(cost_empty, output_data);
+						lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_COST, output_data, ARRAY_SIZE(output_data));
+					}
 				}
+				else
+				{}
 			}
 
 			break;
@@ -1954,7 +1971,7 @@ void setPresentChargedgPower(uint8_t gun_index)
 //=======================================
 // Setting Present Charging [ Energy ]
 //=======================================
-void setPresentChargedEnergy(uint8_t gun_index)
+void setPresentChargedEnergy(uint8_t gun_index, uint8_t system_mode)
 {
 	uint8_t data[16];
 	uint8_t energy[16];
@@ -1962,9 +1979,22 @@ void setPresentChargedEnergy(uint8_t gun_index)
 	memset(data, 0x00, ARRAY_SIZE(data));
 	memset(energy, 0x00, ARRAY_SIZE(energy));
 
-	sprintf((char *)energy, "%.4f kWh", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
-	string2ByteArray(energy, data);
-	lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_ENERGY, data, ARRAY_SIZE(data));
+	switch(system_mode)
+	{
+		case SYS_MODE_PREPARING:
+			sprintf((char *)energy, "%s kWh", "0.0000");
+			string2ByteArray(energy, data);
+			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_ENERGY, data, ARRAY_SIZE(data));
+			break;
+		case SYS_MODE_CHARGING:
+		case SYS_MODE_TERMINATING:
+		case SYS_MODE_COMPLETE:
+		default:
+			sprintf((char *)energy, "%.3f0 kWh", ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
+			string2ByteArray(energy, data);
+			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_ENERGY, data, ARRAY_SIZE(data));
+			break;
+	}
 }
 
 //=======================================
@@ -2080,17 +2110,20 @@ void setDefaultValue(uint8_t gun_index, uint8_t system_mode)
 				setDisplayValue(ICON_PRECHARGING_ANIMATION, CONNECTION_FLASHING_1);
 				CONNECTION_LEVEL_STATUS = CONNECTION_LEVEL_0;
 				refreshStartTimer(&startTime[gun_index][TMR_IDX_CONNECTION]);
+				refreshStartTimer(&startTime[gun_index][TMR_IDX_REFRESH_INFO]);
 			}
 			else
 			{
 				setDisplayValue(ICON_PREPARING_PLUG_ARROW, PLUGIN_ARROW_1);
 				GUN_PLUGING_LEVEL_STATUS = GUN_PLUGING_LEVEL_0;
 				refreshStartTimer(&startTime[gun_index][TMR_IDX_PLUGIN]);
+				refreshStartTimer(&startTime[gun_index][TMR_IDX_REFRESH_INFO]);
 			}
 			break;
 		case SYS_MODE_CHARGING:
 			setDisplayValue(ICON_CHARGING_ANIMATION, CONNECTION_FLASHING_1);
 			refreshStartTimer(&startTime[gun_index][TMR_IDX_CONNECTION]);
+			refreshStartTimer(&startTime[gun_index][TMR_IDX_REFRESH_INFO]);
 			CONNECTION_LEVEL_STATUS = CONNECTION_LEVEL_0;
 			break;
 		case SYS_MODE_TERMINATING:
@@ -2623,6 +2656,7 @@ int main(void)
 			else
 			{
 				refreshStartTimer(&startTime[ShmCharger->gun_selectd][TMR_IDX_SHOW_AUTH_RESULT]);
+				ShmCharger->gun_info[ShmCharger->gun_selectd].isHandshakeTimerRefresh = NO;
 
 				switch(ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus)
 				{

+ 47 - 18
EVSE/Projects/AX80/Apps/Module_AlarmDetect.c

@@ -484,17 +484,27 @@ int main(void)
 			//=====================================
 			// Over current detection
 			//=====================================
-			if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1 == ON)
+			if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1 == ON) ||
+			   (ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0] > (ShmCharger->gun_info[gun_index].targetCurrent<=20?(ShmCharger->gun_info[gun_index].targetCurrent+2):((int)(ShmCharger->gun_info[gun_index].targetCurrent*((ShmSysConfigAndInfo->SysConfig.ModelName[3]=='E') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='T') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='Z')?1.25:1.1))))))
 			{
-				if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
+				if(Alarm_Counter[gun_index].OC[0] > 500)
 				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
-					ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_CURRENT;
-					DEBUG_INFO("ALARM_L1_OVER_CURRENT : alarm \n");
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == OFF)
+					{
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = ON;
+						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_CURRENT;
+						DEBUG_INFO("ALARM_L1_OVER_CURRENT : alarm \n");
+					}
+				}
+				else
+				{
+					Alarm_Counter[gun_index].OC[0]++;
 				}
 			}
-			else
+			else if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1 != ON) &&
+			        (ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0] <= (ShmCharger->gun_info[gun_index].targetCurrent<=20?(ShmCharger->gun_info[gun_index].targetCurrent):((int)((ShmCharger->gun_info[gun_index].targetCurrent*((ShmSysConfigAndInfo->SysConfig.ModelName[3]=='E') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='T') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='Z')?1.25:1.1))-2)))))
 			{
+				Alarm_Counter[gun_index].OC[0] = 0;
 				if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP == ON)
 				{
 					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP = OFF;
@@ -505,17 +515,27 @@ int main(void)
 
 			if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
 			{
-				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2 == ON)
+				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2 == ON) ||
+				   (ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0] > (ShmCharger->gun_info[gun_index].targetCurrent<=20?(ShmCharger->gun_info[gun_index].targetCurrent+2):((int)(ShmCharger->gun_info[gun_index].targetCurrent*((ShmSysConfigAndInfo->SysConfig.ModelName[3]=='E') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='T') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='Z')?1.25:1.1))))))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == OFF)
+					if(Alarm_Counter[gun_index].OC[1] > 500)
+					{
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == OFF)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = ON;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_CURRENT;
+							DEBUG_INFO("ALARM_L2_OVER_CURRENT : alarm \n");
+						}
+					}
+					else
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = ON;
-						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L2_OVER_CURRENT;
-						DEBUG_INFO("ALARM_L2_OVER_CURRENT : alarm \n");
+						Alarm_Counter[gun_index].OC[1]++;
 					}
 				}
-				else
+				else if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2 != ON) &&
+						(ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0] <= (ShmCharger->gun_info[gun_index].targetCurrent<=20?(ShmCharger->gun_info[gun_index].targetCurrent):((int)((ShmCharger->gun_info[gun_index].targetCurrent*((ShmSysConfigAndInfo->SysConfig.ModelName[3]=='E') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='T') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='Z')?1.25:1.1))-2)))))
 				{
+					Alarm_Counter[gun_index].OC[1] = 0;
 					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 == ON)
 					{
 						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL2 = OFF;
@@ -524,16 +544,25 @@ int main(void)
 					}
 				}
 
-				if(ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3 == ON)
+				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3 == ON) ||
+				   (ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0] > (ShmCharger->gun_info[gun_index].targetCurrent<=20?(ShmCharger->gun_info[gun_index].targetCurrent+2):((int)(ShmCharger->gun_info[gun_index].targetCurrent*((ShmSysConfigAndInfo->SysConfig.ModelName[3]=='E') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='T') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='Z')?1.25:1.1))))))
 				{
-					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == OFF)
+					if(Alarm_Counter[gun_index].OC[2] > 500)
 					{
-						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = ON;
-						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_CURRENT;
-						DEBUG_INFO("ALARM_L3_OVER_CURRENT : alarm \n");
+						if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == OFF)
+						{
+							ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 = ON;
+							ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_L3_OVER_CURRENT;
+							DEBUG_INFO("ALARM_L3_OVER_CURRENT : alarm \n");
+						}
+					}
+					else
+					{
+						Alarm_Counter[gun_index].OC[2]++;
 					}
 				}
-				else
+				else if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3 != ON) &&
+						(ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0] <= (ShmCharger->gun_info[gun_index].targetCurrent<=20?(ShmCharger->gun_info[gun_index].targetCurrent):((int)((ShmCharger->gun_info[gun_index].targetCurrent*((ShmSysConfigAndInfo->SysConfig.ModelName[3]=='E') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='T') || (ShmSysConfigAndInfo->SysConfig.ModelName[3]=='Z')?1.25:1.1))-2)))))
 				{
 					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCPL3 == ON)
 					{

+ 7 - 1
EVSE/Projects/AX80/Apps/Module_Cabinet.c

@@ -980,8 +980,14 @@ int main(void)
 	 * 	TODO:
 	 * 		1. Rotary switch define change with system specification
 	 */
+	for(uint8_t idx=0;idx<10;idx++)
+	{
+		if(ShmDispenser->gun_info.primaryMcuState.cp_state == CP_STATE_UNKNOWN)
+			break;
 
-	while(ShmDispenser->gun_info.primaryMcuState.cp_state == CP_STATE_UNKNOWN)sleep(5);
+		DEBUG_SERVER_INFO("Wait CP state query...%d\n", idx);
+		sleep(5);
+	};
 
 	if(ShmDispenser->gun_info.primaryMcuState.rotatory_switch == ROTARY_SWITCH_E_DISPENSER)
 	{

+ 238 - 225
EVSE/Projects/AX80/Apps/main.c

@@ -35,6 +35,7 @@
 #define TIMEOUT_SPEC_POWERSAVING_LED_STATUS		120
 #define TIMEOUT_SPEC_CEHCK_POWER_CONSUMPTION	15
 #define TIMEOUT_SPEC_UPGRADE					300
+#define TIMEOUT_SPEC_RESET_WIFI_MODULE			300
 
 //==========================
 // GPIO constant define
@@ -451,6 +452,202 @@ int getEth0MacAddress()
 	return result;
 }
 
+char* getSystemModeName(unsigned char mode)
+{
+	char* result;
+
+	switch(mode)
+	{
+		case SYS_MODE_BOOTING:
+			result = "booting";
+			break;
+		case SYS_MODE_IDLE:
+			result = "idle";
+			break;
+		case SYS_MODE_AUTHORIZING:
+			result = "authorizing";
+			break;
+		case SYS_MODE_PREPARING:
+			result = "preparing";
+			break;
+		case SYS_MODE_CHARGING:
+			result = "charging";
+			break;
+		case SYS_MODE_TERMINATING:
+			result = "terminating";
+			break;
+		case SYS_MODE_COMPLETE:
+			result = "complete";
+			break;
+		case SYS_MODE_ALARM:
+			result = "alarm";
+			break;
+		case SYS_MODE_FAULT:
+			result = "fault";
+			break;
+		case SYS_MODE_MAINTAIN:
+			result = "maintain";
+			break;
+		case SYS_MODE_RESERVATION:
+			result = "reservation";
+			break;
+		case SYS_MODE_BOOKING:
+			result = "booking";
+			break;
+		case SYS_MODE_DEBUG:
+			result = "debug";
+			break;
+		case SYS_MODE_UPDATE:
+			result = "upgrade";
+			break;
+		default:
+			result = "unknown";
+			break;
+	}
+
+	return result;
+}
+
+void setChargerMode(unsigned char gun_index, unsigned char mode)
+{
+	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus = ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus;
+	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus = mode;
+
+	DEBUG_INFO("Gun-%02d mode switch from %s to %s\n", gun_index, getSystemModeName(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus), getSystemModeName(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus));
+}
+
+unsigned char isMode(unsigned char gun_index, unsigned char mode)
+{
+	return ((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == mode)?YES:NO);
+}
+
+unsigned char isModeChange(unsigned char gun_index)
+{
+	unsigned char result = NO;
+
+	if(!isMode(gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus))
+	{
+		result = YES;
+
+		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus = ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus;
+	}
+
+	return result;
+}
+
+int isGpioInitialized(unsigned int gpio)
+{
+	int result = FAIL;
+	char gpioPath[64];
+
+	sprintf(gpioPath, "/sys/class/gpio/gpio%d/value", gpio);
+	if((access(gpioPath, F_OK)) != -1)
+	{
+		result = PASS;
+	}
+
+	return result;
+}
+
+void gpio_set_value(unsigned int gpio, unsigned int value)
+{
+	int fd;
+	char buf[256];
+
+	sprintf(buf, "/sys/class/gpio/gpio%d/value", gpio);
+	fd = open(buf, O_WRONLY);
+	if (fd < 0)
+	{
+		DEBUG_ERROR("GPIO-%d set %d fail.\n", gpio, value);
+	    return;
+	}
+
+	if (value)
+		write(fd, "1", 2);
+	else
+	    write(fd, "0", 2);
+
+	close(fd);
+}
+
+int gpio_get_value(unsigned int gpio)
+{
+    int fd;
+    char buf[256];
+    char ch;
+    int8_t result = FAIL;
+
+    sprintf(buf, "/sys/class/gpio/gpio%d/value", gpio);
+    fd = open(buf, O_RDONLY);
+    if (fd < 0)
+    {
+        DEBUG_ERROR("GPIO-%d get fail\n", gpio);
+        return result;
+    }
+
+    read(fd, &ch, 1);
+    if (ch != '0')
+        result = 1;
+    else
+        result = 0;
+
+    close(fd);
+
+    return result;
+}
+
+int presentChargedEnergyClear(unsigned char gun_index)
+{
+	int result = FAIL;
+
+	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = 0;
+	memset(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod, 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod)*sizeof(float));
+	result = PASS;
+
+	return result;
+}
+
+float presentChargedEnergyTotal(unsigned char gun_index)
+{
+	float result = 0.0f;
+
+	for(int idx=0;idx<ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod);idx++)
+	{
+		result += ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[idx];
+	}
+
+	return result;
+}
+
+int presentChargedEnergyUpdate(unsigned char gun_index)
+{
+	int result = FAIL;
+	time_t CurrentTime;
+	struct tm *tm;
+
+	CurrentTime = time(NULL);
+	tm=localtime(&CurrentTime);
+
+	if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount==1)
+	{
+		// Resolution: 0.0001 kwh
+		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[tm->tm_hour] += (((float)(ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption - ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption_at_start))/10000.0) - presentChargedEnergyTotal(gun_index);
+
+	}
+	else
+	{
+		// Resolution: 0.0001 kwh
+		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[tm->tm_hour] += ((((float)(ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption_at_start))/10000.0) +
+																											(((float)(ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption_at_start))/10000.0) +
+																											(((float)(ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption_at_start))/10000.0))
+																											- presentChargedEnergyTotal(gun_index);
+	}
+
+	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = presentChargedEnergyTotal(gun_index);
+
+	return result;
+}
+
 //======================================================
 // OCPP routine
 //======================================================
@@ -2406,26 +2603,29 @@ void InitEthernet()
 					if(cnt_pingDNS_Fail >= 3)
 					{
 						ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet=ON;
-						if((ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0))
-						{
-							system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
-							sprintf(tmpbuf, "/sbin/udhcpc -i eth0 -x hostname:CSU3_%s -s /root/dhcp_script/eth0.script > /dev/null &", ShmSysConfigAndInfo->SysConfig.SystemId);
-							system(tmpbuf);
-						}
-						else
+						if(!ShmSysConfigAndInfo->SysInfo.OcppConnStatus)
 						{
-							system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
-							memset(tmpbuf,0,256);
-							sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up &",
-									ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
-									ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
-							system(tmpbuf);
-							memset(tmpbuf,0,256);
-							sprintf(tmpbuf,"route add default gw %s eth0 &",
-							ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
-							system(tmpbuf);
+							if((ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0))
+							{
+								system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
+								sprintf(tmpbuf, "/sbin/udhcpc -i eth0 -x hostname:CSU3_%s -s /root/dhcp_script/eth0.script > /dev/null &", ShmSysConfigAndInfo->SysConfig.SystemId);
+								system(tmpbuf);
+							}
+							else
+							{
+								system("pgrep -f \"udhcpc -i eth0\" | xargs kill");
+								memset(tmpbuf,0,256);
+								sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up &",
+										ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
+										ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
+								system(tmpbuf);
+								memset(tmpbuf,0,256);
+								sprintf(tmpbuf,"route add default gw %s eth0 &",
+								ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
+								system(tmpbuf);
+							}
+							cnt_pingDNS_Fail = 0;
 						}
-						cnt_pingDNS_Fail = 0;
 					}
 					else
 					{
@@ -2532,6 +2732,22 @@ void InitEthernet()
 						}
 					}
 				}
+
+				if(!ShmSysConfigAndInfo->SysInfo.OcppConnStatus &&
+				   (((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 1) && (ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi == ON)) || (((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 2) && (ShmStatusCodeData->InfoCode.InfoEvents.bits.ApDisconnectViaWiFi == ON)))))
+				{
+					if(getDiffSecNow(startTime[0][TMR_IDX_RESET_WIFI]) > TIMEOUT_SPEC_RESET_WIFI_MODULE)
+					{
+						DEBUG_WARN("WIFI/4G module reset.\n");
+						gpio_set_value(GPIO_OUT_RST_4G_WIFI, ON);
+						sleep(1);
+						gpio_set_value(GPIO_OUT_RST_4G_WIFI, OFF);
+					}
+				}
+				else
+				{
+					refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
+				}
 			}
 			else
 			{
@@ -2644,205 +2860,6 @@ int Initialization(uint8_t gun_index)
 	return result;
 }
 
-//=====================================================
-// Common routine
-//=====================================================
-char* getSystemModeName(unsigned char mode)
-{
-	char* result;
-
-	switch(mode)
-	{
-		case SYS_MODE_BOOTING:
-			result = "booting";
-			break;
-		case SYS_MODE_IDLE:
-			result = "idle";
-			break;
-		case SYS_MODE_AUTHORIZING:
-			result = "authorizing";
-			break;
-		case SYS_MODE_PREPARING:
-			result = "preparing";
-			break;
-		case SYS_MODE_CHARGING:
-			result = "charging";
-			break;
-		case SYS_MODE_TERMINATING:
-			result = "terminating";
-			break;
-		case SYS_MODE_COMPLETE:
-			result = "complete";
-			break;
-		case SYS_MODE_ALARM:
-			result = "alarm";
-			break;
-		case SYS_MODE_FAULT:
-			result = "fault";
-			break;
-		case SYS_MODE_MAINTAIN:
-			result = "maintain";
-			break;
-		case SYS_MODE_RESERVATION:
-			result = "reservation";
-			break;
-		case SYS_MODE_BOOKING:
-			result = "booking";
-			break;
-		case SYS_MODE_DEBUG:
-			result = "debug";
-			break;
-		case SYS_MODE_UPDATE:
-			result = "upgrade";
-			break;
-		default:
-			result = "unknown";
-			break;
-	}
-
-	return result;
-}
-
-void setChargerMode(unsigned char gun_index, unsigned char mode)
-{
-	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus = ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus;
-	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus = mode;
-
-	DEBUG_INFO("Gun-%02d mode switch from %s to %s\n", gun_index, getSystemModeName(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus), getSystemModeName(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus));
-}
-
-unsigned char isMode(unsigned char gun_index, unsigned char mode)
-{
-	return ((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == mode)?YES:NO);
-}
-
-unsigned char isModeChange(unsigned char gun_index)
-{
-	unsigned char result = NO;
-
-	if(!isMode(gun_index, ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus))
-	{
-		result = YES;
-
-		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus = ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus;
-	}
-
-	return result;
-}
-
-int isGpioInitialized(unsigned int gpio)
-{
-	int result = FAIL;
-	char gpioPath[64];
-
-	sprintf(gpioPath, "/sys/class/gpio/gpio%d/value", gpio);
-	if((access(gpioPath, F_OK)) != -1)
-	{
-		result = PASS;
-	}
-
-	return result;
-}
-
-void gpio_set_value(unsigned int gpio, unsigned int value)
-{
-	int fd;
-	char buf[256];
-
-	sprintf(buf, "/sys/class/gpio/gpio%d/value", gpio);
-	fd = open(buf, O_WRONLY);
-	if (fd < 0)
-	{
-		DEBUG_ERROR("GPIO-%d set %d fail.\n", gpio, value);
-	    return;
-	}
-
-	if (value)
-		write(fd, "1", 2);
-	else
-	    write(fd, "0", 2);
-
-	close(fd);
-}
-
-int gpio_get_value(unsigned int gpio)
-{
-    int fd;
-    char buf[256];
-    char ch;
-    int8_t result = FAIL;
-
-    sprintf(buf, "/sys/class/gpio/gpio%d/value", gpio);
-    fd = open(buf, O_RDONLY);
-    if (fd < 0)
-    {
-        DEBUG_ERROR("GPIO-%d get fail\n", gpio);
-        return result;
-    }
-
-    read(fd, &ch, 1);
-    if (ch != '0')
-        result = 1;
-    else
-        result = 0;
-
-    close(fd);
-
-    return result;
-}
-
-int presentChargedEnergyClear(unsigned char gun_index)
-{
-	int result = FAIL;
-
-	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = 0;
-	memset(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod, 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod)*sizeof(float));
-	result = PASS;
-
-	return result;
-}
-
-float presentChargedEnergyTotal(unsigned char gun_index)
-{
-	float result = 0.0f;
-
-	for(int idx=0;idx<ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod);idx++)
-	{
-		result += ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[idx];
-	}
-
-	return result;
-}
-
-int presentChargedEnergyUpdate(unsigned char gun_index)
-{
-	int result = FAIL;
-	time_t CurrentTime;
-	struct tm *tm;
-
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-
-	if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount==1)
-	{
-		// Resolution: 0.0001 kwh
-		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[tm->tm_hour] += (((float)(ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption - ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption_at_start))/10000.0) - presentChargedEnergyTotal(gun_index);
-
-	}
-	else
-	{
-		// Resolution: 0.0001 kwh
-		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].presentChargedEnergyPeriod[tm->tm_hour] += ((((float)(ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption_at_start))/10000.0) +
-																											(((float)(ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption_at_start))/10000.0) +
-																											(((float)(ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption - ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption_at_start))/10000.0))
-																											- presentChargedEnergyTotal(gun_index);
-	}
-
-	ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy = presentChargedEnergyTotal(gun_index);
-
-	return result;
-}
-
 //===============================================
 // Get firmware version
 //===============================================
@@ -3695,9 +3712,7 @@ int isReachableInternet()
 
 	// Get gateway
 	fp = popen("ip route", "r");
-	if(fp == NULL)
-		result = FAIL;
-	else
+	if(fp != NULL)
 	{
 		while(fgets(buf, sizeof(buf), fp) != NULL)
 		{
@@ -3714,7 +3729,7 @@ int isReachableInternet()
 	pclose(fp);
 	memset(buf, 0x00, sizeof(buf));
 
-
+	// Check internet access ability
 	for(int idx=0;idx<ARRAY_SIZE(valid_Internet);idx++)
 	{
 		sprintf(cmd, "ping -c 1 -w 3 -I eth0 %s", valid_Internet[idx]);
@@ -4845,8 +4860,6 @@ void checkRfidAuthrize()
 	}
 }
 
-
-
 //======================================================
 // Main process
 //======================================================
@@ -5162,7 +5175,7 @@ int main(void)
 				if(ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_BOOTING)
 				{
 					// Alarm event check
-					if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0) || ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
+					if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0) || ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail || ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP)
 					{
 						if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus != SYS_MODE_ALARM)
 						{
@@ -6060,7 +6073,7 @@ int main(void)
 						setLedMotion(gun_index,LED_ACTION_ALARM);
 						setRelay(gun_index, OFF);
 
-						if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode == 0) && !ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
+						if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode == 0) && !ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail && !ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemAcOutputOCP)
 						{
 							if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_CHARGING) ||
 							   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_TERMINATING))

+ 1 - 1
EVSE/Projects/AX80/Apps/main.h

@@ -234,7 +234,7 @@ enum TIMER_IDX
 	TMR_IDX_CHECK_POWER_CONSUMPTION,
 	TMR_IDX_LCM_POWER_CONSUMPTION,
 	TMR_IDX_UPGRADE,
-	TMR_IDX_16,
+	TMR_IDX_RESET_WIFI,
 	TMR_IDX_17,
 	TMR_IDX_18,
 	TMR_IDX_19,

BIN
EVSE/Projects/DD360/Apps/CSU/.main.c.swp


+ 22 - 9
EVSE/Projects/DD360/Apps/CSU/Primary.c

@@ -339,6 +339,14 @@ void ChkPrimaryStatus(void)
                 ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
                 EmcOccureByString("042252");
                 Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
+                EmcOccureByString("042327");
+                Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
+                EmcOccureByString("042328");
+                Rtn = 1;
             } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
                 ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
                 EmcOccureByString("042200");
@@ -364,12 +372,16 @@ void ChkPrimaryStatus(void)
         if (Rtn == 0) {
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
             ReleaseEmsOccureByString(0, "042251");
             ReleaseEmsOccureByString(0, "042252");
+            ReleaseEmsOccureByString(0, "042327");
+            ReleaseEmsOccureByString(0, "042328");
             ReleaseEmsOccureByString(0, "042200");
             ReleaseEmsOccureByString(0, "042201");
             ReleaseEmsOccureByString(0, "042202");
@@ -379,12 +391,16 @@ void ChkPrimaryStatus(void)
     } else {
         ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
         ReleaseEmsOccureByString(0, "042251");
         ReleaseEmsOccureByString(0, "042252");
+        ReleaseEmsOccureByString(0, "042327");
+        ReleaseEmsOccureByString(0, "042328");
         ReleaseEmsOccureByString(0, "042200");
         ReleaseEmsOccureByString(0, "042201");
         ReleaseEmsOccureByString(0, "042202");
@@ -428,13 +444,10 @@ void ChkPrimaryStatus(void)
     //}
 
     if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
-            !leftBtnPush
-#if defined DD360Audi
-            &&
+            !leftBtnPush &&
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
-#endif //defined DD360Audi
        ) {
         pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
 
@@ -538,15 +551,14 @@ void ChkPrimaryStatus(void)
     }
 
     if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
-            !rightBtnPush
+            !rightBtnPush &&
 #if defined DD360Audi
-            &&
             pSysInfo->SystemPage != _LCM_IDLE &&
+#endif
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
             pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
-#endif //defined DD360Audi
        ) {
         if (!rightBtnPush) {
             rightBtnPush = true;
@@ -576,9 +588,10 @@ void ChkPrimaryStatus(void)
                 pSysInfo->CurGunSelected = 0;
                 ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
             }
+            log_info("current select gun ............................... %d ",
+                     pSysInfo->CurGunSelected);
         }
-        log_info("current select gun ............................... %d ",
-                 pSysInfo->CurGunSelected);
+
     } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
         if (rightBtnPush) {
             rightBtnPush = false;

+ 16 - 8
EVSE/Projects/DD360/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V1.18.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.18.0";
+char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
+char* DebugVersion = "v1.19.4";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1644,9 +1644,6 @@ void _DetectPlugInTimeout(void)
 	setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
 #elif DD360 || DD360Combox
  	setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
-    systemPageRestoreInit();
-   
-	return;
 #endif
     systemPageRestoreInit();
 }
@@ -3849,6 +3846,8 @@ static void ReviewCriticalAlarm(void)
             //Power cabinet alarm status
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP == YES ||
@@ -4362,7 +4361,14 @@ int main(void)
     log_info(" ********************************************************");
     log_info(" ******************  FileSystem Boot up *****************");
     log_info(" ********************************************************");
-
+#if defined DD360
+    log_info(" ******************  Project:DD360  *********************");
+#elif defined DD360Audi
+    log_info(" ******************  Project:DD360Audi  *****************");
+#elif defined DD360ComBox
+    log_info(" ******************  Project:DD360ComBox  ***************");
+#endif
+    log_info(" ********************************************************");
     if (!InitialSystemDefaultConfig()) {
         log_error("InitialSystemDefaultConfig NG ");
         //StopProcessingLoop();
@@ -4791,6 +4797,7 @@ int main(void)
                         pSysInfo->OrderCharging = NO_DEFINE;
                     }
                     StopSystemTimeoutDet();
+                    gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
                 }
 
                 isRessign = NO;
@@ -5239,8 +5246,9 @@ int main(void)
                         GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
                     setChargerMode(gunIndex, MODE_IDLE);
                     destroySelGun(gunIndex); //Jerry add
-#ifdef DD360 || DD3660ComBox
-					pSysInfo->SystemPage = _LCM_IDLE;
+#ifdef defined DD360 || defined DD3660ComBox
+					//pSysInfo->SystemPage = _LCM_IDLE;
+                    connectorPageRestoreIdle();
 #endif
                 }
 

+ 1 - 0
EVSE/Projects/DD360/Apps/CSU/main.h

@@ -43,6 +43,7 @@
 #define GUN_COMP_WAIT_TIMEOUT                   (10)
 #define GUN_PRECHARGING_TIMEOUT                 (60)
 #define EVCCID_LINK_TIMEOUT                     (120)
+#define PRECHARGING_TTIMEOUT                    (60)
 
 #define WHILE_LOOP_TIME                         (10000)
 

+ 4 - 2
EVSE/Projects/DD360/Apps/Config.h

@@ -333,11 +333,12 @@ typedef union {
     struct {
         uint8_t EmergencyStop: 1;    //Power cabinet emergency stop
         uint8_t DoorOpen: 1;         //Power cabinet emergency door open
+        uint8_t DcInputOVP: 1;
+        uint8_t DcInputUVP: 1;
         uint8_t SystemL1InputOVP: 1; //Power cabinet system L1 input OVP
         uint8_t SystemL2InputOVP: 1; //Power cabinet System L2 input OVP
         uint8_t SystemL3InputOVP: 1; //Power cabinet System L3 input OVP
         uint8_t PsuFailure: 1;       //Power cabinet PSU Failure Alarm
-        uint8_t Reserved: 2;
     } StatusBit;
 } PowerAlarmState;
 
@@ -378,7 +379,8 @@ typedef struct StDcCommonInfo {
     uint8_t TestTemperature; //ReadCmdline test, manual input value
     uint8_t CcsTypeSaved[2];
     PcPsuOutput PcPsuOutput[2];
-    uint8_t Reserved[3];
+    uint8_t chillerCtrl;
+    uint8_t debugflag;
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 17 - 0
EVSE/Projects/DD360/Apps/DebugLog.md

@@ -0,0 +1,17 @@
+2021/05/25
+1. Add detected chiller temperature and stop charging when it exceeds 90°C.
+2. Fix multi dispenser reboot, DHCP IP address conflict issue.
+3. Fix the GFD test failed and the alarm code was not recorded.
+4. Fix ccs OVP status code not release issue.
+5. Add to complete the registration but did not get the balance to restart DoComm.
+6. Add button stop charging function.
+
+2021/06/10
+1. Add Chiller temperature OTP and chiller sensor broken status code 012323 and 011038.
+
+2021/06/18
+1. ReadCmdLine.c add support double test charging function.
+
+2021/06/23
+1. Debug Module_RateCurrent.c lost gun type issue.
+2. 在充電第二把槍時,槍櫃等待主後送permission後再通知小板進入充電狀態。

+ 7 - 7
EVSE/Projects/DD360/Apps/Define/define.c

@@ -103,8 +103,8 @@ char FaultStatusCode[40][6]=
 "011036", //Rotary switch fault
 "011037", //CCS liquid chiller water level fault
 "011038", //Chiller temperature sensor broken
-"011039", //Reserved
-"011040" //Reserved
+"011039", //Parallel relay welding
+"011040"  //Parallel output relay driving fault
 };
 
 char AlarmStatusCode[160][6]=
@@ -233,11 +233,11 @@ char AlarmStatusCode[160][6]=
 "012321", // System CCS output UCP
 "012322", // System GBT output UCP
 "012323", // System Chiller output OTP
-"012324", // reserved
-"012325", // reserved
-"012326", // reserved
-"012327", // reserved
-"012328",   // reserved
+"012324", // Connector 1 detects abnormal voltage on the output line
+"012325", // Connector 2 detects abnormal voltage on the output line
+"012326", // System task is lost
+"012327", // DC input ovp
+"012328",   // DC input uvp
 "012329",   // reserved
 "012330",   // reserved
 "012331",   // reserved

+ 65 - 35
EVSE/Projects/DD360/Apps/Define/define.h

@@ -63,6 +63,15 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY    0
     #define PSU_QUANTITY            0
     #define ONE_CONNECTOR_USE       0
+#elif defined NoodoeAX
+    #define MAX_PSU_QUANTITY        62
+    #define CHAdeMO_QUANTITY        1
+    #define CCS_QUANTITY            1
+    #define GB_QUANTITY             0
+    #define AC_QUANTITY             1
+    #define GENERAL_GUN_QUANTITY    0
+    #define PSU_QUANTITY            0
+    #define ONE_CONNECTOR_USE       0
 #elif defined AX80
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        1
@@ -117,7 +126,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY	0
     #define PSU_QUANTITY            2
     #define ONE_CONNECTOR_USE       0
-#elif defined DD360 || defined DD360Audi || defined DD360ComBox
+#elif defined DD360 || defined DD360Audi || defined DD360ComBox || defined DD360UCar || defined DD360Tcci
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        2
     #define CCS_QUANTITY            2
@@ -312,6 +321,8 @@ enum CoreProfile {
      TimeOffsetNextTransition,
      SystemUptimeSec,
      FreeVend,
+     OcppServer,
+     MaintainServer,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -450,7 +461,10 @@ typedef union
         unsigned int AlarmStop:1;                   // 0: no effect,    1: alarm stop
         unsigned int BackendStop:1;                 // 0: no effect,    1: backend stop
         unsigned int ManualStop:1;                  // 0: no effect,    1: manual stop
-        unsigned int res:28;
+        unsigned int HardResetStop:1;               // 0: no effect,    1: hard reset stop
+        unsigned int SoftResetStop:1;               // 0: no effect,    1: soft reset stop
+        unsigned int InvalidIdStop:1;               // 0: no effect,    1: invalid stop when StopTransactionOnInvalidId is true
+        unsigned int res:25;
     }bits;
 }ChargingStop;
 
@@ -551,9 +565,11 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           OcppReceiptrURL[512];               // Charging receipt display URL
+    unsigned char           isAuthrizeByEVCCID;                 // is Authorize by EVCCID (CCS)
+    unsigned char           MaintainServerURL[512];             // ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
 };
 
 struct ChargingInfoData
@@ -580,6 +596,7 @@ struct ChargingInfoData
 	float PresentChargingCurrent;   // unit: 1A
 	float PresentChargingPower;		//0~6553.5 kW
 	float PresentChargedEnergy;		//0~6553.5 kWh
+	float presentChargedEnergyPeriod[24];       // Session present charged energy at each period
 	int PresentChargedDuration;	// second
 	int RemainChargingDuration;	// second
 	float EvBatteryMaxVoltage;		// 0~6553.5 volt
@@ -654,8 +671,23 @@ struct ChargingInfoData
     unsigned char       PantographFlag;                 // 0: normal gun type,  1: pantograph gun type
     unsigned char       Replug_flag;
     unsigned char       isEVCCIDVerify;
+    unsigned char       CCSGunType;
+    struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
+typedef struct
+{
+    unsigned char       AuthId[32];
+                                                        // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
+    unsigned char       AuthStatus;                     // 3: Authorize done, 4: Authorize end
+    unsigned char       AuthTarget;                     // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
+    unsigned char       AuthType;                       // 0: _AuthType_None,   1: _AuthType_RFID, 2: _AuthType_RemoteStart
+    unsigned char       AuthResult;                     // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    unsigned char       AuthRequest;                    // 0: no request, 1: authorize request
+    unsigned char       res;
+}AuthorizingInfoData;
+
 typedef union
 {
     unsigned int SettingValue;
@@ -666,7 +698,6 @@ typedef union
         unsigned int DispenserConfigSync:1;             // 0: not synced,   1: synced
         unsigned int MiscNeedAnnouncement:1;            // 0: no need,      1: need send misc command
         unsigned int NeedDispenserVerInfo:1;            // 0: no need,      1: need dispenser to report it's version info
-        unsigned int EnableAutoGunSelection:1;          // 0: disable,      1: enable auto gun selection
         unsigned int AuthorizeRequest:1;                // 0: idle,         1: requesting                           ( dispenser -> cabinet)
         unsigned int ConnectorTimeoutConfigRequest:1;   // 0: no request,   1: connector timeout setting            (    ocpp   -> cabinet -> dispenser)
         unsigned int DefaultPriceConfigRequest:1;       // 0: no request,   1: default price setting                (    ocpp   -> cabinet -> dispenser)
@@ -686,6 +717,7 @@ typedef union
         unsigned int StopButtonStatusRequest:1;         // 0: no request,   1: stop charging button status has changed          ( cabinet -> dispenser)
         unsigned int AuthModeConfigRequest:1;           // 0: no request,   1: AuthMode Config has changed                      ( cabinet -> dispenser)
         unsigned int EVCCIDConfigRequest:1;             // 0: no request,   1: EVCCID Config has changed                        ( cabinet -> dispenser)
+        unsigned int LEDIntensityRequest:1;             // 0: no request,   1: LED Intensity has changed                        ( cabinet -> dispenser)
         unsigned int res:7;
     }bits;
 }DispenserSettingFlag;
@@ -723,11 +755,7 @@ struct DispenserModule
     unsigned char   Connector2FwRev[32];        //Connector2 module firmware version
     struct   LED    LedInfo;                    // LED configuration info
 
-                                                // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
-    unsigned char           AuthStatus;         // 3: Authorize done, 4: Authorize end
-    unsigned char           AuthTarget;         // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
-    unsigned char           AuthType;           // 0: _AuthType_None, 1: _AuthType_RFID, 2: _AuthType_RemoteStart
-    unsigned char           AuthResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData     AuthInfo;
     DispenserSettingFlag    Setting;
     char                    FwFileName[128];
     unsigned char           ConnectionChannel;
@@ -808,7 +836,8 @@ typedef union
         unsigned int  FaultStatusRequest:1;
         unsigned int  Disconnection:1;
         unsigned int  GfdDetection:1;                   // 0: stop,         1: start
-        unsigned int  res:9;
+        unsigned int  GetStartChargingSoc:1;            // 0: no effect,    1: get start soc
+        unsigned int  res:8;
     }bits;
 }ConnectorParameter;
 
@@ -820,8 +849,7 @@ struct ConnectorInfoData
     unsigned char ParentDispensetIndex;                 // Parent Dispenser Index: 0 ~ 3
     ConnectorParameter       Parameter;
 
-    unsigned char            AuthorizingType;
-    unsigned char            AuthorizingResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData      AuthInfo;
     struct ChargingInfoData  GeneralChargingData;
     struct WARNING_CODE_INFO WarningInfo;
 
@@ -840,8 +868,11 @@ struct ConnectorInfoData
 
     unsigned short          MaxTotalChargingCurrent;        // max total output current, unit: 0.1A
     unsigned short          MaxTotalChargingPower;          // max total output power, unit: 0.1kw
-    unsigned short          MaxOutputEnergy;                //0: no limit,  1 ~ 65535   kWh
-    unsigned short          MaxOutputDuration;              //0: no limit,  1 ~ 65535   minutes
+    unsigned short          MaxOutputEnergy;                // 0: no limit,  1 ~ 65535   kWh
+    unsigned short          MaxOutputDuration;              // 0: no limit,  1 ~ 65535   minutes
+    float                   CapabilityVoltage;              // unit 0.1V
+    float                   CapabilityCurrent;              // unit 0.1A
+    float                   CapabilityPower;                // unit 0.1kW
 
     unsigned int            UserPrice;                      // connector user's user price, unit: 0.01 (dollar / kWh)
     unsigned int            TotalCost;                      // connector user's total cost, unit: 0.01 dollar
@@ -853,14 +884,11 @@ typedef union
     unsigned int SettingValue;
     struct
     {
-        unsigned int StartAuthorize:1;          // 0: idle,    1: authorizing
-        unsigned int AuthorizingCompleted:1;    // 0: not yet, 1: authorizing completed
         unsigned int DispenserDisconnection:1;  // 0: no connection,  1: dispenser connected
-        unsigned int BackendAuthorized:1;       // 0: local authorized, 1: backend authorized
         unsigned int FlashConfigChanged:1;      // 0: no effect, 1: flash config has changed
         unsigned int EnableWriteFlash:1;        // 0: no effect, 1: enable to write flash after timeout
         unsigned int CleanWiringInfo:1;         // 0: no effect, 1: clean wiring info
-        unsigned int res:25;
+        unsigned int res:28;
     }bits;
 }CabinetSettingFlag;
 
@@ -943,7 +971,7 @@ struct SysInfoData
 	unsigned char 		InternetConn;					//0: disconnected, 1: connected
 	/**************Backend***************/
 	unsigned char 		OcppConnStatus;					//0: disconnected, 1: connected
-	unsigned char 		MaintainServerConnStatus;		//0: disconnected, 1: connected
+    unsigned char       MaintainServerConnStatus;       //0: disconnected, 1: connected
 	char 				OrderCharging;
     float               MaxChargingProfilePower;        // unit: 1W
 	/**************Alston***************/
@@ -986,7 +1014,7 @@ struct SysInfoData
     CabinetMiscCommand      CabinetMicsStatus;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     DC_Meter_Info DcMeterInfo[4];
-    unsigned char           OTPTemp;                    // OTP Temperature 
+    unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
 };
 
@@ -1112,8 +1140,8 @@ char FaultStatusCode[40][6]=
 	"011036",	//Rotary switch fault
 	"011037",	//CCS liquid chiller water level fault
 	"011038",	//Chiller temperature sensor broken
-	"011039",	//Reserved
-	"011040"	//Reserved
+	"011039",	//Parallel relay welding
+	"011040"	//Parallel output relay driving fault
 };
 */
 
@@ -1168,7 +1196,8 @@ struct FaultCodeData
 			unsigned char RotarySwitchFault:1;					//bit 3 
 			unsigned char CcsLiquidChillerWaterLevelFault:1;    //bit 4
             unsigned char ChillerTempSensorBroken:1;            //bit 5
-            unsigned char :2;                                   //bit 6 ~ 7 reserved
+            unsigned char ParallelRelayWelding:1;               //bit 6
+            unsigned char ParallelRelayDriving:1;               //bit 7
 		}bits;
 	}FaultEvents;
 };
@@ -1303,8 +1332,8 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // reserved
-    "012328",   // reserved
+    "012327",   // DC input ovp
+    "012328",   // DC input uvp
     "012329",   // reserved
     "012330",   // reserved
     "012331",   // reserved
@@ -1489,9 +1518,10 @@ struct AlarmCodeData
             unsigned char AbnormalVoltageOnOutputLine_1:1;          //bit 4
             unsigned char AbnormalVoltageOnOutputLine_2:1;          //bit 5
             unsigned char SystemTaskLost:1;                         //bit 6
-            unsigned char Reserved:1;                               //bit 7
+            unsigned char DcInputOVP:1;                             //bit 7
             //AlarmVal[16]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char DcInputUVP:1;                             //bit 0
+            unsigned char :7;                                       //reserved bit 1 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -4264,7 +4294,7 @@ struct StructDataTransfer
 	unsigned char MessageId[52];
 	unsigned char Data[512];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];
+	unsigned char ResponseData[512];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4383,7 +4413,7 @@ struct OCPP16ConfigurationItem
 {
 	unsigned char 		ItemName[64];
 	unsigned char 		ItemAccessibility;//0:RO, 1:RW
-	unsigned char 		ItemData[500];
+	unsigned char 		ItemData[501];//value should be limited in 500 bytes
 };
 
 struct OCPP16ConfigurationTable
@@ -4563,9 +4593,9 @@ struct StructSignedFirmwareStatusNotification
 
 struct StructSessionTarget
 {
-	unsigned char		targetSoc;			// Unit: %,   		0 is unlimit
-	unsigned short		targetEnergy;		// Unit: KWH		0 is unlimit
-	unsigned short		targetDuration;		// Unit: Minutes	0 is unlimit
+    unsigned char       targetSoc;          // Unit: %,         0 is unlimit
+    unsigned short      targetEnergy;       // Unit: KWH        0 is unlimit
+    unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
 struct OCPP16Data
@@ -4756,7 +4786,7 @@ struct OCPP16Data
     struct StructSecurityEventNotification          SecurityEventNotification;
     struct StructSignCertificate                    SignCertificate;
     struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget	                    SessionTarget[CONNECTOR_QUANTITY];
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
 };
 
 

+ 9 - 3
EVSE/Projects/DD360/Apps/ModuleChkSysTask/Module_ChkSysTask.c

@@ -24,6 +24,7 @@ struct ChargingInfoData *pAcChargingInfo = NULL;
 static struct ChargingInfoData *pDcChargingInfo = NULL;
 struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 struct StatusCodeData           *ShmStatusCodeData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -226,13 +227,14 @@ void main(void)
         log_error("create share memory error");
         return ;
     }
-
+    MappingGunChargingInfo("CheckSystem Task");
     pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
     pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSysConfigAndInfo = (struct SysConfigAndInfo *)GetShmSysConfigAndInfo();
-    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();	
-    MappingGunChargingInfo("CheckSystem Task");
+    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
+
     while(true)
     {
       	for (uint8_t gun = 0; gun < pSysConfig->TotalConnectorCount; gun++) {
@@ -240,6 +242,10 @@ void main(void)
 			if (pDcChargingInfo->SystemStatus == SYS_MODE_UPDATE )
 				continue;
 		}
+        if (ShmDcCommonData->debugflag == YES) {
+            sleep(3);
+            continue;
+        }
 		CheckSystemTaskAlive();
 		sleep(3);
     }

+ 13 - 4
EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.c

@@ -854,6 +854,7 @@ static void addFaultCodeToBuf(uint8_t *Code)
                Code,
                strlen((char *)Code));
         pSysWarning->WarningCount++;
+        log_info("Warning Code:%s",Code);
     }
 }
 
@@ -912,7 +913,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     //uint8_t statusCodeError = 0;
 
     if (dataLen > 0) {
-        Hexdump((uint8_t *)data, dataLen);
+        //Hexdump((uint8_t *)data, dataLen);
 
         remaindLen = dataLen % WARNING_CODE_SIZE;
 
@@ -923,7 +924,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
 
         if (dataLen < WARNING_CODE_SIZE) {
             log_error("fail status code length = %d", dataLen);
-            Hexdump(data, dataLen);
+            //Hexdump(data, dataLen);
             if (pSysWarning->WarningCount > 0) {
                 for (i = 0; i < pSysWarning->WarningCount; i++) {
                     usleep(128);
@@ -993,7 +994,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     } else {
         if (CompareArrayIsZero(data, WARNING_CODE_SIZE) == false) {
             log_error("power cabinet status code data length is zero, but have data");
-            Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
+            //Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
         }
     }
 
@@ -1417,6 +1418,7 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
 
     pConnState->ConnectorTemp = pDcChargingInfo->ConnectorTemp;
     pConnState->ChillerTemp = pDcChargingInfo->ChillerTemp;
+    pConnState->PlugIn = pDcChargingInfo->ConnectorPlugIn;
 
     if (pDcChargingInfo->SystemStatus <= S_AUTHORIZING) {
         pConnState->State = CONN_ST_IDLE;    //idle
@@ -1431,7 +1433,8 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
         pConnState->State = CONN_ST_PREPARING;    //preparing
     } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
         pConnState->State = CONN_ST_CHARGING;    //charging
-    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING) {
+    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING ||
+            pDcChargingInfo->SystemStatus == S_COMPLETE) {
         pConnState->State = CONN_ST_TERMINATING;    //terminating
     } else if ((pDcChargingInfo->SystemStatus == S_ALARM) ||
                (pDcChargingInfo->SystemStatus == S_FAULT)) {
@@ -1445,9 +1448,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                     (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                     WARNING_CODE_SIZE);
             vendorErrorCodeTmp[plugNum][6] = '\0';
+            /*
             log_info("1 ID = %d, VendorErrorCode = %s",
                      plugNum,
                      (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                     */
         } else {
             if (strncmp(&vendorErrorCodeTmp[plugNum][0],
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
@@ -1457,9 +1462,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                         WARNING_CODE_SIZE);
                 vendorErrorCodeTmp[plugNum][6] = '\0';
+                /*
                 log_info("2 ID = %d, VendorErrorCode = %s",
                          plugNum,
                          (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                         */
             }
         }
     }
@@ -2053,7 +2060,9 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_PREPARING_FOR_EVSE: //insaulation test
     case S_CCS_PRECHARGE_ST0:
     case S_CCS_PRECHARGE_ST1:
+
         writeChargingTarget(fd, plugNum, gunID);
+
 		if (pDcChargingInfo->PantographFlag)
 			writeGroundFaultDetection(fd, 1, gunID);
 

+ 2 - 1
EVSE/Projects/DD360/Apps/ModuleDoComm/DoComm.h

@@ -130,7 +130,8 @@ typedef struct StConnectorState {
     uint8_t WarningCode[6];
     uint8_t ConnectorTemp;
     uint8_t ChillerTemp;
-    uint8_t Reserved[3];
+    uint8_t PlugIn;
+    uint8_t Reserved[2];
 } ConnectorState;
 
 typedef struct StConnectorIDTable {

+ 2 - 1
EVSE/Projects/DD360/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -417,7 +417,8 @@ void CANReceiver(int fd)
                         (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
                          pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1)
                    ) {
-                    if (pDcChargingInfo->EvBatteryStartSoc <= 0) {
+                    if (pDcChargingInfo->EvBatteryStartSoc <= 0 &&
+                            pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE) {
                         pDcChargingInfo->EvBatteryStartSoc = frame.data[1];
                     }
 

+ 0 - 3
EVSE/Projects/DD360/Apps/ModuleInternalComm/FanBoard.c

@@ -76,9 +76,6 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
-        return;
-    }
 
     // 風控修改 :
     // ******************************************************* //

+ 1 - 2
EVSE/Projects/DD360/Apps/ModuleInternalComm/RelayBoard.c

@@ -1200,7 +1200,6 @@ static void SetFanModuleSpeed(void)
             _setFanSpeed = ShmFanModuleData->SetFan1Speed;
         }
 
-        //printf("_setFanSpeed = %d \n", _setFanSpeed);
         _fanSpeed.speed[0] = _setFanSpeed;
 
         _fanSpeed.speed[1] = _setFanSpeed;
@@ -1237,7 +1236,7 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
+    if (ShmDcCommonData->debugflag== YES) {
         return;
     }
 

+ 102 - 7
EVSE/Projects/DD360/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -16,7 +16,7 @@
 #include "../Define/define.h"
 #include "../Config.h"
 #include "../SelectGun/SelectGun.h"
-
+#include "../CSU/main.h"
 //------------------------------------------------------------------------------
 //struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 //struct StatusCodeData           *ShmStatusCodeData;
@@ -31,7 +31,7 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
 static struct ChargingInfoData *pAcChargingInfo = NULL;
 
 bool needReloadQr = true;
-
+bool _saftydetect = false;
 bool _isShow = false; //DS60-120 add
 uint8_t _showInformIndex = 0; //DS60-120 add
 
@@ -215,7 +215,7 @@ uint8_t _logo_cmp               = 62;
 uint8_t _battery_eng_trp_map    = 63;
 uint8_t _money_trp_map          = 64;
 uint8_t _elapse_time_trp_map    = 65;
-
+#if defined DD360Audi
 ////For Audi
 uint8_t _left_gun_disable_map   = 66;
 uint8_t _left_gun_enable_map    = 67;
@@ -240,7 +240,18 @@ uint8_t _showselectgun_right    = 78;
 short __show_waitgunplug_value    = 0x0468;
 uint8_t _showwaitgunplug_left     = 80;
 uint8_t _showwaitgunplug_right    = 81;
-
+#else
+short __show_handshark_value    = 0x0464;
+short __show_GFD_value          = 0x0466;
+short __show_precharge_value    = 0x0468;
+
+uint8_t _show_handshark_dark    = 67;
+uint8_t _show_handshark_light   = 68;
+uint8_t _show_GFD_dark          = 69;
+uint8_t _show_GFD_light         = 70;
+uint8_t _show_precharge_dark    = 71;
+uint8_t _show_precharge_light   = 72;
+#endif
 //#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -562,6 +573,7 @@ void ChangeWarningFunc()
     //log_info("WarningCount = %d ", pSysWarning->WarningCount);
 //#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
     for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
         memset(cmd, 0x00, sizeof(cmd));
         if ((i) >= 5) {
             break;
@@ -880,7 +892,7 @@ void GetTimespecFunc(struct timespec *time)
 {
     clock_gettime(CLOCK_MONOTONIC_COARSE, time);
 }
-
+#if defined DD360Audi
 void RunReplugStringFunction(bool isRun)
 {
     if (isRun) {
@@ -918,7 +930,7 @@ void RunFullTargetFunction(bool isRun)
         ChangeDisplay2Value(__show_StatusString_value_2, _disappear);
     }
 }
-
+#endif
 /**
  * [ChangeBalanceValue :print balance information]
  * @Author
@@ -1739,6 +1751,40 @@ void InformationShow()
     }
 }
 
+void showPhihongLogo(bool _show)
+{
+    /*
+    if( pSysConfig->ModelName[3] == 'U' ) {
+        if (pSysConfig->ModelName[12] == 'P' && pSysConfig->ModelName[13] == 'H') {
+            ChangeDisplay2Value(_logo, _disappear);
+            ChangeDisplay2Value(_logo_cmp, _disappear);
+        }
+    }
+    */
+    if (!_show) {
+        ChangeDisplay2Value(_logo, _disappear);
+        ChangeDisplay2Value(_logo_cmp, _disappear);
+    }
+}
+unsigned long GetPreChargeTimeoutValue(struct timeval _sour_time)
+{
+    struct timeval _end_time;
+    gettimeofday(&_end_time, NULL);
+
+    return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
+}
+
+void ChangeTimeValue(uint8_t time)
+{
+    uint8_t cmd[2];
+    uint8_t value[2];
+
+    memset(cmd, 0x00, sizeof(cmd));
+    sprintf((char *) value, "%d", time);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
+}
+
 void ProcessPageInfo()
 {
     _page_reload = IsPageReloadChk();
@@ -1756,7 +1802,7 @@ void ProcessPageInfo()
             ChangeDisplay2Value(__sel_gun_btn, _disappear);
         }
     }
-
+    showPhihongLogo(false);
     switch (_currentPage) {
 #if defined DD360Audi
     case _LCM_SELECT_GUN: ////For Audi
@@ -1772,6 +1818,7 @@ void ProcessPageInfo()
 #endif //defined DD360Audi
 
     case _LCM_IDLE: {
+
         if (pSysConfig->isRFID) {
             ChangeDisplay2Value(__main_rfid, _main_rfid);
         } else {
@@ -2040,6 +2087,54 @@ void ProcessPageInfo()
             if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {
                     ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
+                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
+                    if (precharg_time > PRECHARGING_TTIMEOUT)
+                        precharg_time = PRECHARGING_TTIMEOUT;
+                    ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
+
+                    if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
+                            pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
+                        pDcChargingInfo->_SaftyDetect = false;
+                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
+                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+
+                    } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
+                        if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
+                            if (pDcChargingInfo->_SaftyDetect == false ) {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                                if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                    pDcChargingInfo->_SaftyDetect = true;
+                            } else {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                            }
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        }
+                    } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
+                            pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
+                        if (pDcChargingInfo->_SaftyDetect == false ) {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                            if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                pDcChargingInfo->_SaftyDetect = true;
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        }
+                    } else {
+                        ChangeDisplay2Value(__show_handshark_value, _disappear);
+                        ChangeDisplay2Value(__show_GFD_value, _disappear);
+                        ChangeDisplay2Value(__show_precharge_value, _disappear);
+                    }
                 }
             } else if (_currentPage == _LCM_CHARGING && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {

+ 11 - 5
EVSE/Projects/DD360/Apps/ModulePrimary/Module_PrimaryComm.c

@@ -44,6 +44,7 @@ static struct SysInfoData *pSysInfo = NULL;
 static struct AlarmCodeData *pAlarmCode = NULL;
 static struct FaultCodeData *pFaultCode = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 const char *priPortName = "/dev/ttyS1";
 uint8_t gun_count; //DS60-120 add
@@ -419,6 +420,9 @@ static void checkChillerStatus(Gpio_out *gpio)
         }
     }
 
+    if (ShmDcCommonData->debugflag == YES)
+        _chillerNeedOn = ShmDcCommonData->chillerCtrl;
+
     if(_chiller.ChillerSwitch != _chillerNeedOn)
     {
         log_info("Chiller Need Turn %s", _chillerNeedOn == YES ? "ON" : "OFF");
@@ -639,6 +643,7 @@ int main(void)
     pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
     pFaultCode = (struct FaultCodeData *)GetShmFaultCodeData();
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     Uart1Fd = InitComPort();
     //log_info("407 Port id = %d ", Uart1Fd);
@@ -664,6 +669,11 @@ int main(void)
     for (;;) {
         // 程序開始之前~ 必須先確定 FW 版本與硬體版本,確認後!!~ 該模組才算是真正的 Initial Comp.
         // 模組更新 FW 後,需重新做
+        if(IsPrimaryProcessNeedPause() == true)
+        {
+            sleep(1);
+            continue;
+        }
         if (ShmPrimaryMcuData->SelfTest_Comp != PASS) {
             //log_info("(407) Get Fw and Hw Ver. ");
             GetFwAndHwVersion(Uart1Fd);
@@ -674,11 +684,7 @@ int main(void)
 
             GetInputGpioStatus(Uart1Fd);
         }
-        if(IsPrimaryProcessNeedPause() == true)
-        {
-            sleep(1);
-            continue;
-        }
+
 
         usleep(50000);
     }

+ 30 - 5
EVSE/Projects/DD360/Apps/ReadCmdline.c

@@ -517,8 +517,12 @@ void GetGunSelectedNum(char *v1)
 void SetFanSpeed(char *v1)
 {
     int speed = atoi(v1);
-
-    ShmFanModuleData->TestFanSpeed = speed;
+    if(ShmDcCommonData->debugflag == YES) {
+        ShmFanModuleData->TestFanSpeed = speed;
+        printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
+    }
+    else
+        printf("Please open debug mode\n");
 }
 
 void GetFanSpeed()
@@ -533,7 +537,8 @@ void SetDebugMode(char *v1)
 {
     int mode = atoi(v1);
 
-    pSysConfig->SwitchDebugFlag = mode;
+    ShmDcCommonData->debugflag = mode;
+    printf("Set Debug Mode:%d\n" , ShmDcCommonData->debugflag);
 }
 
 void SetGFDMode(char *v1)
@@ -717,7 +722,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         printf ("Input Voltage over range\n");
         return;
     }
-
     //kill ev task
     system("killall Module_EvComm");
 
@@ -771,6 +775,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
             //清除 main timeout 機制
             pDcChargingInfo->TimeoutFlag = 0;
+            pSysInfo->SystemTimeoutFlag = 0;
+            pSysInfo->SystemPage = _LCM_NONE;
             //不論是什麼 type 的槍都固意設成 Chademo 不跑 Prechage step
             pDcChargingInfo->Type = 9;
             break;
@@ -941,6 +947,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
             pDcChargingInfo->PresentChargingPower = 0;
 
             if (stopChg == pSysConfig->TotalConnectorCount) {
+
                 system("/root/Module_EvComm &");
                 sleep(3);
 
@@ -1187,7 +1194,17 @@ static void writeOTPTemp(void)
         usleep(sleepTime);
     }//while
 }
-
+void writeChillerStatus(char *v1)
+{
+    if (ShmDcCommonData->debugflag == YES) {
+        ShmDcCommonData->chillerCtrl = atoi(newString[1]);
+        if (ShmDcCommonData->chillerCtrl)
+            printf("Chiller set on\n");
+        else
+            printf("Chiller set off\n");
+    } else
+        printf("Please open Debug mode\n");
+}
 static void writeGunAndChillerTemp(void)
 {
     uint8_t _GunIndex = 0;
@@ -1288,6 +1305,7 @@ int main(void)
                      "       tempW                             : write connector header and Chiller temperature\r\n"
                      "       tempR                             : print connector header and chiller temperature\r\n"
                      "       OTP                               : Write OTP temperature\r\n"
+                     "       chiller                           : set chiller on/off"
                      "\r\n";
 
     if (CreateAllCsuShareMemory() == FAIL) {
@@ -1323,6 +1341,7 @@ int main(void)
 //    }
 
     while (isContinue) {
+
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
         }
@@ -1437,6 +1456,10 @@ int main(void)
             }
             SetChargingInfoCCID(newString[1], newString[2]);
         } else if (strcmp(newString[0], "strchg") == 0) {
+            if (ShmDcCommonData->debugflag == NO ) {
+                printf("Please Open debug mode\n");
+                continue;
+            }
             //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
             if (strcmp(newString[1], "auto") == 0) {
                 newString[2][0] = 0;
@@ -1457,6 +1480,8 @@ int main(void)
             resdGunAndChillerTemp();
         } else if (strcmp(newString[0], "OTP") == 0) { //測試槍頭和水冷機溫度
             writeOTPTemp();
+        } else if (strcmp(newString[0], "chiller") == 0) { //測試槍頭和水冷機溫度
+            writeChillerStatus(newString[1]);
         } else {
             printf("%s\n", usageMsg);
         }

+ 2 - 0
EVSE/Projects/DD360/Apps/Script/copy_from_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+sudo cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

+ 2 - 0
EVSE/Projects/DD360/Apps/Script/copy_to_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/* /mnt/d/Phihong/Project/DD360Audi/Apps/

BIN
EVSE/Projects/DD360/Apps/UnsafetyOutputTask


BIN
EVSE/Projects/DD360/Images/ramdisk.gz


BIN
EVSE/Projects/DD360/output/FactoryConfig


BIN
EVSE/Projects/DD360/output/Module_ChkSysTask


BIN
EVSE/Projects/DD360/output/Module_DoComm


BIN
EVSE/Projects/DD360/output/Module_EvComm


BIN
EVSE/Projects/DD360/output/Module_EventLogging


BIN
EVSE/Projects/DD360/output/Module_InternalComm


BIN
EVSE/Projects/DD360/output/Module_LcmControl


BIN
EVSE/Projects/DD360/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360/output/Module_UpdateFW


BIN
EVSE/Projects/DD360/output/ReadCmdline


BIN
EVSE/Projects/DD360/output/UnsafetyOutputTask


BIN
EVSE/Projects/DD360/output/main


BIN
EVSE/Projects/DD360/output/simulation


BIN
EVSE/Projects/DD360Audi/Apps/CSU/.main.c.swp


+ 22 - 9
EVSE/Projects/DD360Audi/Apps/CSU/Primary.c

@@ -339,6 +339,14 @@ void ChkPrimaryStatus(void)
                 ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
                 EmcOccureByString("042252");
                 Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
+                EmcOccureByString("042327");
+                Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
+                EmcOccureByString("042328");
+                Rtn = 1;
             } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
                 ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
                 EmcOccureByString("042200");
@@ -364,12 +372,16 @@ void ChkPrimaryStatus(void)
         if (Rtn == 0) {
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
             ReleaseEmsOccureByString(0, "042251");
             ReleaseEmsOccureByString(0, "042252");
+            ReleaseEmsOccureByString(0, "042327");
+            ReleaseEmsOccureByString(0, "042328");
             ReleaseEmsOccureByString(0, "042200");
             ReleaseEmsOccureByString(0, "042201");
             ReleaseEmsOccureByString(0, "042202");
@@ -379,12 +391,16 @@ void ChkPrimaryStatus(void)
     } else {
         ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
         ReleaseEmsOccureByString(0, "042251");
         ReleaseEmsOccureByString(0, "042252");
+        ReleaseEmsOccureByString(0, "042327");
+        ReleaseEmsOccureByString(0, "042328");
         ReleaseEmsOccureByString(0, "042200");
         ReleaseEmsOccureByString(0, "042201");
         ReleaseEmsOccureByString(0, "042202");
@@ -428,13 +444,10 @@ void ChkPrimaryStatus(void)
     //}
 
     if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
-            !leftBtnPush
-#if defined DD360Audi
-            &&
+            !leftBtnPush &&
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
-#endif //defined DD360Audi
        ) {
         pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
 
@@ -538,15 +551,14 @@ void ChkPrimaryStatus(void)
     }
 
     if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
-            !rightBtnPush
+            !rightBtnPush &&
 #if defined DD360Audi
-            &&
             pSysInfo->SystemPage != _LCM_IDLE &&
+#endif
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
             pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
-#endif //defined DD360Audi
        ) {
         if (!rightBtnPush) {
             rightBtnPush = true;
@@ -576,9 +588,10 @@ void ChkPrimaryStatus(void)
                 pSysInfo->CurGunSelected = 0;
                 ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
             }
+            log_info("current select gun ............................... %d ",
+                     pSysInfo->CurGunSelected);
         }
-        log_info("current select gun ............................... %d ",
-                 pSysInfo->CurGunSelected);
+
     } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
         if (rightBtnPush) {
             rightBtnPush = false;

+ 16 - 8
EVSE/Projects/DD360Audi/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V1.18.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.18.0";
+char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
+char* DebugVersion = "v1.19.4";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1644,9 +1644,6 @@ void _DetectPlugInTimeout(void)
 	setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
 #elif DD360 || DD360Combox
  	setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
-    systemPageRestoreInit();
-   
-	return;
 #endif
     systemPageRestoreInit();
 }
@@ -3849,6 +3846,8 @@ static void ReviewCriticalAlarm(void)
             //Power cabinet alarm status
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP == YES ||
@@ -4362,7 +4361,14 @@ int main(void)
     log_info(" ********************************************************");
     log_info(" ******************  FileSystem Boot up *****************");
     log_info(" ********************************************************");
-
+#if defined DD360
+    log_info(" ******************  Project:DD360  *********************");
+#elif defined DD360Audi
+    log_info(" ******************  Project:DD360Audi  *****************");
+#elif defined DD360ComBox
+    log_info(" ******************  Project:DD360ComBox  ***************");
+#endif
+    log_info(" ********************************************************");
     if (!InitialSystemDefaultConfig()) {
         log_error("InitialSystemDefaultConfig NG ");
         //StopProcessingLoop();
@@ -4791,6 +4797,7 @@ int main(void)
                         pSysInfo->OrderCharging = NO_DEFINE;
                     }
                     StopSystemTimeoutDet();
+                    gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
                 }
 
                 isRessign = NO;
@@ -5239,8 +5246,9 @@ int main(void)
                         GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
                     setChargerMode(gunIndex, MODE_IDLE);
                     destroySelGun(gunIndex); //Jerry add
-#ifdef DD360 || DD3660ComBox
-					pSysInfo->SystemPage = _LCM_IDLE;
+#ifdef defined DD360 || defined DD3660ComBox
+					//pSysInfo->SystemPage = _LCM_IDLE;
+                    connectorPageRestoreIdle();
 #endif
                 }
 

+ 1 - 0
EVSE/Projects/DD360Audi/Apps/CSU/main.h

@@ -43,6 +43,7 @@
 #define GUN_COMP_WAIT_TIMEOUT                   (10)
 #define GUN_PRECHARGING_TIMEOUT                 (60)
 #define EVCCID_LINK_TIMEOUT                     (120)
+#define PRECHARGING_TTIMEOUT                    (60)
 
 #define WHILE_LOOP_TIME                         (10000)
 

+ 4 - 2
EVSE/Projects/DD360Audi/Apps/Config.h

@@ -333,11 +333,12 @@ typedef union {
     struct {
         uint8_t EmergencyStop: 1;    //Power cabinet emergency stop
         uint8_t DoorOpen: 1;         //Power cabinet emergency door open
+        uint8_t DcInputOVP: 1;
+        uint8_t DcInputUVP: 1;
         uint8_t SystemL1InputOVP: 1; //Power cabinet system L1 input OVP
         uint8_t SystemL2InputOVP: 1; //Power cabinet System L2 input OVP
         uint8_t SystemL3InputOVP: 1; //Power cabinet System L3 input OVP
         uint8_t PsuFailure: 1;       //Power cabinet PSU Failure Alarm
-        uint8_t Reserved: 2;
     } StatusBit;
 } PowerAlarmState;
 
@@ -378,7 +379,8 @@ typedef struct StDcCommonInfo {
     uint8_t TestTemperature; //ReadCmdline test, manual input value
     uint8_t CcsTypeSaved[2];
     PcPsuOutput PcPsuOutput[2];
-    uint8_t Reserved[3];
+    uint8_t chillerCtrl;
+    uint8_t debugflag;
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 17 - 0
EVSE/Projects/DD360Audi/Apps/DebugLog.md

@@ -0,0 +1,17 @@
+2021/05/25
+1. Add detected chiller temperature and stop charging when it exceeds 90°C.
+2. Fix multi dispenser reboot, DHCP IP address conflict issue.
+3. Fix the GFD test failed and the alarm code was not recorded.
+4. Fix ccs OVP status code not release issue.
+5. Add to complete the registration but did not get the balance to restart DoComm.
+6. Add button stop charging function.
+
+2021/06/10
+1. Add Chiller temperature OTP and chiller sensor broken status code 012323 and 011038.
+
+2021/06/18
+1. ReadCmdLine.c add support double test charging function.
+
+2021/06/23
+1. Debug Module_RateCurrent.c lost gun type issue.
+2. 在充電第二把槍時,槍櫃等待主後送permission後再通知小板進入充電狀態。

+ 7 - 7
EVSE/Projects/DD360Audi/Apps/Define/define.c

@@ -103,8 +103,8 @@ char FaultStatusCode[40][6]=
 "011036", //Rotary switch fault
 "011037", //CCS liquid chiller water level fault
 "011038", //Chiller temperature sensor broken
-"011039", //Reserved
-"011040" //Reserved
+"011039", //Parallel relay welding
+"011040"  //Parallel output relay driving fault
 };
 
 char AlarmStatusCode[160][6]=
@@ -233,11 +233,11 @@ char AlarmStatusCode[160][6]=
 "012321", // System CCS output UCP
 "012322", // System GBT output UCP
 "012323", // System Chiller output OTP
-"012324", // reserved
-"012325", // reserved
-"012326", // reserved
-"012327", // reserved
-"012328",   // reserved
+"012324", // Connector 1 detects abnormal voltage on the output line
+"012325", // Connector 2 detects abnormal voltage on the output line
+"012326", // System task is lost
+"012327", // DC input ovp
+"012328",   // DC input uvp
 "012329",   // reserved
 "012330",   // reserved
 "012331",   // reserved

+ 65 - 35
EVSE/Projects/DD360Audi/Apps/Define/define.h

@@ -63,6 +63,15 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY    0
     #define PSU_QUANTITY            0
     #define ONE_CONNECTOR_USE       0
+#elif defined NoodoeAX
+    #define MAX_PSU_QUANTITY        62
+    #define CHAdeMO_QUANTITY        1
+    #define CCS_QUANTITY            1
+    #define GB_QUANTITY             0
+    #define AC_QUANTITY             1
+    #define GENERAL_GUN_QUANTITY    0
+    #define PSU_QUANTITY            0
+    #define ONE_CONNECTOR_USE       0
 #elif defined AX80
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        1
@@ -117,7 +126,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY	0
     #define PSU_QUANTITY            2
     #define ONE_CONNECTOR_USE       0
-#elif defined DD360 || defined DD360Audi || defined DD360ComBox
+#elif defined DD360 || defined DD360Audi || defined DD360ComBox || defined DD360UCar || defined DD360Tcci
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        2
     #define CCS_QUANTITY            2
@@ -312,6 +321,8 @@ enum CoreProfile {
      TimeOffsetNextTransition,
      SystemUptimeSec,
      FreeVend,
+     OcppServer,
+     MaintainServer,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -450,7 +461,10 @@ typedef union
         unsigned int AlarmStop:1;                   // 0: no effect,    1: alarm stop
         unsigned int BackendStop:1;                 // 0: no effect,    1: backend stop
         unsigned int ManualStop:1;                  // 0: no effect,    1: manual stop
-        unsigned int res:28;
+        unsigned int HardResetStop:1;               // 0: no effect,    1: hard reset stop
+        unsigned int SoftResetStop:1;               // 0: no effect,    1: soft reset stop
+        unsigned int InvalidIdStop:1;               // 0: no effect,    1: invalid stop when StopTransactionOnInvalidId is true
+        unsigned int res:25;
     }bits;
 }ChargingStop;
 
@@ -551,9 +565,11 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           OcppReceiptrURL[512];               // Charging receipt display URL
+    unsigned char           isAuthrizeByEVCCID;                 // is Authorize by EVCCID (CCS)
+    unsigned char           MaintainServerURL[512];             // ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
 };
 
 struct ChargingInfoData
@@ -580,6 +596,7 @@ struct ChargingInfoData
 	float PresentChargingCurrent;   // unit: 1A
 	float PresentChargingPower;		//0~6553.5 kW
 	float PresentChargedEnergy;		//0~6553.5 kWh
+	float presentChargedEnergyPeriod[24];       // Session present charged energy at each period
 	int PresentChargedDuration;	// second
 	int RemainChargingDuration;	// second
 	float EvBatteryMaxVoltage;		// 0~6553.5 volt
@@ -654,8 +671,23 @@ struct ChargingInfoData
     unsigned char       PantographFlag;                 // 0: normal gun type,  1: pantograph gun type
     unsigned char       Replug_flag;
     unsigned char       isEVCCIDVerify;
+    unsigned char       CCSGunType;
+    struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
+typedef struct
+{
+    unsigned char       AuthId[32];
+                                                        // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
+    unsigned char       AuthStatus;                     // 3: Authorize done, 4: Authorize end
+    unsigned char       AuthTarget;                     // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
+    unsigned char       AuthType;                       // 0: _AuthType_None,   1: _AuthType_RFID, 2: _AuthType_RemoteStart
+    unsigned char       AuthResult;                     // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    unsigned char       AuthRequest;                    // 0: no request, 1: authorize request
+    unsigned char       res;
+}AuthorizingInfoData;
+
 typedef union
 {
     unsigned int SettingValue;
@@ -666,7 +698,6 @@ typedef union
         unsigned int DispenserConfigSync:1;             // 0: not synced,   1: synced
         unsigned int MiscNeedAnnouncement:1;            // 0: no need,      1: need send misc command
         unsigned int NeedDispenserVerInfo:1;            // 0: no need,      1: need dispenser to report it's version info
-        unsigned int EnableAutoGunSelection:1;          // 0: disable,      1: enable auto gun selection
         unsigned int AuthorizeRequest:1;                // 0: idle,         1: requesting                           ( dispenser -> cabinet)
         unsigned int ConnectorTimeoutConfigRequest:1;   // 0: no request,   1: connector timeout setting            (    ocpp   -> cabinet -> dispenser)
         unsigned int DefaultPriceConfigRequest:1;       // 0: no request,   1: default price setting                (    ocpp   -> cabinet -> dispenser)
@@ -686,6 +717,7 @@ typedef union
         unsigned int StopButtonStatusRequest:1;         // 0: no request,   1: stop charging button status has changed          ( cabinet -> dispenser)
         unsigned int AuthModeConfigRequest:1;           // 0: no request,   1: AuthMode Config has changed                      ( cabinet -> dispenser)
         unsigned int EVCCIDConfigRequest:1;             // 0: no request,   1: EVCCID Config has changed                        ( cabinet -> dispenser)
+        unsigned int LEDIntensityRequest:1;             // 0: no request,   1: LED Intensity has changed                        ( cabinet -> dispenser)
         unsigned int res:7;
     }bits;
 }DispenserSettingFlag;
@@ -723,11 +755,7 @@ struct DispenserModule
     unsigned char   Connector2FwRev[32];        //Connector2 module firmware version
     struct   LED    LedInfo;                    // LED configuration info
 
-                                                // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
-    unsigned char           AuthStatus;         // 3: Authorize done, 4: Authorize end
-    unsigned char           AuthTarget;         // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
-    unsigned char           AuthType;           // 0: _AuthType_None, 1: _AuthType_RFID, 2: _AuthType_RemoteStart
-    unsigned char           AuthResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData     AuthInfo;
     DispenserSettingFlag    Setting;
     char                    FwFileName[128];
     unsigned char           ConnectionChannel;
@@ -808,7 +836,8 @@ typedef union
         unsigned int  FaultStatusRequest:1;
         unsigned int  Disconnection:1;
         unsigned int  GfdDetection:1;                   // 0: stop,         1: start
-        unsigned int  res:9;
+        unsigned int  GetStartChargingSoc:1;            // 0: no effect,    1: get start soc
+        unsigned int  res:8;
     }bits;
 }ConnectorParameter;
 
@@ -820,8 +849,7 @@ struct ConnectorInfoData
     unsigned char ParentDispensetIndex;                 // Parent Dispenser Index: 0 ~ 3
     ConnectorParameter       Parameter;
 
-    unsigned char            AuthorizingType;
-    unsigned char            AuthorizingResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData      AuthInfo;
     struct ChargingInfoData  GeneralChargingData;
     struct WARNING_CODE_INFO WarningInfo;
 
@@ -840,8 +868,11 @@ struct ConnectorInfoData
 
     unsigned short          MaxTotalChargingCurrent;        // max total output current, unit: 0.1A
     unsigned short          MaxTotalChargingPower;          // max total output power, unit: 0.1kw
-    unsigned short          MaxOutputEnergy;                //0: no limit,  1 ~ 65535   kWh
-    unsigned short          MaxOutputDuration;              //0: no limit,  1 ~ 65535   minutes
+    unsigned short          MaxOutputEnergy;                // 0: no limit,  1 ~ 65535   kWh
+    unsigned short          MaxOutputDuration;              // 0: no limit,  1 ~ 65535   minutes
+    float                   CapabilityVoltage;              // unit 0.1V
+    float                   CapabilityCurrent;              // unit 0.1A
+    float                   CapabilityPower;                // unit 0.1kW
 
     unsigned int            UserPrice;                      // connector user's user price, unit: 0.01 (dollar / kWh)
     unsigned int            TotalCost;                      // connector user's total cost, unit: 0.01 dollar
@@ -853,14 +884,11 @@ typedef union
     unsigned int SettingValue;
     struct
     {
-        unsigned int StartAuthorize:1;          // 0: idle,    1: authorizing
-        unsigned int AuthorizingCompleted:1;    // 0: not yet, 1: authorizing completed
         unsigned int DispenserDisconnection:1;  // 0: no connection,  1: dispenser connected
-        unsigned int BackendAuthorized:1;       // 0: local authorized, 1: backend authorized
         unsigned int FlashConfigChanged:1;      // 0: no effect, 1: flash config has changed
         unsigned int EnableWriteFlash:1;        // 0: no effect, 1: enable to write flash after timeout
         unsigned int CleanWiringInfo:1;         // 0: no effect, 1: clean wiring info
-        unsigned int res:25;
+        unsigned int res:28;
     }bits;
 }CabinetSettingFlag;
 
@@ -943,7 +971,7 @@ struct SysInfoData
 	unsigned char 		InternetConn;					//0: disconnected, 1: connected
 	/**************Backend***************/
 	unsigned char 		OcppConnStatus;					//0: disconnected, 1: connected
-	unsigned char 		MaintainServerConnStatus;		//0: disconnected, 1: connected
+    unsigned char       MaintainServerConnStatus;       //0: disconnected, 1: connected
 	char 				OrderCharging;
     float               MaxChargingProfilePower;        // unit: 1W
 	/**************Alston***************/
@@ -986,7 +1014,7 @@ struct SysInfoData
     CabinetMiscCommand      CabinetMicsStatus;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     DC_Meter_Info DcMeterInfo[4];
-    unsigned char           OTPTemp;                    // OTP Temperature 
+    unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
 };
 
@@ -1112,8 +1140,8 @@ char FaultStatusCode[40][6]=
 	"011036",	//Rotary switch fault
 	"011037",	//CCS liquid chiller water level fault
 	"011038",	//Chiller temperature sensor broken
-	"011039",	//Reserved
-	"011040"	//Reserved
+	"011039",	//Parallel relay welding
+	"011040"	//Parallel output relay driving fault
 };
 */
 
@@ -1168,7 +1196,8 @@ struct FaultCodeData
 			unsigned char RotarySwitchFault:1;					//bit 3 
 			unsigned char CcsLiquidChillerWaterLevelFault:1;    //bit 4
             unsigned char ChillerTempSensorBroken:1;            //bit 5
-            unsigned char :2;                                   //bit 6 ~ 7 reserved
+            unsigned char ParallelRelayWelding:1;               //bit 6
+            unsigned char ParallelRelayDriving:1;               //bit 7
 		}bits;
 	}FaultEvents;
 };
@@ -1303,8 +1332,8 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // reserved
-    "012328",   // reserved
+    "012327",   // DC input ovp
+    "012328",   // DC input uvp
     "012329",   // reserved
     "012330",   // reserved
     "012331",   // reserved
@@ -1489,9 +1518,10 @@ struct AlarmCodeData
             unsigned char AbnormalVoltageOnOutputLine_1:1;          //bit 4
             unsigned char AbnormalVoltageOnOutputLine_2:1;          //bit 5
             unsigned char SystemTaskLost:1;                         //bit 6
-            unsigned char Reserved:1;                               //bit 7
+            unsigned char DcInputOVP:1;                             //bit 7
             //AlarmVal[16]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char DcInputUVP:1;                             //bit 0
+            unsigned char :7;                                       //reserved bit 1 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -4264,7 +4294,7 @@ struct StructDataTransfer
 	unsigned char MessageId[52];
 	unsigned char Data[512];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];
+	unsigned char ResponseData[512];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4383,7 +4413,7 @@ struct OCPP16ConfigurationItem
 {
 	unsigned char 		ItemName[64];
 	unsigned char 		ItemAccessibility;//0:RO, 1:RW
-	unsigned char 		ItemData[500];
+	unsigned char 		ItemData[501];//value should be limited in 500 bytes
 };
 
 struct OCPP16ConfigurationTable
@@ -4563,9 +4593,9 @@ struct StructSignedFirmwareStatusNotification
 
 struct StructSessionTarget
 {
-	unsigned char		targetSoc;			// Unit: %,   		0 is unlimit
-	unsigned short		targetEnergy;		// Unit: KWH		0 is unlimit
-	unsigned short		targetDuration;		// Unit: Minutes	0 is unlimit
+    unsigned char       targetSoc;          // Unit: %,         0 is unlimit
+    unsigned short      targetEnergy;       // Unit: KWH        0 is unlimit
+    unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
 struct OCPP16Data
@@ -4756,7 +4786,7 @@ struct OCPP16Data
     struct StructSecurityEventNotification          SecurityEventNotification;
     struct StructSignCertificate                    SignCertificate;
     struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget	                    SessionTarget[CONNECTOR_QUANTITY];
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
 };
 
 

+ 9 - 3
EVSE/Projects/DD360Audi/Apps/ModuleChkSysTask/Module_ChkSysTask.c

@@ -24,6 +24,7 @@ struct ChargingInfoData *pAcChargingInfo = NULL;
 static struct ChargingInfoData *pDcChargingInfo = NULL;
 struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 struct StatusCodeData           *ShmStatusCodeData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -226,13 +227,14 @@ void main(void)
         log_error("create share memory error");
         return ;
     }
-
+    MappingGunChargingInfo("CheckSystem Task");
     pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
     pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSysConfigAndInfo = (struct SysConfigAndInfo *)GetShmSysConfigAndInfo();
-    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();	
-    MappingGunChargingInfo("CheckSystem Task");
+    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
+
     while(true)
     {
       	for (uint8_t gun = 0; gun < pSysConfig->TotalConnectorCount; gun++) {
@@ -240,6 +242,10 @@ void main(void)
 			if (pDcChargingInfo->SystemStatus == SYS_MODE_UPDATE )
 				continue;
 		}
+        if (ShmDcCommonData->debugflag == YES) {
+            sleep(3);
+            continue;
+        }
 		CheckSystemTaskAlive();
 		sleep(3);
     }

+ 13 - 4
EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.c

@@ -854,6 +854,7 @@ static void addFaultCodeToBuf(uint8_t *Code)
                Code,
                strlen((char *)Code));
         pSysWarning->WarningCount++;
+        log_info("Warning Code:%s",Code);
     }
 }
 
@@ -912,7 +913,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     //uint8_t statusCodeError = 0;
 
     if (dataLen > 0) {
-        Hexdump((uint8_t *)data, dataLen);
+        //Hexdump((uint8_t *)data, dataLen);
 
         remaindLen = dataLen % WARNING_CODE_SIZE;
 
@@ -923,7 +924,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
 
         if (dataLen < WARNING_CODE_SIZE) {
             log_error("fail status code length = %d", dataLen);
-            Hexdump(data, dataLen);
+            //Hexdump(data, dataLen);
             if (pSysWarning->WarningCount > 0) {
                 for (i = 0; i < pSysWarning->WarningCount; i++) {
                     usleep(128);
@@ -993,7 +994,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     } else {
         if (CompareArrayIsZero(data, WARNING_CODE_SIZE) == false) {
             log_error("power cabinet status code data length is zero, but have data");
-            Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
+            //Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
         }
     }
 
@@ -1417,6 +1418,7 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
 
     pConnState->ConnectorTemp = pDcChargingInfo->ConnectorTemp;
     pConnState->ChillerTemp = pDcChargingInfo->ChillerTemp;
+    pConnState->PlugIn = pDcChargingInfo->ConnectorPlugIn;
 
     if (pDcChargingInfo->SystemStatus <= S_AUTHORIZING) {
         pConnState->State = CONN_ST_IDLE;    //idle
@@ -1431,7 +1433,8 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
         pConnState->State = CONN_ST_PREPARING;    //preparing
     } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
         pConnState->State = CONN_ST_CHARGING;    //charging
-    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING) {
+    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING ||
+            pDcChargingInfo->SystemStatus == S_COMPLETE) {
         pConnState->State = CONN_ST_TERMINATING;    //terminating
     } else if ((pDcChargingInfo->SystemStatus == S_ALARM) ||
                (pDcChargingInfo->SystemStatus == S_FAULT)) {
@@ -1445,9 +1448,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                     (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                     WARNING_CODE_SIZE);
             vendorErrorCodeTmp[plugNum][6] = '\0';
+            /*
             log_info("1 ID = %d, VendorErrorCode = %s",
                      plugNum,
                      (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                     */
         } else {
             if (strncmp(&vendorErrorCodeTmp[plugNum][0],
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
@@ -1457,9 +1462,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                         WARNING_CODE_SIZE);
                 vendorErrorCodeTmp[plugNum][6] = '\0';
+                /*
                 log_info("2 ID = %d, VendorErrorCode = %s",
                          plugNum,
                          (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                         */
             }
         }
     }
@@ -2053,7 +2060,9 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_PREPARING_FOR_EVSE: //insaulation test
     case S_CCS_PRECHARGE_ST0:
     case S_CCS_PRECHARGE_ST1:
+
         writeChargingTarget(fd, plugNum, gunID);
+
 		if (pDcChargingInfo->PantographFlag)
 			writeGroundFaultDetection(fd, 1, gunID);
 

+ 2 - 1
EVSE/Projects/DD360Audi/Apps/ModuleDoComm/DoComm.h

@@ -130,7 +130,8 @@ typedef struct StConnectorState {
     uint8_t WarningCode[6];
     uint8_t ConnectorTemp;
     uint8_t ChillerTemp;
-    uint8_t Reserved[3];
+    uint8_t PlugIn;
+    uint8_t Reserved[2];
 } ConnectorState;
 
 typedef struct StConnectorIDTable {

+ 2 - 1
EVSE/Projects/DD360Audi/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -417,7 +417,8 @@ void CANReceiver(int fd)
                         (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
                          pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1)
                    ) {
-                    if (pDcChargingInfo->EvBatteryStartSoc <= 0) {
+                    if (pDcChargingInfo->EvBatteryStartSoc <= 0 &&
+                            pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE) {
                         pDcChargingInfo->EvBatteryStartSoc = frame.data[1];
                     }
 

+ 0 - 3
EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/FanBoard.c

@@ -76,9 +76,6 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
-        return;
-    }
 
     // 風控修改 :
     // ******************************************************* //

+ 1 - 2
EVSE/Projects/DD360Audi/Apps/ModuleInternalComm/RelayBoard.c

@@ -1200,7 +1200,6 @@ static void SetFanModuleSpeed(void)
             _setFanSpeed = ShmFanModuleData->SetFan1Speed;
         }
 
-        //printf("_setFanSpeed = %d \n", _setFanSpeed);
         _fanSpeed.speed[0] = _setFanSpeed;
 
         _fanSpeed.speed[1] = _setFanSpeed;
@@ -1237,7 +1236,7 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
+    if (ShmDcCommonData->debugflag== YES) {
         return;
     }
 

+ 102 - 7
EVSE/Projects/DD360Audi/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -16,7 +16,7 @@
 #include "../Define/define.h"
 #include "../Config.h"
 #include "../SelectGun/SelectGun.h"
-
+#include "../CSU/main.h"
 //------------------------------------------------------------------------------
 //struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 //struct StatusCodeData           *ShmStatusCodeData;
@@ -31,7 +31,7 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
 static struct ChargingInfoData *pAcChargingInfo = NULL;
 
 bool needReloadQr = true;
-
+bool _saftydetect = false;
 bool _isShow = false; //DS60-120 add
 uint8_t _showInformIndex = 0; //DS60-120 add
 
@@ -215,7 +215,7 @@ uint8_t _logo_cmp               = 62;
 uint8_t _battery_eng_trp_map    = 63;
 uint8_t _money_trp_map          = 64;
 uint8_t _elapse_time_trp_map    = 65;
-
+#if defined DD360Audi
 ////For Audi
 uint8_t _left_gun_disable_map   = 66;
 uint8_t _left_gun_enable_map    = 67;
@@ -240,7 +240,18 @@ uint8_t _showselectgun_right    = 78;
 short __show_waitgunplug_value    = 0x0468;
 uint8_t _showwaitgunplug_left     = 80;
 uint8_t _showwaitgunplug_right    = 81;
-
+#else
+short __show_handshark_value    = 0x0464;
+short __show_GFD_value          = 0x0466;
+short __show_precharge_value    = 0x0468;
+
+uint8_t _show_handshark_dark    = 67;
+uint8_t _show_handshark_light   = 68;
+uint8_t _show_GFD_dark          = 69;
+uint8_t _show_GFD_light         = 70;
+uint8_t _show_precharge_dark    = 71;
+uint8_t _show_precharge_light   = 72;
+#endif
 //#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -562,6 +573,7 @@ void ChangeWarningFunc()
     //log_info("WarningCount = %d ", pSysWarning->WarningCount);
 //#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
     for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
         memset(cmd, 0x00, sizeof(cmd));
         if ((i) >= 5) {
             break;
@@ -880,7 +892,7 @@ void GetTimespecFunc(struct timespec *time)
 {
     clock_gettime(CLOCK_MONOTONIC_COARSE, time);
 }
-
+#if defined DD360Audi
 void RunReplugStringFunction(bool isRun)
 {
     if (isRun) {
@@ -918,7 +930,7 @@ void RunFullTargetFunction(bool isRun)
         ChangeDisplay2Value(__show_StatusString_value_2, _disappear);
     }
 }
-
+#endif
 /**
  * [ChangeBalanceValue :print balance information]
  * @Author
@@ -1739,6 +1751,40 @@ void InformationShow()
     }
 }
 
+void showPhihongLogo(bool _show)
+{
+    /*
+    if( pSysConfig->ModelName[3] == 'U' ) {
+        if (pSysConfig->ModelName[12] == 'P' && pSysConfig->ModelName[13] == 'H') {
+            ChangeDisplay2Value(_logo, _disappear);
+            ChangeDisplay2Value(_logo_cmp, _disappear);
+        }
+    }
+    */
+    if (!_show) {
+        ChangeDisplay2Value(_logo, _disappear);
+        ChangeDisplay2Value(_logo_cmp, _disappear);
+    }
+}
+unsigned long GetPreChargeTimeoutValue(struct timeval _sour_time)
+{
+    struct timeval _end_time;
+    gettimeofday(&_end_time, NULL);
+
+    return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
+}
+
+void ChangeTimeValue(uint8_t time)
+{
+    uint8_t cmd[2];
+    uint8_t value[2];
+
+    memset(cmd, 0x00, sizeof(cmd));
+    sprintf((char *) value, "%d", time);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
+}
+
 void ProcessPageInfo()
 {
     _page_reload = IsPageReloadChk();
@@ -1756,7 +1802,7 @@ void ProcessPageInfo()
             ChangeDisplay2Value(__sel_gun_btn, _disappear);
         }
     }
-
+    showPhihongLogo(false);
     switch (_currentPage) {
 #if defined DD360Audi
     case _LCM_SELECT_GUN: ////For Audi
@@ -1772,6 +1818,7 @@ void ProcessPageInfo()
 #endif //defined DD360Audi
 
     case _LCM_IDLE: {
+
         if (pSysConfig->isRFID) {
             ChangeDisplay2Value(__main_rfid, _main_rfid);
         } else {
@@ -2040,6 +2087,54 @@ void ProcessPageInfo()
             if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {
                     ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
+                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
+                    if (precharg_time > PRECHARGING_TTIMEOUT)
+                        precharg_time = PRECHARGING_TTIMEOUT;
+                    ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
+
+                    if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
+                            pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
+                        pDcChargingInfo->_SaftyDetect = false;
+                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
+                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+
+                    } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
+                        if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
+                            if (pDcChargingInfo->_SaftyDetect == false ) {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                                if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                    pDcChargingInfo->_SaftyDetect = true;
+                            } else {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                            }
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        }
+                    } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
+                            pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
+                        if (pDcChargingInfo->_SaftyDetect == false ) {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                            if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                pDcChargingInfo->_SaftyDetect = true;
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        }
+                    } else {
+                        ChangeDisplay2Value(__show_handshark_value, _disappear);
+                        ChangeDisplay2Value(__show_GFD_value, _disappear);
+                        ChangeDisplay2Value(__show_precharge_value, _disappear);
+                    }
                 }
             } else if (_currentPage == _LCM_CHARGING && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {

+ 11 - 5
EVSE/Projects/DD360Audi/Apps/ModulePrimary/Module_PrimaryComm.c

@@ -44,6 +44,7 @@ static struct SysInfoData *pSysInfo = NULL;
 static struct AlarmCodeData *pAlarmCode = NULL;
 static struct FaultCodeData *pFaultCode = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 const char *priPortName = "/dev/ttyS1";
 uint8_t gun_count; //DS60-120 add
@@ -419,6 +420,9 @@ static void checkChillerStatus(Gpio_out *gpio)
         }
     }
 
+    if (ShmDcCommonData->debugflag == YES)
+        _chillerNeedOn = ShmDcCommonData->chillerCtrl;
+
     if(_chiller.ChillerSwitch != _chillerNeedOn)
     {
         log_info("Chiller Need Turn %s", _chillerNeedOn == YES ? "ON" : "OFF");
@@ -639,6 +643,7 @@ int main(void)
     pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
     pFaultCode = (struct FaultCodeData *)GetShmFaultCodeData();
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     Uart1Fd = InitComPort();
     //log_info("407 Port id = %d ", Uart1Fd);
@@ -664,6 +669,11 @@ int main(void)
     for (;;) {
         // 程序開始之前~ 必須先確定 FW 版本與硬體版本,確認後!!~ 該模組才算是真正的 Initial Comp.
         // 模組更新 FW 後,需重新做
+        if(IsPrimaryProcessNeedPause() == true)
+        {
+            sleep(1);
+            continue;
+        }
         if (ShmPrimaryMcuData->SelfTest_Comp != PASS) {
             //log_info("(407) Get Fw and Hw Ver. ");
             GetFwAndHwVersion(Uart1Fd);
@@ -674,11 +684,7 @@ int main(void)
 
             GetInputGpioStatus(Uart1Fd);
         }
-        if(IsPrimaryProcessNeedPause() == true)
-        {
-            sleep(1);
-            continue;
-        }
+
 
         usleep(50000);
     }

BIN
EVSE/Projects/DD360Audi/Apps/Module_ChkSysTask


BIN
EVSE/Projects/DD360Audi/Apps/Module_DoComm


BIN
EVSE/Projects/DD360Audi/Apps/Module_EvComm


BIN
EVSE/Projects/DD360Audi/Apps/Module_EventLogging


BIN
EVSE/Projects/DD360Audi/Apps/Module_InternalComm


BIN
EVSE/Projects/DD360Audi/Apps/Module_UpdateFW


+ 30 - 5
EVSE/Projects/DD360Audi/Apps/ReadCmdline.c

@@ -517,8 +517,12 @@ void GetGunSelectedNum(char *v1)
 void SetFanSpeed(char *v1)
 {
     int speed = atoi(v1);
-
-    ShmFanModuleData->TestFanSpeed = speed;
+    if(ShmDcCommonData->debugflag == YES) {
+        ShmFanModuleData->TestFanSpeed = speed;
+        printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
+    }
+    else
+        printf("Please open debug mode\n");
 }
 
 void GetFanSpeed()
@@ -533,7 +537,8 @@ void SetDebugMode(char *v1)
 {
     int mode = atoi(v1);
 
-    pSysConfig->SwitchDebugFlag = mode;
+    ShmDcCommonData->debugflag = mode;
+    printf("Set Debug Mode:%d\n" , ShmDcCommonData->debugflag);
 }
 
 void SetGFDMode(char *v1)
@@ -717,7 +722,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         printf ("Input Voltage over range\n");
         return;
     }
-
     //kill ev task
     system("killall Module_EvComm");
 
@@ -771,6 +775,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
             //清除 main timeout 機制
             pDcChargingInfo->TimeoutFlag = 0;
+            pSysInfo->SystemTimeoutFlag = 0;
+            pSysInfo->SystemPage = _LCM_NONE;
             //不論是什麼 type 的槍都固意設成 Chademo 不跑 Prechage step
             pDcChargingInfo->Type = 9;
             break;
@@ -941,6 +947,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
             pDcChargingInfo->PresentChargingPower = 0;
 
             if (stopChg == pSysConfig->TotalConnectorCount) {
+
                 system("/root/Module_EvComm &");
                 sleep(3);
 
@@ -1187,7 +1194,17 @@ static void writeOTPTemp(void)
         usleep(sleepTime);
     }//while
 }
-
+void writeChillerStatus(char *v1)
+{
+    if (ShmDcCommonData->debugflag == YES) {
+        ShmDcCommonData->chillerCtrl = atoi(newString[1]);
+        if (ShmDcCommonData->chillerCtrl)
+            printf("Chiller set on\n");
+        else
+            printf("Chiller set off\n");
+    } else
+        printf("Please open Debug mode\n");
+}
 static void writeGunAndChillerTemp(void)
 {
     uint8_t _GunIndex = 0;
@@ -1288,6 +1305,7 @@ int main(void)
                      "       tempW                             : write connector header and Chiller temperature\r\n"
                      "       tempR                             : print connector header and chiller temperature\r\n"
                      "       OTP                               : Write OTP temperature\r\n"
+                     "       chiller                           : set chiller on/off"
                      "\r\n";
 
     if (CreateAllCsuShareMemory() == FAIL) {
@@ -1323,6 +1341,7 @@ int main(void)
 //    }
 
     while (isContinue) {
+
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
         }
@@ -1437,6 +1456,10 @@ int main(void)
             }
             SetChargingInfoCCID(newString[1], newString[2]);
         } else if (strcmp(newString[0], "strchg") == 0) {
+            if (ShmDcCommonData->debugflag == NO ) {
+                printf("Please Open debug mode\n");
+                continue;
+            }
             //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
             if (strcmp(newString[1], "auto") == 0) {
                 newString[2][0] = 0;
@@ -1457,6 +1480,8 @@ int main(void)
             resdGunAndChillerTemp();
         } else if (strcmp(newString[0], "OTP") == 0) { //測試槍頭和水冷機溫度
             writeOTPTemp();
+        } else if (strcmp(newString[0], "chiller") == 0) { //測試槍頭和水冷機溫度
+            writeChillerStatus(newString[1]);
         } else {
             printf("%s\n", usageMsg);
         }

+ 2 - 0
EVSE/Projects/DD360Audi/Apps/Script/copy_from_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+sudo cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

+ 2 - 0
EVSE/Projects/DD360Audi/Apps/Script/copy_to_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/* /mnt/d/Phihong/Project/DD360Audi/Apps/

BIN
EVSE/Projects/DD360Audi/Apps/main


BIN
EVSE/Projects/DD360ComBox/Apps/CSU/.main.c.swp


+ 22 - 9
EVSE/Projects/DD360ComBox/Apps/CSU/Primary.c

@@ -339,6 +339,14 @@ void ChkPrimaryStatus(void)
                 ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = YES;
                 EmcOccureByString("042252");
                 Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042327", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = YES;
+                EmcOccureByString("042327");
+                Rtn = 1;
+            } else if (memcmp(&pSysWarning->WarningCode[i][0], "042328", 6) == 0) {
+                ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = YES;
+                EmcOccureByString("042328");
+                Rtn = 1;
             } else if (memcmp(&pSysWarning->WarningCode[i][0], "042200", 6) == 0) {
                 ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = YES;
                 EmcOccureByString("042200");
@@ -364,12 +372,16 @@ void ChkPrimaryStatus(void)
         if (Rtn == 0) {
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
             ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
             ReleaseEmsOccureByString(0, "042251");
             ReleaseEmsOccureByString(0, "042252");
+            ReleaseEmsOccureByString(0, "042327");
+            ReleaseEmsOccureByString(0, "042328");
             ReleaseEmsOccureByString(0, "042200");
             ReleaseEmsOccureByString(0, "042201");
             ReleaseEmsOccureByString(0, "042202");
@@ -379,12 +391,16 @@ void ChkPrimaryStatus(void)
     } else {
         ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP = NO;
+        ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP = NO;
         ShmDcCommonData->PowerAlarmState.StatusBit.PsuFailure = NO;
         ReleaseEmsOccureByString(0, "042251");
         ReleaseEmsOccureByString(0, "042252");
+        ReleaseEmsOccureByString(0, "042327");
+        ReleaseEmsOccureByString(0, "042328");
         ReleaseEmsOccureByString(0, "042200");
         ReleaseEmsOccureByString(0, "042201");
         ReleaseEmsOccureByString(0, "042202");
@@ -428,13 +444,10 @@ void ChkPrimaryStatus(void)
     //}
 
     if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_PRESS &&
-            !leftBtnPush
-#if defined DD360Audi
-            &&
+            !leftBtnPush &&
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL
-#endif //defined DD360Audi
        ) {
         pDcChargingInfo = (struct ChargingInfoData *)GetDcChargingInfoData(pSysInfo->CurGunSelected);
 
@@ -538,15 +551,14 @@ void ChkPrimaryStatus(void)
     }
 
     if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_PRESS &&
-            !rightBtnPush
+            !rightBtnPush &&
 #if defined DD360Audi
-            &&
             pSysInfo->SystemPage != _LCM_IDLE &&
+#endif
             pSysInfo->SystemPage != _LCM_AUTHORIZING &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_COMP &&
             pSysInfo->SystemPage != _LCM_AUTHORIZ_FAIL &&
             pSysInfo->SystemPage != _LCM_WAIT_FOR_PLUG
-#endif //defined DD360Audi
        ) {
         if (!rightBtnPush) {
             rightBtnPush = true;
@@ -576,9 +588,10 @@ void ChkPrimaryStatus(void)
                 pSysInfo->CurGunSelected = 0;
                 ChangeGunSelectByIndex(pSysInfo->CurGunSelected);
             }
+            log_info("current select gun ............................... %d ",
+                     pSysInfo->CurGunSelected);
         }
-        log_info("current select gun ............................... %d ",
-                 pSysInfo->CurGunSelected);
+
     } else if (ShmPrimaryMcuData->InputDet.bits.Button2 == BTN_RELEASE) {
         if (rightBtnPush) {
             rightBtnPush = false;

+ 16 - 8
EVSE/Projects/DD360ComBox/Apps/CSU/main.c

@@ -82,8 +82,8 @@ uint8_t bd0_2_status = 0;
 uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
-char *fwVersion = "V1.18.00.0000.00"; // "V0.16.00.0000.00";
-char* DebugVersion = "v1.18.0";
+char *fwVersion = "V1.19.00.0000.00"; // "V0.16.00.0000.00";
+char* DebugVersion = "v1.19.4";
 //sqlite3 *localDb;
 bool isDb_ready;
 
@@ -1644,9 +1644,6 @@ void _DetectPlugInTimeout(void)
 	setChargerMode(pSysInfo->CurGunSelected, S_TERMINATING);
 #elif DD360 || DD360Combox
  	setChargerMode(pSysInfo->CurGunSelected, S_COMPLETE);
-    systemPageRestoreInit();
-   
-	return;
 #endif
     systemPageRestoreInit();
 }
@@ -3849,6 +3846,8 @@ static void ReviewCriticalAlarm(void)
             //Power cabinet alarm status
             ShmDcCommonData->PowerAlarmState.StatusBit.EmergencyStop == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.DoorOpen == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputOVP == YES ||
+            ShmDcCommonData->PowerAlarmState.StatusBit.DcInputUVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL1InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL2InputOVP == YES ||
             ShmDcCommonData->PowerAlarmState.StatusBit.SystemL3InputOVP == YES ||
@@ -4362,7 +4361,14 @@ int main(void)
     log_info(" ********************************************************");
     log_info(" ******************  FileSystem Boot up *****************");
     log_info(" ********************************************************");
-
+#if defined DD360
+    log_info(" ******************  Project:DD360  *********************");
+#elif defined DD360Audi
+    log_info(" ******************  Project:DD360Audi  *****************");
+#elif defined DD360ComBox
+    log_info(" ******************  Project:DD360ComBox  ***************");
+#endif
+    log_info(" ********************************************************");
     if (!InitialSystemDefaultConfig()) {
         log_error("InitialSystemDefaultConfig NG ");
         //StopProcessingLoop();
@@ -4791,6 +4797,7 @@ int main(void)
                         pSysInfo->OrderCharging = NO_DEFINE;
                     }
                     StopSystemTimeoutDet();
+                    gettimeofday(&pDcChargingInfo->PreChargeTimer, NULL);
                 }
 
                 isRessign = NO;
@@ -5239,8 +5246,9 @@ int main(void)
                         GetTimeoutValue(pDcChargingInfo->TimeoutTimer) >= 10000000) {
                     setChargerMode(gunIndex, MODE_IDLE);
                     destroySelGun(gunIndex); //Jerry add
-#ifdef DD360 || DD3660ComBox
-					pSysInfo->SystemPage = _LCM_IDLE;
+#ifdef defined DD360 || defined DD3660ComBox
+					//pSysInfo->SystemPage = _LCM_IDLE;
+                    connectorPageRestoreIdle();
 #endif
                 }
 

+ 1 - 0
EVSE/Projects/DD360ComBox/Apps/CSU/main.h

@@ -43,6 +43,7 @@
 #define GUN_COMP_WAIT_TIMEOUT                   (10)
 #define GUN_PRECHARGING_TIMEOUT                 (60)
 #define EVCCID_LINK_TIMEOUT                     (120)
+#define PRECHARGING_TTIMEOUT                    (60)
 
 #define WHILE_LOOP_TIME                         (10000)
 

+ 4 - 2
EVSE/Projects/DD360ComBox/Apps/Config.h

@@ -333,11 +333,12 @@ typedef union {
     struct {
         uint8_t EmergencyStop: 1;    //Power cabinet emergency stop
         uint8_t DoorOpen: 1;         //Power cabinet emergency door open
+        uint8_t DcInputOVP: 1;
+        uint8_t DcInputUVP: 1;
         uint8_t SystemL1InputOVP: 1; //Power cabinet system L1 input OVP
         uint8_t SystemL2InputOVP: 1; //Power cabinet System L2 input OVP
         uint8_t SystemL3InputOVP: 1; //Power cabinet System L3 input OVP
         uint8_t PsuFailure: 1;       //Power cabinet PSU Failure Alarm
-        uint8_t Reserved: 2;
     } StatusBit;
 } PowerAlarmState;
 
@@ -378,7 +379,8 @@ typedef struct StDcCommonInfo {
     uint8_t TestTemperature; //ReadCmdline test, manual input value
     uint8_t CcsTypeSaved[2];
     PcPsuOutput PcPsuOutput[2];
-    uint8_t Reserved[3];
+    uint8_t chillerCtrl;
+    uint8_t debugflag;
 } DcCommonInfo;
 
 #endif /* CONFIG_H_ */

+ 17 - 0
EVSE/Projects/DD360ComBox/Apps/DebugLog.md

@@ -0,0 +1,17 @@
+2021/05/25
+1. Add detected chiller temperature and stop charging when it exceeds 90°C.
+2. Fix multi dispenser reboot, DHCP IP address conflict issue.
+3. Fix the GFD test failed and the alarm code was not recorded.
+4. Fix ccs OVP status code not release issue.
+5. Add to complete the registration but did not get the balance to restart DoComm.
+6. Add button stop charging function.
+
+2021/06/10
+1. Add Chiller temperature OTP and chiller sensor broken status code 012323 and 011038.
+
+2021/06/18
+1. ReadCmdLine.c add support double test charging function.
+
+2021/06/23
+1. Debug Module_RateCurrent.c lost gun type issue.
+2. 在充電第二把槍時,槍櫃等待主後送permission後再通知小板進入充電狀態。

+ 7 - 7
EVSE/Projects/DD360ComBox/Apps/Define/define.c

@@ -103,8 +103,8 @@ char FaultStatusCode[40][6]=
 "011036", //Rotary switch fault
 "011037", //CCS liquid chiller water level fault
 "011038", //Chiller temperature sensor broken
-"011039", //Reserved
-"011040" //Reserved
+"011039", //Parallel relay welding
+"011040"  //Parallel output relay driving fault
 };
 
 char AlarmStatusCode[160][6]=
@@ -233,11 +233,11 @@ char AlarmStatusCode[160][6]=
 "012321", // System CCS output UCP
 "012322", // System GBT output UCP
 "012323", // System Chiller output OTP
-"012324", // reserved
-"012325", // reserved
-"012326", // reserved
-"012327", // reserved
-"012328",   // reserved
+"012324", // Connector 1 detects abnormal voltage on the output line
+"012325", // Connector 2 detects abnormal voltage on the output line
+"012326", // System task is lost
+"012327", // DC input ovp
+"012328",   // DC input uvp
 "012329",   // reserved
 "012330",   // reserved
 "012331",   // reserved

+ 65 - 35
EVSE/Projects/DD360ComBox/Apps/Define/define.h

@@ -63,6 +63,15 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY    0
     #define PSU_QUANTITY            0
     #define ONE_CONNECTOR_USE       0
+#elif defined NoodoeAX
+    #define MAX_PSU_QUANTITY        62
+    #define CHAdeMO_QUANTITY        1
+    #define CCS_QUANTITY            1
+    #define GB_QUANTITY             0
+    #define AC_QUANTITY             1
+    #define GENERAL_GUN_QUANTITY    0
+    #define PSU_QUANTITY            0
+    #define ONE_CONNECTOR_USE       0
 #elif defined AX80
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        1
@@ -117,7 +126,7 @@ Storage							0x0A200000-0x7FFFFFFF		1886 MB
     #define GENERAL_GUN_QUANTITY	0
     #define PSU_QUANTITY            2
     #define ONE_CONNECTOR_USE       0
-#elif defined DD360 || defined DD360Audi || defined DD360ComBox
+#elif defined DD360 || defined DD360Audi || defined DD360ComBox || defined DD360UCar || defined DD360Tcci
     #define MAX_PSU_QUANTITY        62
     #define CHAdeMO_QUANTITY        2
     #define CCS_QUANTITY            2
@@ -312,6 +321,8 @@ enum CoreProfile {
      TimeOffsetNextTransition,
      SystemUptimeSec,
      FreeVend,
+     OcppServer,
+     MaintainServer,
      ConfigurationVersion,
 	 _CoreProfile_CNT
 };
@@ -450,7 +461,10 @@ typedef union
         unsigned int AlarmStop:1;                   // 0: no effect,    1: alarm stop
         unsigned int BackendStop:1;                 // 0: no effect,    1: backend stop
         unsigned int ManualStop:1;                  // 0: no effect,    1: manual stop
-        unsigned int res:28;
+        unsigned int HardResetStop:1;               // 0: no effect,    1: hard reset stop
+        unsigned int SoftResetStop:1;               // 0: no effect,    1: soft reset stop
+        unsigned int InvalidIdStop:1;               // 0: no effect,    1: invalid stop when StopTransactionOnInvalidId is true
+        unsigned int res:25;
     }bits;
 }ChargingStop;
 
@@ -551,9 +565,11 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           OcppReceiptrURL[512];               // Charging receipt display URL
+    unsigned char           isAuthrizeByEVCCID;                 // is Authorize by EVCCID (CCS)
+    unsigned char           MaintainServerURL[512];             // ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char           MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char           MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
 };
 
 struct ChargingInfoData
@@ -580,6 +596,7 @@ struct ChargingInfoData
 	float PresentChargingCurrent;   // unit: 1A
 	float PresentChargingPower;		//0~6553.5 kW
 	float PresentChargedEnergy;		//0~6553.5 kWh
+	float presentChargedEnergyPeriod[24];       // Session present charged energy at each period
 	int PresentChargedDuration;	// second
 	int RemainChargingDuration;	// second
 	float EvBatteryMaxVoltage;		// 0~6553.5 volt
@@ -654,8 +671,23 @@ struct ChargingInfoData
     unsigned char       PantographFlag;                 // 0: normal gun type,  1: pantograph gun type
     unsigned char       Replug_flag;
     unsigned char       isEVCCIDVerify;
+    unsigned char       CCSGunType;
+    struct timeval      PreChargeTimer;
+    unsigned char       _SaftyDetect;
 };
 
+typedef struct
+{
+    unsigned char       AuthId[32];
+                                                        // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
+    unsigned char       AuthStatus;                     // 3: Authorize done, 4: Authorize end
+    unsigned char       AuthTarget;                     // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
+    unsigned char       AuthType;                       // 0: _AuthType_None,   1: _AuthType_RFID, 2: _AuthType_RemoteStart
+    unsigned char       AuthResult;                     // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    unsigned char       AuthRequest;                    // 0: no request, 1: authorize request
+    unsigned char       res;
+}AuthorizingInfoData;
+
 typedef union
 {
     unsigned int SettingValue;
@@ -666,7 +698,6 @@ typedef union
         unsigned int DispenserConfigSync:1;             // 0: not synced,   1: synced
         unsigned int MiscNeedAnnouncement:1;            // 0: no need,      1: need send misc command
         unsigned int NeedDispenserVerInfo:1;            // 0: no need,      1: need dispenser to report it's version info
-        unsigned int EnableAutoGunSelection:1;          // 0: disable,      1: enable auto gun selection
         unsigned int AuthorizeRequest:1;                // 0: idle,         1: requesting                           ( dispenser -> cabinet)
         unsigned int ConnectorTimeoutConfigRequest:1;   // 0: no request,   1: connector timeout setting            (    ocpp   -> cabinet -> dispenser)
         unsigned int DefaultPriceConfigRequest:1;       // 0: no request,   1: default price setting                (    ocpp   -> cabinet -> dispenser)
@@ -686,6 +717,7 @@ typedef union
         unsigned int StopButtonStatusRequest:1;         // 0: no request,   1: stop charging button status has changed          ( cabinet -> dispenser)
         unsigned int AuthModeConfigRequest:1;           // 0: no request,   1: AuthMode Config has changed                      ( cabinet -> dispenser)
         unsigned int EVCCIDConfigRequest:1;             // 0: no request,   1: EVCCID Config has changed                        ( cabinet -> dispenser)
+        unsigned int LEDIntensityRequest:1;             // 0: no request,   1: LED Intensity has changed                        ( cabinet -> dispenser)
         unsigned int res:7;
     }bits;
 }DispenserSettingFlag;
@@ -723,11 +755,7 @@ struct DispenserModule
     unsigned char   Connector2FwRev[32];        //Connector2 module firmware version
     struct   LED    LedInfo;                    // LED configuration info
 
-                                                // 0: Authorize idle, 1: Authorize wait,   2: Authorizing
-    unsigned char           AuthStatus;         // 3: Authorize done, 4: Authorize end
-    unsigned char           AuthTarget;         // Authorize Target Connector ID: 1 ~ 4, AutoSelection: 0xFF
-    unsigned char           AuthType;           // 0: _AuthType_None, 1: _AuthType_RFID, 2: _AuthType_RemoteStart
-    unsigned char           AuthResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData     AuthInfo;
     DispenserSettingFlag    Setting;
     char                    FwFileName[128];
     unsigned char           ConnectionChannel;
@@ -808,7 +836,8 @@ typedef union
         unsigned int  FaultStatusRequest:1;
         unsigned int  Disconnection:1;
         unsigned int  GfdDetection:1;                   // 0: stop,         1: start
-        unsigned int  res:9;
+        unsigned int  GetStartChargingSoc:1;            // 0: no effect,    1: get start soc
+        unsigned int  res:8;
     }bits;
 }ConnectorParameter;
 
@@ -820,8 +849,7 @@ struct ConnectorInfoData
     unsigned char ParentDispensetIndex;                 // Parent Dispenser Index: 0 ~ 3
     ConnectorParameter       Parameter;
 
-    unsigned char            AuthorizingType;
-    unsigned char            AuthorizingResult;         // 0: _AuthResult_None, 1: _AuthResult_Valid,   2: _AuthResult_Invalid
+    AuthorizingInfoData      AuthInfo;
     struct ChargingInfoData  GeneralChargingData;
     struct WARNING_CODE_INFO WarningInfo;
 
@@ -840,8 +868,11 @@ struct ConnectorInfoData
 
     unsigned short          MaxTotalChargingCurrent;        // max total output current, unit: 0.1A
     unsigned short          MaxTotalChargingPower;          // max total output power, unit: 0.1kw
-    unsigned short          MaxOutputEnergy;                //0: no limit,  1 ~ 65535   kWh
-    unsigned short          MaxOutputDuration;              //0: no limit,  1 ~ 65535   minutes
+    unsigned short          MaxOutputEnergy;                // 0: no limit,  1 ~ 65535   kWh
+    unsigned short          MaxOutputDuration;              // 0: no limit,  1 ~ 65535   minutes
+    float                   CapabilityVoltage;              // unit 0.1V
+    float                   CapabilityCurrent;              // unit 0.1A
+    float                   CapabilityPower;                // unit 0.1kW
 
     unsigned int            UserPrice;                      // connector user's user price, unit: 0.01 (dollar / kWh)
     unsigned int            TotalCost;                      // connector user's total cost, unit: 0.01 dollar
@@ -853,14 +884,11 @@ typedef union
     unsigned int SettingValue;
     struct
     {
-        unsigned int StartAuthorize:1;          // 0: idle,    1: authorizing
-        unsigned int AuthorizingCompleted:1;    // 0: not yet, 1: authorizing completed
         unsigned int DispenserDisconnection:1;  // 0: no connection,  1: dispenser connected
-        unsigned int BackendAuthorized:1;       // 0: local authorized, 1: backend authorized
         unsigned int FlashConfigChanged:1;      // 0: no effect, 1: flash config has changed
         unsigned int EnableWriteFlash:1;        // 0: no effect, 1: enable to write flash after timeout
         unsigned int CleanWiringInfo:1;         // 0: no effect, 1: clean wiring info
-        unsigned int res:25;
+        unsigned int res:28;
     }bits;
 }CabinetSettingFlag;
 
@@ -943,7 +971,7 @@ struct SysInfoData
 	unsigned char 		InternetConn;					//0: disconnected, 1: connected
 	/**************Backend***************/
 	unsigned char 		OcppConnStatus;					//0: disconnected, 1: connected
-	unsigned char 		MaintainServerConnStatus;		//0: disconnected, 1: connected
+    unsigned char       MaintainServerConnStatus;       //0: disconnected, 1: connected
 	char 				OrderCharging;
     float               MaxChargingProfilePower;        // unit: 1W
 	/**************Alston***************/
@@ -986,7 +1014,7 @@ struct SysInfoData
     CabinetMiscCommand      CabinetMicsStatus;
     struct LocalSharingInfo localSharingInfo;           // Local power sharing info structure
     DC_Meter_Info DcMeterInfo[4];
-    unsigned char           OTPTemp;                    // OTP Temperature 
+    unsigned char           OTPTemp;                    // OTP Temperature
     unsigned char           OTPTempR;                   // OTP Recovery Temperature
 };
 
@@ -1112,8 +1140,8 @@ char FaultStatusCode[40][6]=
 	"011036",	//Rotary switch fault
 	"011037",	//CCS liquid chiller water level fault
 	"011038",	//Chiller temperature sensor broken
-	"011039",	//Reserved
-	"011040"	//Reserved
+	"011039",	//Parallel relay welding
+	"011040"	//Parallel output relay driving fault
 };
 */
 
@@ -1168,7 +1196,8 @@ struct FaultCodeData
 			unsigned char RotarySwitchFault:1;					//bit 3 
 			unsigned char CcsLiquidChillerWaterLevelFault:1;    //bit 4
             unsigned char ChillerTempSensorBroken:1;            //bit 5
-            unsigned char :2;                                   //bit 6 ~ 7 reserved
+            unsigned char ParallelRelayWelding:1;               //bit 6
+            unsigned char ParallelRelayDriving:1;               //bit 7
 		}bits;
 	}FaultEvents;
 };
@@ -1303,8 +1332,8 @@ char AlarmStatusCode[160][6]=
     "012324",   // Connector 1 detects abnormal voltage on the output line
     "012325",   // Connector 2 detects abnormal voltage on the output line
     "012326",   // System task is lost
-    "012327",   // reserved
-    "012328",   // reserved
+    "012327",   // DC input ovp
+    "012328",   // DC input uvp
     "012329",   // reserved
     "012330",   // reserved
     "012331",   // reserved
@@ -1489,9 +1518,10 @@ struct AlarmCodeData
             unsigned char AbnormalVoltageOnOutputLine_1:1;          //bit 4
             unsigned char AbnormalVoltageOnOutputLine_2:1;          //bit 5
             unsigned char SystemTaskLost:1;                         //bit 6
-            unsigned char Reserved:1;                               //bit 7
+            unsigned char DcInputOVP:1;                             //bit 7
             //AlarmVal[16]
-            unsigned char :8;                                       //reserved bit 0 ~ bit 7
+            unsigned char DcInputUVP:1;                             //bit 0
+            unsigned char :7;                                       //reserved bit 1 ~ bit 7
             //AlarmVal[17]
             unsigned char :8;                                       //reserved bit 0 ~ bit 7
             //AlarmVal[18]
@@ -4264,7 +4294,7 @@ struct StructDataTransfer
 	unsigned char MessageId[52];
 	unsigned char Data[512];
 	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];
+	unsigned char ResponseData[512];
 };
 struct StructDiagnosticsStatusNotification
 {
@@ -4383,7 +4413,7 @@ struct OCPP16ConfigurationItem
 {
 	unsigned char 		ItemName[64];
 	unsigned char 		ItemAccessibility;//0:RO, 1:RW
-	unsigned char 		ItemData[500];
+	unsigned char 		ItemData[501];//value should be limited in 500 bytes
 };
 
 struct OCPP16ConfigurationTable
@@ -4563,9 +4593,9 @@ struct StructSignedFirmwareStatusNotification
 
 struct StructSessionTarget
 {
-	unsigned char		targetSoc;			// Unit: %,   		0 is unlimit
-	unsigned short		targetEnergy;		// Unit: KWH		0 is unlimit
-	unsigned short		targetDuration;		// Unit: Minutes	0 is unlimit
+    unsigned char       targetSoc;          // Unit: %,         0 is unlimit
+    unsigned short      targetEnergy;       // Unit: KWH        0 is unlimit
+    unsigned short      targetDuration;     // Unit: Minutes    0 is unlimit
 };
 
 struct OCPP16Data
@@ -4756,7 +4786,7 @@ struct OCPP16Data
     struct StructSecurityEventNotification          SecurityEventNotification;
     struct StructSignCertificate                    SignCertificate;
     struct StructSignedFirmwareStatusNotification   SignedFirmwareStatusNotification;
-    struct StructSessionTarget	                    SessionTarget[CONNECTOR_QUANTITY];
+    struct StructSessionTarget                      SessionTarget[CONNECTOR_QUANTITY];
 };
 
 

+ 9 - 3
EVSE/Projects/DD360ComBox/Apps/ModuleChkSysTask/Module_ChkSysTask.c

@@ -24,6 +24,7 @@ struct ChargingInfoData *pAcChargingInfo = NULL;
 static struct ChargingInfoData *pDcChargingInfo = NULL;
 struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 struct StatusCodeData           *ShmStatusCodeData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -226,13 +227,14 @@ void main(void)
         log_error("create share memory error");
         return ;
     }
-
+    MappingGunChargingInfo("CheckSystem Task");
     pSysConfig = (struct SysConfigData *)GetShmSysConfigData();
     pSysInfo = (struct SysInfoData *)GetShmSysInfoData();
     ShmOCPP16Data = (struct OCPP16Data *)GetShmOCPP16Data();
     ShmSysConfigAndInfo = (struct SysConfigAndInfo *)GetShmSysConfigAndInfo();
-    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();	
-    MappingGunChargingInfo("CheckSystem Task");
+    ShmStatusCodeData = (struct StatusCodeData *)GetShmStatusCodeData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
+
     while(true)
     {
       	for (uint8_t gun = 0; gun < pSysConfig->TotalConnectorCount; gun++) {
@@ -240,6 +242,10 @@ void main(void)
 			if (pDcChargingInfo->SystemStatus == SYS_MODE_UPDATE )
 				continue;
 		}
+        if (ShmDcCommonData->debugflag == YES) {
+            sleep(3);
+            continue;
+        }
 		CheckSystemTaskAlive();
 		sleep(3);
     }

+ 13 - 4
EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.c

@@ -854,6 +854,7 @@ static void addFaultCodeToBuf(uint8_t *Code)
                Code,
                strlen((char *)Code));
         pSysWarning->WarningCount++;
+        log_info("Warning Code:%s",Code);
     }
 }
 
@@ -912,7 +913,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     //uint8_t statusCodeError = 0;
 
     if (dataLen > 0) {
-        Hexdump((uint8_t *)data, dataLen);
+        //Hexdump((uint8_t *)data, dataLen);
 
         remaindLen = dataLen % WARNING_CODE_SIZE;
 
@@ -923,7 +924,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
 
         if (dataLen < WARNING_CODE_SIZE) {
             log_error("fail status code length = %d", dataLen);
-            Hexdump(data, dataLen);
+            //Hexdump(data, dataLen);
             if (pSysWarning->WarningCount > 0) {
                 for (i = 0; i < pSysWarning->WarningCount; i++) {
                     usleep(128);
@@ -993,7 +994,7 @@ static int powerCabinetStatusProcess(uint8_t dataLen, uint8_t *data)
     } else {
         if (CompareArrayIsZero(data, WARNING_CODE_SIZE) == false) {
             log_error("power cabinet status code data length is zero, but have data");
-            Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
+            //Hexdump((uint8_t *)data, WARNING_CODE_SIZE);
         }
     }
 
@@ -1417,6 +1418,7 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
 
     pConnState->ConnectorTemp = pDcChargingInfo->ConnectorTemp;
     pConnState->ChillerTemp = pDcChargingInfo->ChillerTemp;
+    pConnState->PlugIn = pDcChargingInfo->ConnectorPlugIn;
 
     if (pDcChargingInfo->SystemStatus <= S_AUTHORIZING) {
         pConnState->State = CONN_ST_IDLE;    //idle
@@ -1431,7 +1433,8 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
         pConnState->State = CONN_ST_PREPARING;    //preparing
     } else if (pDcChargingInfo->SystemStatus == S_CHARGING) {
         pConnState->State = CONN_ST_CHARGING;    //charging
-    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING) {
+    } else if (pDcChargingInfo->SystemStatus == S_TERMINATING ||
+            pDcChargingInfo->SystemStatus == S_COMPLETE) {
         pConnState->State = CONN_ST_TERMINATING;    //terminating
     } else if ((pDcChargingInfo->SystemStatus == S_ALARM) ||
                (pDcChargingInfo->SystemStatus == S_FAULT)) {
@@ -1445,9 +1448,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                     (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                     WARNING_CODE_SIZE);
             vendorErrorCodeTmp[plugNum][6] = '\0';
+            /*
             log_info("1 ID = %d, VendorErrorCode = %s",
                      plugNum,
                      (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                     */
         } else {
             if (strncmp(&vendorErrorCodeTmp[plugNum][0],
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
@@ -1457,9 +1462,11 @@ static int writeConnectorState(int fd, uint8_t plugNum, uint8_t id)
                         (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode,
                         WARNING_CODE_SIZE);
                 vendorErrorCodeTmp[plugNum][6] = '\0';
+                /*
                 log_info("2 ID = %d, VendorErrorCode = %s",
                          plugNum,
                          (char *)ShmOCPP16Data->StatusNotification[plugNum].VendorErrorCode);
+                         */
             }
         }
     }
@@ -2053,7 +2060,9 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_PREPARING_FOR_EVSE: //insaulation test
     case S_CCS_PRECHARGE_ST0:
     case S_CCS_PRECHARGE_ST1:
+
         writeChargingTarget(fd, plugNum, gunID);
+
 		if (pDcChargingInfo->PantographFlag)
 			writeGroundFaultDetection(fd, 1, gunID);
 

+ 2 - 1
EVSE/Projects/DD360ComBox/Apps/ModuleDoComm/DoComm.h

@@ -130,7 +130,8 @@ typedef struct StConnectorState {
     uint8_t WarningCode[6];
     uint8_t ConnectorTemp;
     uint8_t ChillerTemp;
-    uint8_t Reserved[3];
+    uint8_t PlugIn;
+    uint8_t Reserved[2];
 } ConnectorState;
 
 typedef struct StConnectorIDTable {

+ 2 - 1
EVSE/Projects/DD360ComBox/Apps/ModuleEvComm/Module_EvRxComm.c

@@ -417,7 +417,8 @@ void CANReceiver(int fd)
                         (pDcChargingInfo->SystemStatus >= S_CCS_PRECHARGE_ST0 &&
                          pDcChargingInfo->SystemStatus <= S_CCS_PRECHARGE_ST1)
                    ) {
-                    if (pDcChargingInfo->EvBatteryStartSoc <= 0) {
+                    if (pDcChargingInfo->EvBatteryStartSoc <= 0 &&
+                            pDcChargingInfo->SystemStatus >= S_PREPARING_FOR_EVSE) {
                         pDcChargingInfo->EvBatteryStartSoc = frame.data[1];
                     }
 

+ 0 - 3
EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/FanBoard.c

@@ -76,9 +76,6 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
-        return;
-    }
 
     // 風控修改 :
     // ******************************************************* //

+ 1 - 2
EVSE/Projects/DD360ComBox/Apps/ModuleInternalComm/RelayBoard.c

@@ -1200,7 +1200,6 @@ static void SetFanModuleSpeed(void)
             _setFanSpeed = ShmFanModuleData->SetFan1Speed;
         }
 
-        //printf("_setFanSpeed = %d \n", _setFanSpeed);
         _fanSpeed.speed[0] = _setFanSpeed;
 
         _fanSpeed.speed[1] = _setFanSpeed;
@@ -1237,7 +1236,7 @@ static void GetFanSpeed(void)
 
 static void GetFanSpeedByFunction(void)
 {
-    if (pSysConfig->SwitchDebugFlag == YES) {
+    if (ShmDcCommonData->debugflag== YES) {
         return;
     }
 

+ 102 - 7
EVSE/Projects/DD360ComBox/Apps/ModuleLcmCtrl/Module_LcmControl.c

@@ -16,7 +16,7 @@
 #include "../Define/define.h"
 #include "../Config.h"
 #include "../SelectGun/SelectGun.h"
-
+#include "../CSU/main.h"
 //------------------------------------------------------------------------------
 //struct SysConfigAndInfo         *ShmSysConfigAndInfo;
 //struct StatusCodeData           *ShmStatusCodeData;
@@ -31,7 +31,7 @@ static struct ChargingInfoData *pDcChargingInfo = NULL;
 static struct ChargingInfoData *pAcChargingInfo = NULL;
 
 bool needReloadQr = true;
-
+bool _saftydetect = false;
 bool _isShow = false; //DS60-120 add
 uint8_t _showInformIndex = 0; //DS60-120 add
 
@@ -215,7 +215,7 @@ uint8_t _logo_cmp               = 62;
 uint8_t _battery_eng_trp_map    = 63;
 uint8_t _money_trp_map          = 64;
 uint8_t _elapse_time_trp_map    = 65;
-
+#if defined DD360Audi
 ////For Audi
 uint8_t _left_gun_disable_map   = 66;
 uint8_t _left_gun_enable_map    = 67;
@@ -240,7 +240,18 @@ uint8_t _showselectgun_right    = 78;
 short __show_waitgunplug_value    = 0x0468;
 uint8_t _showwaitgunplug_left     = 80;
 uint8_t _showwaitgunplug_right    = 81;
-
+#else
+short __show_handshark_value    = 0x0464;
+short __show_GFD_value          = 0x0466;
+short __show_precharge_value    = 0x0468;
+
+uint8_t _show_handshark_dark    = 67;
+uint8_t _show_handshark_light   = 68;
+uint8_t _show_GFD_dark          = 69;
+uint8_t _show_GFD_light         = 70;
+uint8_t _show_precharge_dark    = 71;
+uint8_t _show_precharge_light   = 72;
+#endif
 //#define log_info(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_warn(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 //#define log_error(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -562,6 +573,7 @@ void ChangeWarningFunc()
     //log_info("WarningCount = %d ", pSysWarning->WarningCount);
 //#if !defined DD360 && !defined DD360Audi && !defined DD360ComBox
     for (i = 0; (i + pSysWarning->PageIndex * 5) < pSysWarning->WarningCount; i++) {
+        log_info("Warming Code[%d]:%s",i,&pSysWarning->WarningCode[i][0]);
         memset(cmd, 0x00, sizeof(cmd));
         if ((i) >= 5) {
             break;
@@ -880,7 +892,7 @@ void GetTimespecFunc(struct timespec *time)
 {
     clock_gettime(CLOCK_MONOTONIC_COARSE, time);
 }
-
+#if defined DD360Audi
 void RunReplugStringFunction(bool isRun)
 {
     if (isRun) {
@@ -918,7 +930,7 @@ void RunFullTargetFunction(bool isRun)
         ChangeDisplay2Value(__show_StatusString_value_2, _disappear);
     }
 }
-
+#endif
 /**
  * [ChangeBalanceValue :print balance information]
  * @Author
@@ -1739,6 +1751,40 @@ void InformationShow()
     }
 }
 
+void showPhihongLogo(bool _show)
+{
+    /*
+    if( pSysConfig->ModelName[3] == 'U' ) {
+        if (pSysConfig->ModelName[12] == 'P' && pSysConfig->ModelName[13] == 'H') {
+            ChangeDisplay2Value(_logo, _disappear);
+            ChangeDisplay2Value(_logo_cmp, _disappear);
+        }
+    }
+    */
+    if (!_show) {
+        ChangeDisplay2Value(_logo, _disappear);
+        ChangeDisplay2Value(_logo_cmp, _disappear);
+    }
+}
+unsigned long GetPreChargeTimeoutValue(struct timeval _sour_time)
+{
+    struct timeval _end_time;
+    gettimeofday(&_end_time, NULL);
+
+    return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
+}
+
+void ChangeTimeValue(uint8_t time)
+{
+    uint8_t cmd[2];
+    uint8_t value[2];
+
+    memset(cmd, 0x00, sizeof(cmd));
+    sprintf((char *) value, "%d", time);
+    string2ByteArray(value, cmd);
+    DisplayValueToLcm(0x1290, cmd, sizeof(cmd));
+}
+
 void ProcessPageInfo()
 {
     _page_reload = IsPageReloadChk();
@@ -1756,7 +1802,7 @@ void ProcessPageInfo()
             ChangeDisplay2Value(__sel_gun_btn, _disappear);
         }
     }
-
+    showPhihongLogo(false);
     switch (_currentPage) {
 #if defined DD360Audi
     case _LCM_SELECT_GUN: ////For Audi
@@ -1772,6 +1818,7 @@ void ProcessPageInfo()
 #endif //defined DD360Audi
 
     case _LCM_IDLE: {
+
         if (pSysConfig->isRFID) {
             ChangeDisplay2Value(__main_rfid, _main_rfid);
         } else {
@@ -2040,6 +2087,54 @@ void ProcessPageInfo()
             if (_currentPage == _LCM_PRE_CHARGE && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {
                     ChangeBattMapAndValue(_currentPage, pDcChargingInfo->EvBatterySoc);
+                    uint8_t precharg_time = (GetPreChargeTimeoutValue(pDcChargingInfo->PreChargeTimer)/1) / uSEC_VAL;
+                    if (precharg_time > PRECHARGING_TTIMEOUT)
+                        precharg_time = PRECHARGING_TTIMEOUT;
+                    ChangeTimeValue(PRECHARGING_TTIMEOUT- precharg_time);
+
+                    if (pDcChargingInfo->SystemStatus >= S_REASSIGN_CHECK &&
+                            pDcChargingInfo->SystemStatus <= S_PREPARING_FOR_EV) {
+                        pDcChargingInfo->_SaftyDetect = false;
+                        ChangeDisplay2Value(__show_handshark_value, _show_handshark_light);
+                        ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                        ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+
+                    } else if (pDcChargingInfo->SystemStatus == S_PREPARING_FOR_EVSE) {
+                        if (pDcChargingInfo->Type == _Type_Chademo || pDcChargingInfo->Type == _Type_GB) {
+                            if (pDcChargingInfo->_SaftyDetect == false ) {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                                if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                    pDcChargingInfo->_SaftyDetect = true;
+                            } else {
+                                ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                                ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                                ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                            }
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                        }
+                    } else if (pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST0 ||
+                            pDcChargingInfo->SystemStatus == S_CCS_PRECHARGE_ST1) {
+                        if (pDcChargingInfo->_SaftyDetect == false ) {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_light);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_dark);
+                            if (pDcChargingInfo->EvBatterytargetVoltage == 0)
+                                pDcChargingInfo->_SaftyDetect = true;
+                        } else {
+                            ChangeDisplay2Value(__show_handshark_value, _show_handshark_dark);
+                            ChangeDisplay2Value(__show_GFD_value, _show_GFD_dark);
+                            ChangeDisplay2Value(__show_precharge_value, _show_precharge_light);
+                        }
+                    } else {
+                        ChangeDisplay2Value(__show_handshark_value, _disappear);
+                        ChangeDisplay2Value(__show_GFD_value, _disappear);
+                        ChangeDisplay2Value(__show_precharge_value, _disappear);
+                    }
                 }
             } else if (_currentPage == _LCM_CHARGING && !isShowAc) {
                 if (pSysInfo->CurGunSelected == i) {

+ 11 - 5
EVSE/Projects/DD360ComBox/Apps/ModulePrimary/Module_PrimaryComm.c

@@ -44,6 +44,7 @@ static struct SysInfoData *pSysInfo = NULL;
 static struct AlarmCodeData *pAlarmCode = NULL;
 static struct FaultCodeData *pFaultCode = NULL;
 static struct PrimaryMcuData *ShmPrimaryMcuData;
+static DcCommonInfo *ShmDcCommonData = NULL;
 
 const char *priPortName = "/dev/ttyS1";
 uint8_t gun_count; //DS60-120 add
@@ -419,6 +420,9 @@ static void checkChillerStatus(Gpio_out *gpio)
         }
     }
 
+    if (ShmDcCommonData->debugflag == YES)
+        _chillerNeedOn = ShmDcCommonData->chillerCtrl;
+
     if(_chiller.ChillerSwitch != _chillerNeedOn)
     {
         log_info("Chiller Need Turn %s", _chillerNeedOn == YES ? "ON" : "OFF");
@@ -639,6 +643,7 @@ int main(void)
     pAlarmCode = (struct AlarmCodeData *)GetShmAlarmCodeData();
     pFaultCode = (struct FaultCodeData *)GetShmFaultCodeData();
     ShmPrimaryMcuData = (struct PrimaryMcuData *)GetShmPrimaryMcuData();
+    ShmDcCommonData = (DcCommonInfo *)GetShmDcCommonData();
 
     Uart1Fd = InitComPort();
     //log_info("407 Port id = %d ", Uart1Fd);
@@ -664,6 +669,11 @@ int main(void)
     for (;;) {
         // 程序開始之前~ 必須先確定 FW 版本與硬體版本,確認後!!~ 該模組才算是真正的 Initial Comp.
         // 模組更新 FW 後,需重新做
+        if(IsPrimaryProcessNeedPause() == true)
+        {
+            sleep(1);
+            continue;
+        }
         if (ShmPrimaryMcuData->SelfTest_Comp != PASS) {
             //log_info("(407) Get Fw and Hw Ver. ");
             GetFwAndHwVersion(Uart1Fd);
@@ -674,11 +684,7 @@ int main(void)
 
             GetInputGpioStatus(Uart1Fd);
         }
-        if(IsPrimaryProcessNeedPause() == true)
-        {
-            sleep(1);
-            continue;
-        }
+
 
         usleep(50000);
     }

BIN
EVSE/Projects/DD360ComBox/Apps/Module_ChkSysTask


BIN
EVSE/Projects/DD360ComBox/Apps/Module_DoComm


BIN
EVSE/Projects/DD360ComBox/Apps/Module_EvComm


BIN
EVSE/Projects/DD360ComBox/Apps/Module_EventLogging


BIN
EVSE/Projects/DD360ComBox/Apps/Module_InternalComm


BIN
EVSE/Projects/DD360ComBox/Apps/Module_UpdateFW


+ 30 - 5
EVSE/Projects/DD360ComBox/Apps/ReadCmdline.c

@@ -517,8 +517,12 @@ void GetGunSelectedNum(char *v1)
 void SetFanSpeed(char *v1)
 {
     int speed = atoi(v1);
-
-    ShmFanModuleData->TestFanSpeed = speed;
+    if(ShmDcCommonData->debugflag == YES) {
+        ShmFanModuleData->TestFanSpeed = speed;
+        printf("Set Fan speed: %d \n",ShmFanModuleData->TestFanSpeed);
+    }
+    else
+        printf("Please open debug mode\n");
 }
 
 void GetFanSpeed()
@@ -533,7 +537,8 @@ void SetDebugMode(char *v1)
 {
     int mode = atoi(v1);
 
-    pSysConfig->SwitchDebugFlag = mode;
+    ShmDcCommonData->debugflag = mode;
+    printf("Set Debug Mode:%d\n" , ShmDcCommonData->debugflag);
 }
 
 void SetGFDMode(char *v1)
@@ -717,7 +722,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         printf ("Input Voltage over range\n");
         return;
     }
-
     //kill ev task
     system("killall Module_EvComm");
 
@@ -771,6 +775,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 
             //清除 main timeout 機制
             pDcChargingInfo->TimeoutFlag = 0;
+            pSysInfo->SystemTimeoutFlag = 0;
+            pSysInfo->SystemPage = _LCM_NONE;
             //不論是什麼 type 的槍都固意設成 Chademo 不跑 Prechage step
             pDcChargingInfo->Type = 9;
             break;
@@ -941,6 +947,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
             pDcChargingInfo->PresentChargingPower = 0;
 
             if (stopChg == pSysConfig->TotalConnectorCount) {
+
                 system("/root/Module_EvComm &");
                 sleep(3);
 
@@ -1187,7 +1194,17 @@ static void writeOTPTemp(void)
         usleep(sleepTime);
     }//while
 }
-
+void writeChillerStatus(char *v1)
+{
+    if (ShmDcCommonData->debugflag == YES) {
+        ShmDcCommonData->chillerCtrl = atoi(newString[1]);
+        if (ShmDcCommonData->chillerCtrl)
+            printf("Chiller set on\n");
+        else
+            printf("Chiller set off\n");
+    } else
+        printf("Please open Debug mode\n");
+}
 static void writeGunAndChillerTemp(void)
 {
     uint8_t _GunIndex = 0;
@@ -1288,6 +1305,7 @@ int main(void)
                      "       tempW                             : write connector header and Chiller temperature\r\n"
                      "       tempR                             : print connector header and chiller temperature\r\n"
                      "       OTP                               : Write OTP temperature\r\n"
+                     "       chiller                           : set chiller on/off"
                      "\r\n";
 
     if (CreateAllCsuShareMemory() == FAIL) {
@@ -1323,6 +1341,7 @@ int main(void)
 //    }
 
     while (isContinue) {
+
         if (readCmdKey(CMD_KEY_WAIT) == NO) {
             continue;
         }
@@ -1437,6 +1456,10 @@ int main(void)
             }
             SetChargingInfoCCID(newString[1], newString[2]);
         } else if (strcmp(newString[0], "strchg") == 0) {
+            if (ShmDcCommonData->debugflag == NO ) {
+                printf("Please Open debug mode\n");
+                continue;
+            }
             //如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
             if (strcmp(newString[1], "auto") == 0) {
                 newString[2][0] = 0;
@@ -1457,6 +1480,8 @@ int main(void)
             resdGunAndChillerTemp();
         } else if (strcmp(newString[0], "OTP") == 0) { //測試槍頭和水冷機溫度
             writeOTPTemp();
+        } else if (strcmp(newString[0], "chiller") == 0) { //測試槍頭和水冷機溫度
+            writeChillerStatus(newString[1]);
         } else {
             printf("%s\n", usageMsg);
         }

+ 2 - 0
EVSE/Projects/DD360ComBox/Apps/Script/copy_from_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+sudo cp -r /mnt/d/Phihong/Project/DD360Audi/Apps/* /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/

+ 2 - 0
EVSE/Projects/DD360ComBox/Apps/Script/copy_to_d.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+cp -r /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Projects/DD360Audi/Apps/* /mnt/d/Phihong/Project/DD360Audi/Apps/

BIN
EVSE/Projects/DD360ComBox/Apps/UnsafetyOutputTask


BIN
EVSE/Projects/DD360ComBox/Apps/main


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.