Explorar o código

Merge branch 'master' of https://git.phihong.com.tw:30000/system_integration/csu3_am335x

william %!s(int64=2) %!d(string=hai) anos
pai
achega
dd899c5e6d

+ 1 - 1
.gitignore

@@ -12,7 +12,7 @@
 #.*
 *.o
 *.o.*
-#*.a
+*.a
 *.s
 *.so.dbg
 *.mod.c

+ 81 - 80
EVSE/Modularization/WebService.c

@@ -1975,14 +1975,9 @@ int main(int argc, char *argv[]) {
 		struct json_object *isCalibratedPa[3];
 		struct json_object *isCalibratedPb[3];
 		struct json_object *isCalibratedPc[3];
-		struct json_object *ChargePointPrivateKey;
-		struct json_object *ChargePointCertificate;
 		struct json_object *V2GPrivateKey;
 		struct json_object *V2GRootCertificate;
 		struct json_object *V2GCertificateChain;
-		struct json_object *MORootCertificate;
-		struct json_object *CSRootCertificate;
-		struct json_object *ManufacturerRootCertificate;
 		/* for DO & DD*/
 		struct json_object *DDChargingInfo1;
 		struct json_object *DDChargingInfo2;
@@ -2068,6 +2063,11 @@ int main(int argc, char *argv[]) {
 		struct json_object *PowerSharingServerIP;
 		struct json_object *OcppReceiptrURL;
 		struct json_object *MaintainServerURL;
+		struct json_object *ChargePointPrivateKey;
+		struct json_object *ChargePointCertificate;
+		struct json_object *MORootCertificate;
+		struct json_object *CSRootCertificate;
+		struct json_object *ManufacturerRootCertificate;
 		/*for TTIA*/
 		struct json_object *isEnableTTIA;
 		struct json_object *server_addr;
@@ -2719,34 +2719,6 @@ int main(int argc, char *argv[]) {
 		//V2G certificate
 		FILE *file;
 		char line[0];
-		ChargePointPrivateKey = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					ChargePointPrivateKey = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
-		ChargePointCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					ChargePointCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
 		V2GPrivateKey = json_object_new_string("");
 		file = popen("sha256sum /Storage/certV2G.key", "r");
 		if (NULL != file)
@@ -2789,48 +2761,6 @@ int main(int argc, char *argv[]) {
 			}
 		}
 		pclose(file);
-		MORootCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/rootCaMo.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					MORootCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
-		CSRootCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					CSRootCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
-		ManufacturerRootCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					ManufacturerRootCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
 		//network
 		InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
 		FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
@@ -2913,6 +2843,77 @@ int main(int argc, char *argv[]) {
 			TTIAChargeBoxId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
 			evseStation = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
 		}
+		//PnC certificate
+		ChargePointPrivateKey = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					ChargePointPrivateKey = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		ChargePointCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					ChargePointCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		MORootCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/rootCaMo.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					MORootCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		CSRootCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					CSRootCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		ManufacturerRootCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					ManufacturerRootCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
 
 		//system
 		json_object_object_add(jobj1,"ModelName",ModelName);
@@ -3276,14 +3277,9 @@ int main(int argc, char *argv[]) {
 				json_object_object_add(jobj2,"DDChargingInfo4",DDChargingInfo4);
 			}
 		}
-		json_object_object_add(jobj2,"ChargePointPrivateKey",ChargePointPrivateKey);
-		json_object_object_add(jobj2,"ChargePointCertificate",ChargePointCertificate);
 		json_object_object_add(jobj2,"V2GPrivateKey",V2GPrivateKey);
 		json_object_object_add(jobj2,"V2GRootCertificate",V2GRootCertificate);
 		json_object_object_add(jobj2,"V2GCertificateChain",V2GCertificateChain);
-		json_object_object_add(jobj2,"MORootCertificate",MORootCertificate);
-		json_object_object_add(jobj2,"CSRootCertificate",CSRootCertificate);
-		json_object_object_add(jobj2,"ManufacturerRootCertificate",ManufacturerRootCertificate);
 		printf("%s\n", json_object_to_json_string(jobj2));
 		json_object_put(jobj2);
 
@@ -3373,6 +3369,11 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(jobj4,"TTIAChargeBoxId",TTIAChargeBoxId);
 			json_object_object_add(jobj4,"evseStation",evseStation);
 		}
+		json_object_object_add(jobj4,"ChargePointPrivateKey",ChargePointPrivateKey);
+		json_object_object_add(jobj4,"ChargePointCertificate",ChargePointCertificate);
+		json_object_object_add(jobj4,"MORootCertificate",MORootCertificate);
+		json_object_object_add(jobj4,"CSRootCertificate",CSRootCertificate);
+		json_object_object_add(jobj4,"ManufacturerRootCertificate",ManufacturerRootCertificate);
 
 		printf("%s\n", json_object_to_json_string(jobj4));
 		json_object_put(jobj4);

+ 307 - 86
EVSE/Modularization/ocpp20/MessageHandler.c

@@ -812,7 +812,7 @@ static int localversion=0;
 //===============================
 // Variable Version
 //===============================
-static int variableVersion=8;
+static int variableVersion=9;
 
 //===============================
 // OCPP sign variable
@@ -976,6 +976,26 @@ int meterValueBufferInsert(uint8_t gun_index, ReadingContextEnumType dataType, c
 	return result;
 }
 
+int meterValueBufferReplace(int bufferIdx, uint8_t gun_index, ReadingContextEnumType dataType, char * transactionId, char *meterValue)
+{
+	int result = PASS;
+	char sqlCmd[8192];
+	char *errMsg = 0;
+
+	sprintf(sqlCmd, "replace into meterValuesBuffer(idx, occurDatetime, gun_index, transactionId, ReadingContext, meterValue) values('%d', CURRENT_TIMESTAMP, '%d', '%s','%d','%s')", bufferIdx
+																																												   , gun_index
+																																												   , transactionId
+																																												   , (dataType==ReadingContextEnumType_Sample_Periodic?0:1)
+																																												   , meterValue);
+	if (sqlite3_exec(db, sqlCmd, 0, 0, &errMsg) != SQLITE_OK)
+	{
+		result = FAIL;
+		DEBUG_WARN( "Insert meter value record error message: %s\n", errMsg);
+	}
+
+	return result;
+}
+
 int meterValueBufferQuery(uint8_t gun_index, json_object *MeterValues)
 {
 	int result = PASS;
@@ -1994,7 +2014,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].component.name, "AlignedDataCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].variable.name, "Enabled");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Enabled]);
@@ -2002,7 +2022,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].component.name, "AlignedDataCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].variable.name, "Available");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available].variableAttribute[0].value, "true");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Available]);
@@ -2011,7 +2031,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variable.name, "Measurands");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
 		ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.maxLimit = 20;
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
 			sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].value, "Current.Import,"
@@ -2036,7 +2056,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableCharacteristics.unit, "Seconds");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
 		ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableCharacteristics.minLimit = 5;
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval].variableAttribute[0].value, "0");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Interval]);
@@ -2044,7 +2064,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].component.name, "AlignedDataCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].variable.name, "SendDuringIdle");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle].variableAttribute[0].value, "true");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SendDuringIdle]);
@@ -2052,7 +2072,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].component.name, "AlignedDataCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].variable.name, "SignReadings");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_SignReadings]);
@@ -2061,7 +2081,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variable.name, "TxEndedMeasurands");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
 		ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableCharacteristics.maxLimit = 10;
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
 			sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableAttribute[0].value, "Current.Import,"
@@ -2192,7 +2212,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].component.name, "ClockCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].variable.name, "DateTime");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_dateTime]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		getNowDatetime(ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime].variableAttribute[0].value);
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_DateTime]);
@@ -2200,7 +2220,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].component.name, "ClockCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].variable.name, "NtpSource");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_OptionList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource].variableAttribute[0].value, "DHCP, manual");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpSource]);
@@ -2209,7 +2229,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variable.name, "NtpServerUri");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variable.instance, "1");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri].variableAttribute[0].value, " ");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NtpServerUri]);
@@ -2217,7 +2237,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].component.name, "ClockCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].variable.name, "TimeOffset");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset].variableAttribute[0].value, "+00:00");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeOffset]);
@@ -2225,7 +2245,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].component.name, "ClockCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].variable.name, "NextTimeOffsetTransitionDateTime");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_dateTime]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime].variableAttribute[0].value, " ");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTimeOffsetTransitionDateTime]);
@@ -2234,7 +2254,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variable.name, "TimeOffset");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variable.instance, "NextTransition");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset].variableAttribute[0].value, "+00:00");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_NextTransition_TimeOffset]);
@@ -2242,7 +2262,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].component.name, "ClockCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].variable.name, "TimeSource");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_SequenceList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource].variableAttribute[0].value, "Heartbeat,RealTimeClock");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeSource]);
@@ -2250,7 +2270,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].component.name, "ClockCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].variable.name, "TimeZone");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone].variableAttribute[0].value, "UTC");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ClockCtrlr_TimeZone]);
@@ -2259,7 +2279,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].component.name, "ChargingStation");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].variable.name, "Available");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ChargingStation_Available]);
@@ -2267,7 +2287,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].component.name, "ChargingStation");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].variable.name, "AvailabilityState");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_OptionList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState].variableAttribute[0].value, "Available,Occupied,Reserved,Unavailable,Faulted");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ChargingStation_AvailabilityState]);
@@ -2275,7 +2295,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].component.name, "ChargingStation");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].variable.name, "SupplyPhases");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases].variableAttribute[0].value, "3");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[ChargingStation_SupplyPhases]);
@@ -2316,7 +2336,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].component.name, "Connector");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].variable.name, "Available");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_Available].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[Connector_Available]);
@@ -2324,7 +2344,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].component.name, "Connector");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].variable.name, "ConnectorType");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType].variableAttribute[0].value, " ");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[Connector_ConnectorType]);
@@ -2332,7 +2352,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].component.name, "Connector");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].variable.name, "SupplyPhases");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases].variableAttribute[0].value, "3");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[Connector_SupplyPhases]);
@@ -2341,7 +2361,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].component.name, "CustomizationCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].variable.name, "CustomImplementationEnabled");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[CustomizationCtrlr_CustomImplementationEnabled]);
@@ -2351,7 +2371,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variable.instance, "GetReport");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variable.name, "ItemsPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage].variableAttribute[0].value, "10");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_ItemsPerMessage]);
@@ -2360,7 +2380,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variable.instance, "GetVariables");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variable.name, "ItemsPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage].variableAttribute[0].value, "10");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_ItemsPerMessage]);
@@ -2369,7 +2389,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variable.instance, "GetReport");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variable.name, "BytesPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage].variableAttribute[0].value, "2048");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetReport_BytesPerMessage]);
@@ -2378,7 +2398,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variable.instance, "GetVariables");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variable.name, "BytesPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage].variableAttribute[0].value, "2048");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_GetVariables_BytesPerMessage]);
@@ -2387,7 +2407,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variable.name, "ConfigurationValueSize");
 		ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variableCharacteristics.maxLimit = 1000;
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize].variableAttribute[0].value, "10");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ConfigurationValueSize]);
@@ -2396,7 +2416,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variable.name, "ReportingValueSize");
 		ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variableCharacteristics.maxLimit = 2500;
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize].variableAttribute[0].value, "10");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_ReportingValueSize]);
@@ -2405,7 +2425,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variable.instance, "SetVariables");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variable.name, "ItemsPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage].variableAttribute[0].value, "10");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_ItemsPerMessage]);
@@ -2414,7 +2434,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variable.instance, "SetVariables");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variable.name, "BytesPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage].variableAttribute[0].value, "2048");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DeviceDataCtrlr_SetVariables_BytesPerMessage]);
@@ -2423,7 +2443,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].component.name, "DisplayMessageCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].variable.name, "Enabled");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Enabled]);
@@ -2431,7 +2451,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].component.name, "DisplayMessageCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].variable.name, "Available");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_Available]);
@@ -2440,7 +2460,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variable.name, "DisplayMessages");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
 		ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableCharacteristics.maxLimit = 1;
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].value, "%s", "1");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages]);
@@ -2448,7 +2468,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].component.name, "DisplayMessageCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].variable.name, "SupportedFormats");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].variableAttribute[0].value, " ");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats]);
@@ -2456,7 +2476,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].component.name, "DisplayMessageCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].variable.name, "SupportedPriorities");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities].variableAttribute[0].value, " ");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedPriorities]);
@@ -2465,7 +2485,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].component.name, "EVSE");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].variable.name, "Available");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Available].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[EVSE_Available]);
@@ -2473,7 +2493,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].component.name, "EVSE");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].variable.name, "AvailabilityState");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_OptionList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState].variableAttribute[0].value, "Available,Occupied,Reserved,Unavailable,Faulted");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[EVSE_AvailabilityState]);
@@ -2481,7 +2501,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].component.name, "EVSE");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].variable.name, "SupplyPhases");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases].variableAttribute[0].value, "3");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[EVSE_SupplyPhases]);
@@ -2489,7 +2509,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].component.name, "EVSE");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].variable.name, "Power");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_decimal]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[EVSE_Power].variableAttribute[0].value, "7700");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[EVSE_Power]);
@@ -2533,7 +2553,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variable.name, "BytesPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variable.instance, "SendLocalList");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage].variableAttribute[0].value, "20480");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_BytesPerMessage]);
@@ -2542,7 +2562,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variable.name, "Storage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
 		ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableCharacteristics.maxLimit = (1024*10);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].value, "100000");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage]);
@@ -2551,7 +2571,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].component.name, "MonitoringCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].variable.instance, "Enabled");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Enabled]);
@@ -2559,7 +2579,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].component.name, "MonitoringCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].variable.instance, "Available");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_Available]);
@@ -2568,7 +2588,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variable.instance, "ClearVariableMonitoring");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variable.name, "ItemsPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage].variableAttribute[0].value, "1");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_ItemsPerMessage]);
@@ -2577,7 +2597,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variable.instance, "SetVariableMonitoring");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variable.name, "ItemsPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage].variableAttribute[0].value, "1");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_ItemsPerMessage]);
@@ -2586,7 +2606,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variable.instance, "ClearVariableMonitoring");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variable.name, "BytesPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage].variableAttribute[0].value, "2048");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_ClearVariableMonitoring_BytesPerMessage]);
@@ -2595,7 +2615,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variable.instance, "SetVariableMonitoring");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variable.name, "BytesPerMessage");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage].variableAttribute[0].value, "2048");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_SetVariableMonitoring_BytesPerMessage]);
@@ -2603,7 +2623,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].component.name, "MonitoringCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].variable.name, "OfflineQueuingSeverity");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity].variableAttribute[0].value, "2048");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[MonitoringCtrlr_OfflineQueuingSeverity]);
@@ -2612,7 +2632,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].variable.name, "ActiveNetworkProfile");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile].variableAttribute[0].value, "1");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ActiveNetworkProfile]);
@@ -2622,7 +2642,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variable.name, "MessageTimeout");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variableCharacteristics.unit, "Seconds");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout].variableAttribute[0].value, "30");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageTimeout]);
@@ -2630,7 +2650,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].variable.name, "FileTransferProtocols");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols].variableAttribute[0].value, "FTP,FTPS,HTTP,HTTPS");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_FileTransferProtocols]);
@@ -2640,7 +2660,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableCharacteristics.unit, "Seconds");
 		ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableCharacteristics.minLimit = 10;
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval].variableAttribute[0].value, "30");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_HeartbeatInterval]);
@@ -2648,7 +2668,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].variable.name, "NetworkConfigurationPriority");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_SequenceList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority].variableAttribute[0].value, "[0]");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkConfigurationPriority]);
@@ -2656,7 +2676,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].variable.name, "NetworkProfileConnectionAttempts");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts].variableAttribute[0].value, "3");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_NetworkProfileConnectionAttempts]);
@@ -2673,7 +2693,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].variable.name, "QueueAllMessages");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_QueueAllMessages]);
@@ -2683,7 +2703,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variable.name, "MessageAttempts");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variableCharacteristics.unit, "Seconds");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts].variableAttribute[0].value, "3");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttempts]);
@@ -2693,7 +2713,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variable.name, "MessageAttemptInterval");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variableCharacteristics.unit, "Seconds");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval].variableAttribute[0].value, "30");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_MessageAttemptInterval]);
@@ -2701,7 +2721,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].variable.name, "UnlockOnEVSideDisconnect");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect].variableAttribute[0].value, "true");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_UnlockOnEVSideDisconnect]);
@@ -2711,7 +2731,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableCharacteristics.unit, "Seconds");
 		ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableCharacteristics.minLimit = 10;
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval].variableAttribute[0].value, "30");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_WebSocketPingInterval]);
@@ -2719,7 +2739,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].variable.name, "ResetRetries");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries].variableAttribute[0].value, "3");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_ResetRetries]);
@@ -2727,7 +2747,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].variable.name, "PublicKeyWithSignedMeterValue");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_OptionList]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue].variableAttribute[0].value, "Never,OncePerTransaction,EveryMeterValue");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_PublicKeyWithSignedMeterValue]);
@@ -2735,7 +2755,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].variable.name, "VariableVersion");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion].variableAttribute[0].value, "%d", variableVersion);
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_VariableVersion]);
@@ -2743,7 +2763,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].variable.name, "StatusNotificationPeriodically");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_boolean]);
-		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically].variableAttribute[0].value, "false");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_StatusNotificationPeriodically]);
@@ -2768,6 +2788,25 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variableAttribute[0].value, "30");
 		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval]);
 
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].component.name, "OCPPCommCtrlr");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].variable.name, "RfidEndianType");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].variableAttribute[0].value, ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian==1?"big":"little");
+		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType]);
+
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].component.name, "OCPPCommCtrlr");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variable.name, "AuthorizeTimeout");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableCharacteristics.unit, "Seconds");
+		ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableCharacteristics.minLimit = 10;
+		ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableCharacteristics.maxLimit = 300;
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Actual]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variableAttribute[0].value, "15");
+		DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout]);
+
 		/* ReservationCtrlr Required item */
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
@@ -3469,6 +3508,12 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].component.name, "OCPPCommCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_CharingProfileRefreshInterval].variable.name, "CharingProfileRefreshInterval");
 
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].component.name, "OCPPCommCtrlr");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_RfidEndianType].variable.name, "RfidEndianType");
+
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].component.name, "OCPPCommCtrlr");
+		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[OCPPCommCtrlr_AuthorizeTimeout].variable.name, "AuthorizeTimeout");
+
 		/* ReservationCtrlr Required item */
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].component.name, "ReservationCtrlr");
 		sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[ReservationCtrlr_Enabled].variable.name, "Enabled");
@@ -9735,6 +9780,8 @@ int sendMeterValuesRequest(int gun_index, ReadingContextEnumType dataType, uint8
 			json_object_object_add(MeterValueBuffer, "sampledValue", sampledValuesBuffer);
 			if(meterValueBufferDataQuantity(gun_index, dataType) < 200)
 				meterValueBufferInsert(gun_index, dataType, (char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.transactionId, (char*)json_object_to_json_string_ext(MeterValueBuffer, JSON_C_TO_STRING_PLAIN));
+			else
+				meterValueBufferReplace(200, gun_index, dataType, (char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.transactionId, (char*)json_object_to_json_string_ext(MeterValueBuffer, JSON_C_TO_STRING_PLAIN));
 			json_object_put(MeterValueBuffer);
 		}
 		else
@@ -11049,7 +11096,6 @@ int sendTransactionEventRequest(int gun_index)
 					ShmOCPP20Data->TransactionEvent[gun_index].seqNo = 0;
 
 				ShmOCPP20Data->TransactionEvent[gun_index].offline = (!ShmOCPP20Data->OcppConnStatus?TRUE:FALSE);
-
 				ShmOCPP20Data->TransactionEvent[gun_index].evse.id = (gun_index + 1);
 				ShmOCPP20Data->TransactionEvent[gun_index].evse.connectorId = 1;
 
@@ -12248,7 +12294,7 @@ int sendGetReportConfirmation(char *uuid)
 	return result;
 }
 
-int sendGetTransactionStatusConfirmation(char *uuid, unsigned char gun_index)
+int sendGetTransactionStatusConfirmation(char *uuid)
 {
 	mtrace();
 	int result = FAIL;
@@ -12257,8 +12303,8 @@ int sendGetTransactionStatusConfirmation(char *uuid, unsigned char gun_index)
 
 	DEBUG_INFO("sendGetTransactionStatusConfirmation...\n");
 
-	json_object_object_add(GetTransactionStatus, "ongoingIndicator", json_object_new_boolean(ShmOCPP20Data->GetTransactionStatus[gun_index].Response_ongoingIndicator));
-	json_object_object_add(GetTransactionStatus, "messagesInQueue", json_object_new_boolean(ShmOCPP20Data->GetTransactionStatus[gun_index].Response_messagesInQueue));
+	json_object_object_add(GetTransactionStatus, "ongoingIndicator", json_object_new_boolean(ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator));
+	json_object_object_add(GetTransactionStatus, "messagesInQueue", json_object_new_boolean(ShmOCPP20Data->GetTransactionStatus.Response_messagesInQueue));
 
 	sprintf(message,"[%d,\"%s\",%s]"
 								,MESSAGE_TYPE_CALLRESULT
@@ -16060,32 +16106,153 @@ int handleGetTransactionStatusRequest(char *uuid, char *payload)
 {
 	mtrace();
 	int result = FAIL;
-	int8_t	gun_index = -1;
+	uint8_t tempIndex;
 	json_object *GetTransactionStatus;
 
 	DEBUG_INFO("handleGetTransactionStatusRequest...\n");
 	GetTransactionStatus = json_tokener_parse(payload);
 	if(!is_error(GetTransactionStatus))
 	{
+		memset(&ShmOCPP20Data->GetTransactionStatus, 0, sizeof(struct GetTransactionStatus_20));
+		memcpy(&ShmOCPP20Data->GetTransactionStatus.guid, uuid, ARRAY_SIZE(ShmOCPP20Data->GetTransactionStatus.guid));
+		ShmOCPP20Data->GetTransactionStatus.Response_messagesInQueue = FALSE;
+		ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator = FALSE;
 
-		/*
-		 * TODO:
-		 * 	1. Check transaction locate which connector
-		 */
-
-		memset(&ShmOCPP20Data->GetTransactionStatus[gun_index], 0, sizeof(struct GetTransactionStatus_20));
-		memcpy(&ShmOCPP20Data->GetTransactionStatus[gun_index].guid, uuid, ARRAY_SIZE(ShmOCPP20Data->GetTransactionStatus[gun_index].guid));
 		if(json_object_object_get(GetTransactionStatus, "transactionId") != NULL)
 		{
-			sprintf((char*)ShmOCPP20Data->GetTransactionStatus[gun_index].transactionId, "%s", json_object_get_string(json_object_object_get(GetTransactionStatus, "transactionId")));
+			sprintf((char*)ShmOCPP20Data->GetTransactionStatus.transactionId, "%s", json_object_get_string(json_object_object_get(GetTransactionStatus, "transactionId")));
+		}
+
+		if(strlen((char*)ShmOCPP20Data->GetTransactionStatus.transactionId)>0)
+		{
+			for(int gun_index=0;gun_index < gunTotalNumber;gun_index++)
+			{
+				if(strcmp((char*)ShmOCPP20Data->GetTransactionStatus.transactionId, (char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.transactionId)==0)
+				{
+					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++)
+						{
+							if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex) &&
+							   ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_TERMINATING)))
+								ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator = TRUE;
+						}
+
+					}
+					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++)
+						{
+							if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex) &&
+							   ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_TERMINATING)))
+								ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator = TRUE;
+						}
+					}
+					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++)
+						{
+							if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex) &&
+							   ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_TERMINATING)))
+								ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator = TRUE;
+						}
+					}
+					else if(gunType[gun_index] == GUN_TYPE_DO)
+					{
+						tempIndex = gun_index;
+
+						for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
+						{
+							if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex) &&
+							   ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_TERMINATING)))
+								ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator = TRUE;
+						}
+					}
+					else
+					{
+						if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
+							tempIndex = 2;
+						else
+							tempIndex = gun_index;
+
+						for (int index = 0; index < AC_QUANTITY; index++)
+						{
+							if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex) &&
+							   ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_TERMINATING)))
+								ShmOCPP20Data->GetTransactionStatus.Response_ongoingIndicator = TRUE;
+						}
+					}
+				}
+			}
 		}
 
-		ShmOCPP20Data->GetTransactionStatus[gun_index].Response_messagesInQueue = FALSE;
-		ShmOCPP20Data->GetTransactionStatus[gun_index].Response_ongoingIndicator = FALSE;
+		char rmFileCmd[100]={0};
+		int TransactionQueueNum = 0;
+		struct stat stats;
+		stat("/Storage/OCPP", &stats);
+
+		// Check for directory existence
+		if (S_ISDIR(stats.st_mode) == 1)
+		{
+			//DEBUG_INFO("\n OCPP directory exist \n");
+		}
+		else
+		{
+			//DEBUG_INFO("\n OCPP directory not exist, create dir \n");
+			sprintf(rmFileCmd,"mkdir -p %s","/Storage/OCPP");
+			system(rmFileCmd);
+		}
+
+		memset(rmFileCmd, 0, ARRAY_SIZE(rmFileCmd));
+
+		if((access("/Storage/OCPP/TransactionRelatedQueue20",F_OK))!=-1)
+		{
+			//DEBUG_INFO("TransactionRelatedQueue exist.\n");
+		}
+		else
+		{
+			FILE *fp = fopen("/Storage/OCPP/TransactionRelatedQueue20", "r");
+			char line[QUEUE_MESSAGE_LENGTH]={0};
+
+			if (fp == NULL) {
+				DEBUG_INFO("cannot open file TransactionRelatedQueue!");
+			}
+
+			TransactionQueueNum = 0;  // the number of packets in queue
+
+			while(fgets(line, sizeof line, fp) != NULL) {
+				if(strlen((char*)ShmOCPP20Data->GetTransactionStatus.transactionId)>0)
+				{
+					if(strstr(line, (char*)ShmOCPP20Data->GetTransactionStatus.transactionId) != NULL)
+						ShmOCPP20Data->GetTransactionStatus.Response_messagesInQueue = TRUE;
+				}
+
+				TransactionQueueNum += 1; //the number of packets in queue
+			}
+			fclose(fp);
+		}
+
+		if((strlen((char*)ShmOCPP20Data->GetTransactionStatus.transactionId) == 0) && (TransactionQueueNum>0))
+			ShmOCPP20Data->GetTransactionStatus.Response_messagesInQueue = TRUE;
 	}
 	json_object_put(GetTransactionStatus);
 
-	sendGetTransactionStatusConfirmation(uuid, gun_index);
+	sendGetTransactionStatusConfirmation(uuid);
 
 	return result;
 }
@@ -19229,7 +19396,7 @@ int handleSetVariablesRequest(char *uuid, char *payload)
 								char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
 
 								for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
-									tmp[idx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
+									tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
 								if((strstr((char*)tmp, "true") != NULL) || (strstr((char*)tmp, "false") != NULL))
 								{
 									strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "true") != NULL)? "true" : "false");
@@ -19243,7 +19410,7 @@ int handleSetVariablesRequest(char *uuid, char *payload)
 									{
 										ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AUTH_MODE_DISABLE;
 									}
-									StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
+									//StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
 								}
 								else
 								{
@@ -19283,7 +19450,7 @@ int handleSetVariablesRequest(char *uuid, char *payload)
 								char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
 
 								for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
-									tmp[idx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
+									tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
 								if((strstr((char*)tmp, "true") != NULL) || (strstr((char*)tmp, "false") != NULL))
 								{
 									strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "true") != NULL)? "true" : "false");
@@ -19314,11 +19481,64 @@ 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, "MessageAttempts") != 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
+								{
+									TransactionMessageAttemptsValue = atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue);
+									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, "MessageAttemptInterval") != 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
+								{
+									TransactionMessageRetryIntervalValue = atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue);
+									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, "RfidEndianType") != NULL))
+							{
+								char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
+								for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
+									tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
+								if((strstr((char*)tmp, "big") != NULL) || (strstr((char*)tmp, "little") != NULL))
+								{
+									strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "big") != NULL)? "big" : "little");
+									ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = (strstr((char*)tmp, "big") != NULL)?1:0;
+									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
+								}
+								else
+								{
+									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Rejected]);
+									break;
+								}
+							}
+
+							if((strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].component.name, "OCPPCommCtrlr") != NULL) && (strstr((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].variable.name, "AuthorizeTimeout") != NULL))
+							{
+								if((atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue) <=0) ||
+								   (atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue) < (int)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.minLimit) ||
+								   (atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue) > (int)ShmOCPP20Data->ControllerComponentVariable[idx_var].variableCharacteristics.maxLimit))
+									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_OutOfRange]);
+								else
+								{
+									TransactionMessageRetryIntervalValue = atoi((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue);
+									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)))
 							{
 								isNeedReconnect = TRUE;
-								StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
+								//StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
 								//SetOcppConnStatus(FALSE);
 							}
 
@@ -19347,13 +19567,13 @@ int handleSetVariablesRequest(char *uuid, char *payload)
 								char tmp[ARRAY_SIZE(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue)];
 
 								for(int tmpidx=0;tmpidx<ARRAY_SIZE(tmp);tmpidx++)
-									tmp[idx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
+									tmp[tmpidx] = tolower(ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue[tmpidx]);
 
 								if((strstr((char*)tmp, "true") != NULL) || (strstr((char*)tmp, "false") != NULL))
 								{
 									strcpy((char*)ShmOCPP20Data->SetVariables.setVariableData[idx].attributeValue,(strstr((char*)tmp, "true") != NULL)? "true" : "false");
 									ShmSysConfigAndInfo->SysConfig.AuthorisationMode =((strstr((char*)tmp, "true") != NULL)? 1 : 0);
-									StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
+									//StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
 									strcpy((char*)ShmOCPP20Data->SetVariables.Response_setVariableResult[idx].attributeStatus, SetVariableStatusEnumTypeStr[SetVariableStatusEnumType_Accepted]);
 								}
 							}
@@ -19406,6 +19626,7 @@ int handleSetVariablesRequest(char *uuid, char *payload)
 			}
 		}
 
+		StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
 		sendSetVariableConfirmation(uuid, json_object_array_length(json_object_object_get(SetVariables, "setVariableData")));
 
 		if(isNeedReconnect)

+ 1 - 1
EVSE/Modularization/ocpp20/MessageHandler.h

@@ -909,7 +909,7 @@ int sendGetLocalListVersionConfirmation(char *uuid);
 int sendGetLogConfirmation(char *uuid);
 int sendGetMonitoringReportConfirmation(char *uuid);
 int sendGetReportConfirmation(char *uuid);
-int sendGetTransactionStatusConfirmation(char *uuid, unsigned char gun_index);
+int sendGetTransactionStatusConfirmation(char *uuid);
 int sendGetVariablesConfirmation(char *uuid, unsigned char variableQuantity);
 int sendInstallCertificateConfirmation(char *uuid);
 int sendPublishFirmwareConfirmation(char *uuid);

+ 27 - 16
EVSE/Projects/AW-CCS/Apps/Module_FactoryConfig.c

@@ -374,22 +374,33 @@ int main(int argc, char *argv[])
 		}
 		else if(SysConfig.ModelName[12] == 'T')
 		{
-			// TOG customization configuration
-			SysConfig.AuthorisationMode = 0;				// 0: enable, 1: disable
-			SysConfig.RfidCardNumEndian = 1;				// 0: Little endian	1: Big endian
-			SysConfig.QRCodeMadeMode = 1;					// for isQRCode=1 ; 0: default	1:customized
-			strcpy((char*)SysConfig.QRCodeContent, "NA");	// for QRCodeMadeMode=1
-
-			SysConfig.AthInterface.WifiMode = 1;		// 0: Disable 1: Infrastructure client 2: Infrastructure server	3: Ad-Hoc
-			strcpy((char*)SysConfig.AthInterface.WifiSsid, "ChargeLab-EVC");
-			strcpy((char*)SysConfig.AthInterface.WifiPassword, "evc-pwd-default-21");
-
-			strcpy((char*)SysConfig.TelecomInterface.TelcomApn, "m2minternet.apn");
-
-			strcpy((char*)SysConfig.OcppServerURL, "wss://ocpp.io");
-			sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
-			strcpy((char*)SysConfig.chargePointVendor, "ChargeLab");
-			SysConfig.OfflinePolicy = 0;			// 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
+			if(SysConfig.ModelName[13] == 'C')
+			{
+				// AXSC111001W1TC Taiwan Cement configuration
+				strcpy((char*)SysConfig.OcppServerURL, "");					// default: Null
+				sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
+				strcpy((char *)SysConfig.chargePointVendor, "");			// default: Null
+				strcpy((char*)SysConfig.MaintainServerURL, "");				// default: Null
+			}
+			else
+			{
+				// TOG customization configuration
+				SysConfig.AuthorisationMode = 0;				// 0: enable, 1: disable
+				SysConfig.RfidCardNumEndian = 1;				// 0: Little endian	1: Big endian
+				SysConfig.QRCodeMadeMode = 1;					// for isQRCode=1 ; 0: default	1:customized
+				strcpy((char*)SysConfig.QRCodeContent, "NA");	// for QRCodeMadeMode=1
+
+				SysConfig.AthInterface.WifiMode = 1;		// 0: Disable 1: Infrastructure client 2: Infrastructure server	3: Ad-Hoc
+				strcpy((char*)SysConfig.AthInterface.WifiSsid, "ChargeLab-EVC");
+				strcpy((char*)SysConfig.AthInterface.WifiPassword, "evc-pwd-default-21");
+
+				strcpy((char*)SysConfig.TelecomInterface.TelcomApn, "m2minternet.apn");
+
+				strcpy((char*)SysConfig.OcppServerURL, "wss://ocpp.io");
+				sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
+				strcpy((char*)SysConfig.chargePointVendor, "ChargeLab");
+				SysConfig.OfflinePolicy = 0;			// 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
+			}
 		}
 		else if(SysConfig.ModelName[12] == 'Z')
 		{

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 197 - 241
EVSE/Projects/AW-Regular/Apps/main.c


+ 5 - 3
EVSE/Projects/define.h

@@ -5013,10 +5013,12 @@ enum OCPP20CtrlrVariable
 	OCPPCommCtrlr_WebSocketPingInterval,
 	OCPPCommCtrlr_ResetRetries,
 	OCPPCommCtrlr_PublicKeyWithSignedMeterValue,
-    OCPPCommCtrlr_StatusNotificationPeriodically,
+    OCPPCommCtrlr_VariableVersion,
+	OCPPCommCtrlr_StatusNotificationPeriodically,
     OCPPCommCtrlr_StatusNotificationInterval,
 	OCPPCommCtrlr_CharingProfileRefreshInterval,
-    OCPPCommCtrlr_VariableVersion,
+    OCPPCommCtrlr_RfidEndianType,
+	OCPPCommCtrlr_AuthorizeTimeout,
 	ReservationCtrlr_Enabled,
 	ReservationCtrlr_Available,
 	ReservationCtrlr_NonEvseSpecific,
@@ -6591,7 +6593,7 @@ struct OCPP20Data
 	struct GetLog_20							GetLog;
 	struct GetMonitoringReport_20				GetMonitoringReport;
 	struct GetReport_20							GetReport;
-	struct GetTransactionStatus_20				GetTransactionStatus[CONNECTOR_QUANTITY];
+	struct GetTransactionStatus_20				GetTransactionStatus;
 	struct GetVariables_20						GetVariables;
 	struct Heartbeat_20							Heartbeat;
 	struct InstallCertificate_20				InstallCertificate;

+ 64 - 0
EVSE/rootfs/var/www/set_backend.php

@@ -258,6 +258,38 @@ CORE STYLES ABOVE - NO TOUCHY
 											<label><?php echo $lang->showWord("ocpp_security_password"); ?></label>
 											<input type="text" name="OcppSecurityPassword" id="OcppSecurityPassword" class="form-control" value="<?php echo htmlspecialchars($obj->{'OcppSecurityPassword'});?>">
 										</div>
+										<div id="TLSwithClientSideCertificatesDiv" class="form-group file-upload" style="display:<?php echo $am101;?>">
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("private_key_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'ChargePointPrivateKey'})>0?$obj->{'ChargePointPrivateKey'}:'File not found'?>)</font></label>
+												<div class="file-loading">
+													<input name="private_key" id="private_key" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".key">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("certificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'ChargePointCertificate'})>0?$obj->{'ChargePointCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="certificate" id="certificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("MORootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'MORootCertificate'})>0?$obj->{'MORootCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="MORootCertificate" id="MORootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("CSRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'CSRootCertificate'})>0?$obj->{'CSRootCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="CSRootCertificate" id="CSRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("ManufacturerRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'ManufacturerRootCertificate'})>0?$obj->{'ManufacturerRootCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="ManufacturerRootCertificate" id="ManufacturerRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+										</div>
 <?php if(substr($ModelName,0,2)=="AX" || substr($ModelName,0,2)=="AW" || substr($ModelName,0,1)=="D"){?>
 										<div class="form-group" style="display:block">
 											<label><?php echo $lang->showWord("ocpp_receipt_url"); ?></label>
@@ -391,6 +423,31 @@ CORE STYLES ABOVE - NO TOUCHY
 
 			// POST 參數須使用 send() 發送
 			var formData = new FormData();
+			if(document.getElementById("private_key").value != ""){
+				var fileInput = document.getElementById('private_key');
+				var file = fileInput.files[0];
+				formData.append("private_key", file);
+			}
+			if(document.getElementById("certificate").value != ""){
+				var fileInput = document.getElementById('certificate');
+				var file = fileInput.files[0];
+				formData.append("certificate", file);
+			}
+			if(document.getElementById("MORootCertificate").value != ""){
+				var fileInput = document.getElementById('MORootCertificate');
+				var file = fileInput.files[0];
+				formData.append("MORootCertificate", file);
+			}
+			if(document.getElementById("CSRootCertificate").value != ""){
+				var fileInput = document.getElementById('CSRootCertificate');
+				var file = fileInput.files[0];
+				formData.append("CSRootCertificate", file);
+			}
+			if(document.getElementById("ManufacturerRootCertificate").value != ""){
+				var fileInput = document.getElementById('ManufacturerRootCertificate');
+				var file = fileInput.files[0];
+				formData.append("ManufacturerRootCertificate", file);
+			}
 			formData.append("BackendConnTimeout", document.getElementById("BackendConnTimeout").value);
 			formData.append("OfflinePolicy", document.getElementById("OfflinePolicy").value);
 			formData.append("OfflineMaxChargeEnergy", document.getElementById("OfflineMaxChargeEnergy").value);
@@ -532,9 +589,16 @@ CORE STYLES ABOVE - NO TOUCHY
 	function OcppSecurityProfile_changed(){
 		if(document.getElementById("OcppSecurityProfile").value == "1" || document.getElementById("OcppSecurityProfile").value == "2" || document.getElementById("OcppSecurityProfile").value == "3"){
 			document.getElementById("OcppSecurityPasswordDiv").style.display="block";
+			if(document.getElementById("OcppSecurityProfile").value == "3"){
+				document.getElementById("TLSwithClientSideCertificatesDiv").style.display="block";
+			}
+			else{
+				document.getElementById("TLSwithClientSideCertificatesDiv").style.display="none";
+			}
 		}
 		else{
 			document.getElementById("OcppSecurityPasswordDiv").style.display="none";
+			document.getElementById("TLSwithClientSideCertificatesDiv").style.display="none";
 		}
 	}
 	function MaintainServerSecurityProfile_changed(){

+ 90 - 0
EVSE/rootfs/var/www/set_backend_action.php

@@ -116,6 +116,96 @@
 			checkLength("evseStation",15);
 			$json['evseStation']				= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['evseStation'])))));
 		}
+		$fCount = empty($_FILES['private_key']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["private_key"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["private_key"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl rsa -noout -modulus -in '.$_FILES['private_key']['tmp_name']),"Modulus")===false){	//unable to load Private Key
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of Private Key is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["private_key"]["tmp_name"],"/Storage/OCPP/certCP.key");
+		}
+		$fCount = empty($_FILES['certificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["certificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["certificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['certificate']['tmp_name']),"Modulus")===false){	//unable to load certificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["certificate"]["tmp_name"],"/Storage/OCPP/certCP.pem");
+		}
+		$fCount = empty($_FILES['MORootCertificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["MORootCertificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["MORootCertificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['MORootCertificate']['tmp_name']),"Modulus")===false){	//unable to load MORootCertificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of MO Root Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["MORootCertificate"]["tmp_name"],"/Storage/rootCaMo.pem");
+		}
+		$fCount = empty($_FILES['CSRootCertificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["CSRootCertificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["CSRootCertificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['CSRootCertificate']['tmp_name']),"Modulus")===false){	//unable to load CSRootCertificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of CS Root Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["CSRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaCs.pem");
+		}
+		$fCount = empty($_FILES['ManufacturerRootCertificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["ManufacturerRootCertificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["ManufacturerRootCertificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['ManufacturerRootCertificate']['tmp_name']),"Modulus")===false){	//unable to load ManufacturerRootCertificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of Manufacturer Root Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["ManufacturerRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaMf.pem");
+		}
 //		ob_start();
 		
 		shell_exec('sync;sync;sync');

+ 0 - 55
EVSE/rootfs/var/www/set_charging.php

@@ -2088,18 +2088,6 @@ CORE STYLES ABOVE - NO TOUCHY
 									<header>V2G Certificate<i class="fa fa-plus"></i></header>
 									<section>
 										<div id="TLSwithClientSideCertificatesDiv" class="form-group file-upload">
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("private_key_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['ChargePointPrivateKey'])>0?$obj['ChargePointPrivateKey']:'File not found'?>)</font></label>
-												<div class="file-loading">
-													<input name="private_key" id="private_key" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".key">
-												</div>
-											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("certificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['ChargePointCertificate'])>0?$obj['ChargePointCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="certificate" id="certificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
 											<div class="file-upload">
 												<label><?php echo $lang->showWord("V2GPrivateKey_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['V2GPrivateKey'])>0?$obj['V2GPrivateKey']:'File not found'?>)</font></label>
 												<div class="file-loading">
@@ -2118,24 +2106,6 @@ CORE STYLES ABOVE - NO TOUCHY
 													<input name="V2GCertificateChain" id="V2GCertificateChain" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
 												</div>
 											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("MORootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['MORootCertificate'])>0?$obj['MORootCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="MORootCertificate" id="MORootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("CSRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['CSRootCertificate'])>0?$obj['CSRootCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="CSRootCertificate" id="CSRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("ManufacturerRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['ManufacturerRootCertificate'])>0?$obj['ManufacturerRootCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="ManufacturerRootCertificate" id="ManufacturerRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
 										</div>
 									</section>
 								</article>
@@ -2289,16 +2259,6 @@ CORE STYLES ABOVE - NO TOUCHY
 
 			// POST 參數須使用 send() 發送
 			var formData = new FormData();
-			if(document.getElementById("private_key").value != ""){
-				var fileInput = document.getElementById('private_key');
-				var file = fileInput.files[0];
-				formData.append("private_key", file);
-			}
-			if(document.getElementById("certificate").value != ""){
-				var fileInput = document.getElementById('certificate');
-				var file = fileInput.files[0];
-				formData.append("certificate", file);
-			}
 			if(document.getElementById("V2GPrivateKey").value != ""){
 				var fileInput = document.getElementById('V2GPrivateKey');
 				var file = fileInput.files[0];
@@ -2314,21 +2274,6 @@ CORE STYLES ABOVE - NO TOUCHY
 				var file = fileInput.files[0];
 				formData.append("V2GCertificateChain", file);
 			}
-			if(document.getElementById("MORootCertificate").value != ""){
-				var fileInput = document.getElementById('MORootCertificate');
-				var file = fileInput.files[0];
-				formData.append("MORootCertificate", file);
-			}
-			if(document.getElementById("CSRootCertificate").value != ""){
-				var fileInput = document.getElementById('CSRootCertificate');
-				var file = fileInput.files[0];
-				formData.append("CSRootCertificate", file);
-			}
-			if(document.getElementById("ManufacturerRootCertificate").value != ""){
-				var fileInput = document.getElementById('ManufacturerRootCertificate');
-				var file = fileInput.files[0];
-				formData.append("ManufacturerRootCertificate", file);
-			}
 			formData.append("MaxChargingEnergy", document.getElementById("MaxChargingEnergy").value);
 			formData.append("MaxChargingPower", document.getElementById("MaxChargingPower").value);
 			formData.append("MaxChargingCurrent", document.getElementById("MaxChargingCurrent").value);

+ 3 - 95
EVSE/rootfs/var/www/set_charging_action.php

@@ -175,44 +175,6 @@
 		if(isset($_POST['Fee23'])){
 			$json['Fee23']						= isset($_POST['Fee23'])?round($_POST['Fee23'], 2):"";
 		}
-		exec('openssl rsa -noout -modulus -in /var/www/private.key');
-		exec('openssl x509 -noout -modulus -in /var/www/cacert.pem');
-		$fCount = empty($_FILES['private_key']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["private_key"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["private_key"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl rsa -noout -modulus -in '.$_FILES['private_key']['name']),"Modulus")===false){	//unable to load Private Key
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of Private Key is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["private_key"]["tmp_name"],"/Storage/OCPP/certCP.key");
-		}
-		$fCount = empty($_FILES['certificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["certificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["certificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['certificate']['name']),"Modulus")===false){	//unable to load certificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["certificate"]["tmp_name"],"/Storage/OCPP/certCP.pem");
-		}
 		$fCount = empty($_FILES['V2GPrivateKey']['tmp_name'][0]);
 		if($fCount!=1){
 			if ($_FILES["V2GPrivateKey"]["error"] > 0)
@@ -222,7 +184,7 @@
 				echo json_encode($jsone);
 				exit;
 			}
-			else if(strpos(exec('openssl rsa -noout -modulus -in '.$_FILES['V2GPrivateKey']['name']),"Modulus")===false){	//unable to load V2GPrivateKey
+			else if(strpos(exec('openssl rsa -noout -modulus -in '.$_FILES['V2GPrivateKey']['tmp_name']),"Modulus")===false){	//unable to load V2GPrivateKey
 				$jsone['result'] = "Error";
 				$jsone['message'] = "format of V2G Private Key is incorrect";
 				echo json_encode($jsone);
@@ -240,7 +202,7 @@
 				echo json_encode($jsone);
 				exit;
 			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['V2GRootCertificate']['name']),"Modulus")===false){	//unable to load V2GRootCertificate
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['V2GRootCertificate']['tmp_name']),"Modulus")===false){	//unable to load V2GRootCertificate
 				$jsone['result'] = "Error";
 				$jsone['message'] = "format of V2G Root Certificate is incorrect";
 				echo json_encode($jsone);
@@ -258,7 +220,7 @@
 				echo json_encode($jsone);
 				exit;
 			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['V2GCertificateChain']['name']),"Modulus")===false){	//unable to load V2GCertificateChain
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['V2GCertificateChain']['tmp_name']),"Modulus")===false){	//unable to load V2GCertificateChain
 				$jsone['result'] = "Error";
 				$jsone['message'] = "format of V2G Certificate Chain is incorrect";
 				echo json_encode($jsone);
@@ -267,60 +229,6 @@
 			sleep(1);
 			move_uploaded_file($_FILES["V2GCertificateChain"]["tmp_name"],"/Storage/certV2g.pem");
 		}
-		$fCount = empty($_FILES['MORootCertificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["MORootCertificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["MORootCertificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['MORootCertificate']['name']),"Modulus")===false){	//unable to load MORootCertificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of MO Root Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["MORootCertificate"]["tmp_name"],"/Storage/rootCaMo.pem");
-		}
-		$fCount = empty($_FILES['CSRootCertificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["CSRootCertificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["CSRootCertificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['CSRootCertificate']['name']),"Modulus")===false){	//unable to load CSRootCertificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of CS Root Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["CSRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaCs.pem");
-		}
-		$fCount = empty($_FILES['ManufacturerRootCertificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["ManufacturerRootCertificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["ManufacturerRootCertificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['ManufacturerRootCertificate']['name']),"Modulus")===false){	//unable to load ManufacturerRootCertificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of Manufacturer Root Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["ManufacturerRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaMf.pem");
-		}
 //		ob_start();
 		
 		shell_exec('sync;sync;sync');

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio