Răsfoiți Sursa

[Improve][AW-Regular][main.c]
2022-07-13 / EASON YANG
Action:
1. Improve: ocpp_get_reset_req() function. For OCPP 2.0.1 reset logic.
2. Improve: checkStopReason() function. For OCPP 2.O.1 reset logic.

File:
1. main.c
Action 1
Action 2

FIRMWARE VERSION: V0.71.XX.XXXX.PX

8009 2 ani în urmă
părinte
comite
0dc7e5a48a
1 a modificat fișierele cu 14 adăugiri și 6 ștergeri
  1. 14 6
      EVSE/Projects/AW-Regular/Apps/main.c

+ 14 - 6
EVSE/Projects/AW-Regular/Apps/main.c

@@ -523,7 +523,18 @@ uint8_t ocpp_get_reset_req()
 	}
 	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
 	{
-		result = ShmOCPP20Data->MsMsg.bits.ResetReq;
+		if(strcmp((char*)ShmOCPP20Data->Reset.type, "Immediate") == 0)
+		{
+			result = ShmOCPP20Data->MsMsg.bits.ResetReq;
+		}
+		else
+		{
+			if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_CHARGING) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_TERMINATING) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_COMPLETE)) &&
+			   (AC_QUANTITY>1?((ShmSysConfigAndInfo->SysInfo.AcChargingData[1].SystemStatus != SYS_MODE_CHARGING) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[1].SystemStatus != SYS_MODE_TERMINATING) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[1].SystemStatus != SYS_MODE_COMPLETE)):TRUE))
+			{
+				result = ShmOCPP20Data->MsMsg.bits.ResetReq;
+			}
+		}
 	}
 
 	return result;
@@ -3966,12 +3977,9 @@ void checkStopReason(uint8_t gun_index)
 		{
 			sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "GroundFault");
 		}
-		else if(ShmOCPP20Data->MsMsg.bits.ResetReq)
+		else if((ShmOCPP20Data->MsMsg.bits.ResetReq) && (strcmp((char*)ShmOCPP20Data->Reset.type, "Immediate")==0))
 		{
-			if(strcmp((char*)ShmOCPP20Data->Reset.type, "Immediate")==0)
-				sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "ImmediateReset");
-			else
-				sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "OnIdle");
+			sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "ImmediateReset");
 		}
 		else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
 		{