Explorar o código

[Improve][Modularization][Module_OcppBackend / Module_OcppBackendPH / Module_OcppBackend20]

2022.07.28 / Folus Wen

Actions:
1. Add CharingProfileRefreshInterval key for auto refresh charging profile.

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 %!s(int64=2) %!d(string=hai) anos
pai
achega
8d8fb070f0

+ 28 - 3
EVSE/Modularization/ocpp20/MessageHandler.c

@@ -811,7 +811,7 @@ static int localversion=0;
 //===============================
 // Variable Version
 //===============================
-static int variableVersion=7;
+static int variableVersion=8;
 
 //===============================
 // OCPP sign variable
@@ -886,6 +886,7 @@ struct ClientTime
 	struct timespec StopTransaction;
 	struct timespec MeterValues[CONNECTOR_QUANTITY];
 	struct timespec RemoteStartWait;
+	struct timespec CharingProfileRefresh[CONNECTOR_QUANTITY];
 
 }clientTime;
 
@@ -2297,6 +2298,16 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationInterval].variableAttribute[0].value, "120");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationInterval]);
 
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].component.name, "OCPPCommCtrlr");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variable.name, "CharingProfileRefreshInterval");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableCharacteristics.unit, "Seconds");
+		ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableCharacteristics.minLimit = 5;
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableAttribute[0].value, "30");
+		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval]);
+
 		/* ReservationCtrlr Required item */
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
@@ -2995,6 +3006,9 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationInterval].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationInterval].variable.name, "StatusNotificationInterval");
 
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].component.name, "OCPPCommCtrlr");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variable.name, "CharingProfileRefreshInterval");
+
 		/* ReservationCtrlr Required item */
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
@@ -7669,13 +7683,16 @@ void CheckSystemValue(void)
 		}
 
 		//==============================================
-		// CSU Trigger Smart Charging Profile
+		// CSU Trigger or timer timeout refresh Smart Charging Profile
 		//==============================================
-		if(ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq == ON)
+		if((ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq == ON) ||
+		   ((cpinitateMsg.bits[gun_index].isOnCharging) && (atoi((const char *)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableAttribute[0].value) > 0) && (getDiffSecNow(clientTime.CharingProfileRefresh[gun_index]) > atoi((const char *)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableAttribute[0].value))))
 		{
 			checkChargingStationMaxProfile(86400, &ShmOCPP20Data->MaxChargingProfile, 0, TRUE);
 			checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP20Data->SmartChargingProfile[gun_index], 0, TRUE);
 			ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq = OFF;
+
+			refreshStartTimer(&clientTime.CharingProfileRefresh[gun_index]);
 		}
 
 		//==============================================
@@ -18609,6 +18626,14 @@ int handleSetVariablesRequest(char *uuid, char *payload)
 									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
 							}
 
+							if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "OCPPCommCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "CharingProfileRefreshInterval") != NULL))
+							{
+								if((0 < atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)) && (atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue) < (int)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.minLimit) )
+									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_OutOfRange]);
+								else
+									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
+							}
+
 							if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "SecurityCtrlr") != NULL) &&
 							   ((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "SecurityProfile") != NULL) || (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "BasicAuthPassword") != NULL)))
 							{

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

@@ -133,6 +133,7 @@ struct ClientTime
 	struct timespec MeterValues[CONNECTOR_QUANTITY];
 	struct timespec RemoteStartWait;
 	struct timespec TcciQueryDeduct;
+	struct timespec CharingProfileRefresh[CONNECTOR_QUANTITY];
 }clientTime;
 
 typedef union
@@ -5425,12 +5426,15 @@ void CheckSystemValue(void)
 		}
 
 		//==============================================
-		// CSU Trigger Smart Charging Profile
+		// CSU Trigger or timer timeout refresh Smart Charging Profile
 	    //==============================================
-	    if(ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
+	    if((ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq == 1) ||
+	       ((cpinitateMsg.bits[gun_index].isOnCharging) && (atoi((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData) > 0) && (getDiffSecNow(clientTime.CharingProfileRefresh[gun_index]) > atoi((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData))))
 	    {
 	    	checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16Data->SmartChargingProfile[gun_index], TRUE);
 	    	ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
+
+	    	refreshStartTimer(&clientTime.CharingProfileRefresh[gun_index]);
 	    }
 
 		//==============================================
@@ -16342,7 +16346,7 @@ int initialConfigurationTable(void)
 	char sstr[256]={0};
 	int c = 0;
 	char *loc;
-	int	confVersion = 17;
+	int	confVersion = 18;
 
 	DEBUG_INFO("initialConfigurationTable...version: %d\n", confVersion);
 	//start_t = clock();
@@ -16800,6 +16804,14 @@ int initialConfigurationTable(void)
 
 		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","ConfigurationVersion", "true", ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemData);
 
+		// Charging profile refresh interval
+		ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility = 1;
+		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemName, "CharingProfileRefreshInterval");
+		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "30");
+
+		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CharingProfileRefreshInterval", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData);
+
+
 		//* Local Auth List Management Profile*/
 		#if 0
 			//For OCTT Test Case
@@ -17293,6 +17305,12 @@ int initialConfigurationTable(void)
 					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemData, "%d", atoi(valuestr));
 				}
 
+				if(strcmp(keystr, "CharingProfileRefreshInterval") == 0)
+				{
+					ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
+					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%s", valuestr);
+				}
+
 				if(strcmp(keystr, "LocalAuthListEnabled") == 0)
 				{
 					ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
@@ -17891,6 +17909,15 @@ void StoreConfigurationTable(void)
 
 	fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","ConfigurationVersion", "true", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemData);
 
+	// CharingProfileRefreshInterval
+	/*
+	ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility = 1;
+	strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemName, "CharingProfileRefreshInterval");
+	strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "" );
+	*/
+
+	fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CharingProfileRefreshInterval", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData);
+
 	//* Local Auth List Management Profile*/
 	//LocalAuthListEnabled
 	/*
@@ -19015,6 +19042,23 @@ void getKeyValue(char *keyReq)
 			  isKnowKey = TRUE;
 		  }
 
+		  if(isEmpty ||  strcmp(keyReq, "CharingProfileRefreshInterval") == 0 )
+		  {
+			  strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_CharingProfileRefreshInterval].Item, "CharingProfileRefreshInterval");
+			  strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].Key, "CharingProfileRefreshInterval");
+
+			  if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility == 1)
+			  {
+				  strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].ReadOnly, "0"/*"FALSE"*/);
+			  }
+			  else
+			  {
+				  strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].ReadOnly, "1"/*"TRUE"*/);
+			  }
+
+			  strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData );
+			  isKnowKey = TRUE;
+		  }
 #if 1
 	      if(isEmpty ||  strcmp(keyReq, "LocalAuthListEnabled") == 0 )
 	      {
@@ -20368,6 +20412,26 @@ int setKeyValue(char *key, char *value)
 		}
 	}
 
+	if(strcmp(key, "CharingProfileRefreshInterval") == 0)
+	{
+		if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility == 1)
+		{
+			if((atoi(value) != 0) && (atoi(value) < 5))
+			{
+				isSuccess = ConfigurationStatus_Rejected;
+			}
+			else{
+				strcpy(str, (const char*)value);
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%s", str );
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+		}
+		else
+		{
+			isSuccess = ConfigurationStatus_Rejected;
+		}
+	}
+
 #if 0
     //For OCPP Test Case
     if(strcmp(key, "LocalAuthorizationListEnabled") == 0)

+ 1 - 0
EVSE/Modularization/ocppfiles/MessageHandler.h

@@ -417,6 +417,7 @@ enum GetConfigurationKey {
 	GetConfiguration_ConnectorSwitch3to1PhaseSupported,
 	GetConfiguration_MaxChargingProfilesInstalled,
 	GetConfiguration_ConfigurationVersion,
+	GetConfiguration_CharingProfileRefreshInterval,
 	_GetConfiguration_CNT
 };
 

+ 67 - 4
EVSE/Modularization/ocppph/MessageHandler.c

@@ -134,6 +134,7 @@ struct ClientTime
 	struct timespec MeterValues[CONNECTOR_QUANTITY];
 	struct timespec RemoteStartWait;
 	struct timespec TcciQueryDeduct;
+	struct timespec CharingProfileRefresh[CONNECTOR_QUANTITY];
 }clientTime;
 
 typedef union
@@ -4946,12 +4947,15 @@ void CheckSystemValue(void)
 		}
 
 		//==============================================
-		// CSU Trigger Smart Charging Profile
+		// CSU Trigger or timer timeout refresh Smart Charging Profile
 	    //==============================================
-	    if(ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq == 1)
-	    {
+		 if((ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq == 1) ||
+		   ((cpinitateMsg.bits[gun_index].isOnCharging) && (atoi((const char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData) > 0) && (getDiffSecNow(clientTime.CharingProfileRefresh[gun_index]) > atoi((const char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData))))
+		{
 	    	checkCompositeSchedule(gun_index+1, 86400, &ShmOCPP16DataPH->SmartChargingProfile[gun_index], TRUE);
 	    	ShmOCPP16DataPH->CSUMsg.bits[gun_index].ChargingProfileReq = 0;
+
+	    	refreshStartTimer(&clientTime.CharingProfileRefresh[gun_index]);
 	    }
 
 		//==============================================
@@ -15834,7 +15838,7 @@ int initialConfigurationTable(void)
 	char sstr[256]={0};
 	int c = 0;
 	char *loc;
-	int	confVersion = 16;
+	int	confVersion = 17;
 
 	DEBUG_INFO("initialConfigurationTable...version: %d\n", confVersion);
 	//start_t = clock();
@@ -16264,6 +16268,13 @@ int initialConfigurationTable(void)
 
 		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","ConfigurationVersion", "true", ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemData);
 
+		// Charging profile refresh interval
+		ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility = 1;
+		strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemName, "CharingProfileRefreshInterval");
+		sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "30");
+
+		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CharingProfileRefreshInterval", "false", ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData);
+
 		//* Local Auth List Management Profile*/
 		#if 0
 			//For OCTT Test Case
@@ -16734,6 +16745,12 @@ int initialConfigurationTable(void)
 					sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemData, "%d", atoi(valuestr));
 				}
 
+				if(strcmp(keystr, "CharingProfileRefreshInterval") == 0)
+				{
+					ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
+					sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%s", valuestr);
+				}
+
 				if(strcmp(keystr, "LocalAuthListEnabled") == 0)
 				{
 					ShmOCPP16DataPH->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
@@ -17295,6 +17312,16 @@ void StoreConfigurationTable(void)
 
 	fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","ConfigurationVersion", "true", (char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemData);
 
+	// CharingProfileRefreshInterval
+	/*
+	ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility = 1;
+	strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemName, "CharingProfileRefreshInterval");
+	strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "" );
+	*/
+
+	fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CharingProfileRefreshInterval", "false", (char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData);
+
+
 	//* Local Auth List Management Profile*/
 	//LocalAuthListEnabled
 	/*
@@ -18347,6 +18374,23 @@ void getKeyValue(char *keyReq)
 			  isKnowKey = TRUE;
 		  }
 
+		  if(isEmpty ||  strcmp(keyReq, "CharingProfileRefreshInterval") == 0 )
+		  {
+			  strcpy((char *)ShmOCPP16DataPH->GetConfiguration.Key[GetConfiguration_CharingProfileRefreshInterval].Item, "CharingProfileRefreshInterval");
+			  strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].Key, "CharingProfileRefreshInterval");
+
+			  if(ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility == 1)
+			  {
+				  strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].ReadOnly, "0"/*"FALSE"*/);
+			  }
+			  else
+			  {
+				  strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].ReadOnly, "1"/*"TRUE"*/);
+			  }
+
+			  strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_CharingProfileRefreshInterval].Value, (const char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData );
+			  isKnowKey = TRUE;
+		  }
 #if 1
 	      if(isEmpty ||  strcmp(keyReq, "LocalAuthListEnabled") == 0 )
 	      {
@@ -19643,6 +19687,25 @@ int setKeyValue(char *key, char *value)
 		}
 	}
 
+	if(strcmp(key, "CharingProfileRefreshInterval") == 0)
+	{
+		if(ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemAccessibility == 1)
+		{
+			if((atoi(value) != 0) && (atoi(value) < 5))
+			{
+				isSuccess = ConfigurationStatus_Rejected;
+			}
+			else{
+				strcpy(str, (const char*)value);
+				sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%s", str );
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+		}
+		else
+		{
+			isSuccess = ConfigurationStatus_Rejected;
+		}
+	}
 #if 0
     //For OCPP Test Case
     if(strcmp(key, "LocalAuthorizationListEnabled") == 0)

+ 1 - 0
EVSE/Modularization/ocppph/MessageHandler.h

@@ -413,6 +413,7 @@ enum GetConfigurationKey {
 	GetConfiguration_ConnectorSwitch3to1PhaseSupported,
 	GetConfiguration_MaxChargingProfilesInstalled,
 	GetConfiguration_ConfigurationVersion,
+	GetConfiguration_CharingProfileRefreshInterval,
 	_GetConfiguration_CNT
 };
 

+ 2 - 0
EVSE/Projects/define.h

@@ -344,6 +344,7 @@ enum CoreProfile {
      EVCCID_PREFIX,
      OffLineMaxChargingPower,
      ConfigurationVersion,
+	 CharingProfileRefreshInterval,
 	 _CoreProfile_CNT
 };
 
@@ -5067,6 +5068,7 @@ enum OCPP20CtrlrVariable
 	OCPPCommCtrlr_PublicKeyWithSignedMeterValue,
     OCPPCommCtrlr_StatusNotificationPeriodically,
     OCPPCommCtrlr_StatusNotificationInterval,
+	OCPPCommCtrlr_CharingProfileRefreshInterval,
     OCPPCommCtrlr_VariableVersion,
 	ReservationCtrlr_Enabled,
 	ReservationCtrlr_Available,