ソースを参照

[Improve][Modularization][Module_OcppBackend]

2021.08.18 / Folus Wen

Actions:
1. Charging profile check logic move behind connector status check.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 年 前
コミット
266249fd4c

+ 9 - 9
EVSE/Modularization/ocpp20/MessageHandler.c

@@ -5568,15 +5568,6 @@ void CheckSystemValue(void)
 			ShmOCPP20Data->CsMsg.bits[gun_index].DataTransferReq = OFF;
 		}
 
-		//===============================
-		// CSU Trigger Smart Charging Profilw
-		//===============================
-		if(ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq == ON)
-		{
-			checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP20Data->SmartChargingProfile[gun_index], 0, TRUE);
-			ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq = OFF;
-		}
-
 		//==============================================
 		// Charger start transaction
 		//==============================================
@@ -5877,6 +5868,15 @@ void CheckSystemValue(void)
 			clientTime.StatusNotification[gun_index] = time((time_t*)NULL);
 		}
 
+		//===============================
+		// CSU Trigger Smart Charging Profilw
+		//===============================
+		if(ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq == ON)
+		{
+			checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP20Data->SmartChargingProfile[gun_index], 0, TRUE);
+			ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq = OFF;
+		}
+
 		if(isWebsocketSendable && (server_sign == TRUE) && (cpinitateMsg.bits[gun_index].TransactionEventReq == ON))
 		{
 			sendTransactionEventRequest(gun_index);

+ 9 - 9
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -2940,15 +2940,6 @@ void CheckSystemValue(void)
 			sendAuthorizeRequest(0);
 		}
 
-		//==============================================
-		// CSU Trigger Smart Charging Profilw
-	    //==============================================
-	    if(ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
-	    {
-	    	checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16Data->SmartChargingProfile[gun_index], TRUE);
-	    	ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
-	    }
-
 		//==============================================
 		// Charger start transaction
 		//==============================================
@@ -3272,6 +3263,15 @@ void CheckSystemValue(void)
 			clientTime.StatusNotification[gun_index] = time((time_t*)NULL);
 		}
 
+		//==============================================
+		// CSU Trigger Smart Charging Profilw
+	    //==============================================
+	    if(ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
+	    {
+	    	checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16Data->SmartChargingProfile[gun_index], TRUE);
+	    	ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
+	    }
+
 		//==============================================
 		// Meter report
 		//==============================================

+ 9 - 9
EVSE/Modularization/ocppph/MessageHandler.c

@@ -2953,15 +2953,6 @@ void CheckSystemValue(void)
 			sendAuthorizeRequest(0);
 		}
 
-		//==============================================
-		// CSU Trigger Smart Charging Profilw
-	    //==============================================
-	    if(ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
-	    {
-	    	checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16DataPH->SmartChargingProfile[gun_index], TRUE);
-	    	ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
-	    }
-
 		//==============================================
 		// Charger start transaction
 		//==============================================
@@ -3288,6 +3279,15 @@ void CheckSystemValue(void)
 			clientTime.StatusNotification[gun_index] = time((time_t*)NULL);
 		}
 
+		//==============================================
+		// CSU Trigger Smart Charging Profilw
+	    //==============================================
+	    if(ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
+	    {
+	    	checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16DataPH->SmartChargingProfile[gun_index], TRUE);
+	    	ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
+	    }
+
 		//==============================================
 		// Meter report
 		//==============================================