Browse Source

[Improve][Moduralization][Module_OcppBackend]

2020.10.31 / Folus Wen

Actions:
1. EVSE/Modularization/ocppfiles/MessageHandler.c TxProfile delete timing add SYS_MODE_BOOT~SYS_MORE_PREPARING.
2. EVSE/Projects/define.h OCPP 2.0.1 structre array down size.

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 4 years ago
parent
commit
4fedfd8b9e

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

@@ -2409,7 +2409,7 @@ void CheckSystemValue(void)
 						statusModeChage[gun_index] = TRUE;
 					}
 
-					if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex) && (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_COMPLETE)) // complete
+					if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex) && ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_COMPLETE) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus <= SYS_MODE_PREPARING))) // complete
 					{
 						sprintf(filenmae,"/Storage/OCPP/TxProfile_%d.json",(gun_index+1));
 						if((access(filenmae,F_OK))!=-1)
@@ -2455,7 +2455,7 @@ void CheckSystemValue(void)
 						statusModeChage[gun_index] = TRUE;
 					}
 
-					if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex) && (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_COMPLETE)) // complete
+					if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex) && ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_COMPLETE) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus <= SYS_MODE_PREPARING))) // complete
 					{
 						sprintf(filenmae,"/Storage/OCPP/TxProfile_%d.json",(gun_index+1));
 						if((access(filenmae,F_OK))!=-1)
@@ -2500,7 +2500,7 @@ void CheckSystemValue(void)
 						statusModeChage[gun_index] = TRUE;
 					}
 
-					if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex) && (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_COMPLETE)) // complete
+					if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex) && ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_COMPLETE) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus <= SYS_MODE_PREPARING))) // complete
 					{
 						sprintf(filenmae,"/Storage/OCPP/TxProfile_%d.json",(gun_index+1));
 						if((access(filenmae,F_OK))!=-1)
@@ -2537,7 +2537,7 @@ void CheckSystemValue(void)
 						statusModeChage[gun_index] = TRUE;
 					}
 
-					if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_COMPLETE)) // complete
+					if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex) && ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_COMPLETE) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus <= SYS_MODE_PREPARING))) // complete
 					{
 						sprintf(filenmae,"/Storage/OCPP/TxProfile_%d.json",(gun_index+1));
 						if((access(filenmae,F_OK))!=-1)
@@ -2581,7 +2581,7 @@ void CheckSystemValue(void)
 						statusModeChage[gun_index] = TRUE;
 					}
 
-					if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE)) // complete
+					if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex) && ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus <= SYS_MODE_PREPARING))) // complete
 					{
 						sprintf(filenmae,"/Storage/OCPP/TxProfile_%d.json",(gun_index+1));
 						if((access(filenmae,F_OK))!=-1)

+ 2 - 2
EVSE/Projects/AW-CCS/Apps/main.c

@@ -413,7 +413,7 @@ int CreatShareMemory()
    	memset(ShmOCPP16Data,0,sizeof(struct OCPP16Data));
 
    	//creat ShmOCPP20Data
-	if ((MeterSMId = shmget(ShmOcpp20ModuleKey, sizeof(struct OCPP20Data), IPC_CREAT | 0777)) < 0)
+	/*if ((MeterSMId = shmget(ShmOcpp20ModuleKey, sizeof(struct OCPP20Data), IPC_CREAT | 0777)) < 0)
 	{
 
 		DEBUG_ERROR("shmget OCPP20Data NG\n");
@@ -427,7 +427,7 @@ int CreatShareMemory()
 
 		result = FAIL;
 	}
-	memset(ShmOCPP20Data,0,sizeof(struct OCPP20Data));
+	memset(ShmOCPP20Data,0,sizeof(struct OCPP20Data));*/
 
 	//creat ShmCharger
    	if ((MeterSMId = shmget(ShmChargerKey, sizeof(struct Charger), IPC_CREAT | 0777)) < 0)

+ 2 - 2
EVSE/Projects/define.h

@@ -5102,7 +5102,7 @@ struct NotifyChargingLimit_20
 {
 	unsigned int evseId;											// Optional. The charging schedule contained in this notification applies to an EVSE. evseId must be > 0.
 	struct ChargingLimitType chargingLimit;							// Required. This contains the source of the charging limit and whether it is grid critical.
-	struct ChargingScheduleType chargingSchedule[10];				// Optional. Contains limits for the available power or current over time, as set by the external source.
+	struct ChargingScheduleType chargingSchedule[1];				// Optional. Contains limits for the available power or current over time, as set by the external source.
 };
 
 struct NotifyCustomerInformation_20
@@ -5187,7 +5187,7 @@ struct ReportChargingProfiles_20
 	unsigned char chargingLimitSource[8];							// Required. Source that has installed this charging profile.
 	unsigned char tbc;												// Optional. To Be Continued. Default value when omitted: false. false indicates that there are no further messages as part of this report.
 	unsigned int evseId;											// Required. The evse to which the charging profile applies. If evseId = 0, the message contains an overall limit for the Charging Station.
-	struct ChargingProfileType chargingProfile[10];					// Required. The charging profile as configured in the Charging Station.
+	struct ChargingProfileType chargingProfile[3];					// Required. The charging profile as configured in the Charging Station.
 };
 
 struct RequestStartTransaction_20