浏览代码

[Add][Modularization][Module_OcppBackendPH / Webservice]

2021.11.26 / Folus Wen

Actions:
1. Maintain server security profile logic implement.

Files:
1. As follow commit history

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

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 年之前
父节点
当前提交
aefd8dc030

+ 35 - 19
EVSE/Modularization/WebService.c

@@ -493,7 +493,7 @@ int main(int argc, char *argv[]) {
 				ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
 			}
 			if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
-				QRCodeContent = json_object_get_string(val_obj);
+				QRCodeContent = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
 			}
 			if( json_object_object_get_ex(jobj, "Intensity", &val_obj) ) {
@@ -537,7 +537,7 @@ int main(int argc, char *argv[]) {
 				ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeMadeMode = DDQRCodeMadeMode1;
 			}
 			if( json_object_object_get_ex(jobj, "DDQRCodeContent1", &val_obj) ) {
-				DDQRCodeContent1 = json_object_get_string(val_obj);
+				DDQRCodeContent1 = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].QRCodeContent,DDQRCodeContent1);
 			}
 			if( json_object_object_get_ex(jobj, "DDIntensity1", &val_obj) ) {
@@ -577,7 +577,7 @@ int main(int argc, char *argv[]) {
 				ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeMadeMode = DDQRCodeMadeMode2;
 			}
 			if( json_object_object_get_ex(jobj, "DDQRCodeContent2", &val_obj) ) {
-				DDQRCodeContent2 = json_object_get_string(val_obj);
+				DDQRCodeContent2 = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[1].QRCodeContent,DDQRCodeContent2);
 			}
 			if( json_object_object_get_ex(jobj, "DDIntensity2", &val_obj) ) {
@@ -617,7 +617,7 @@ int main(int argc, char *argv[]) {
 				ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeMadeMode = DDQRCodeMadeMode3;
 			}
 			if( json_object_object_get_ex(jobj, "DDQRCodeContent3", &val_obj) ) {
-				DDQRCodeContent3 = json_object_get_string(val_obj);
+				DDQRCodeContent3 = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[2].QRCodeContent,DDQRCodeContent3);
 			}
 			if( json_object_object_get_ex(jobj, "DDIntensity3", &val_obj) ) {
@@ -657,7 +657,7 @@ int main(int argc, char *argv[]) {
 				ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeMadeMode = DDQRCodeMadeMode4;
 			}
 			if( json_object_object_get_ex(jobj, "DDQRCodeContent4", &val_obj) ) {
-				DDQRCodeContent4 = json_object_get_string(val_obj);
+				DDQRCodeContent4 = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[3].QRCodeContent,DDQRCodeContent4);
 			}
 			if( json_object_object_get_ex(jobj, "DDIntensity4", &val_obj) ) {
@@ -925,12 +925,12 @@ int main(int argc, char *argv[]) {
 			}
 			if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
 				WifiSsid = (char*)json_object_get_string(val_obj);
-				if (strcmp(WifiSsid, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
+				if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
 			}
 			if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
 				WifiPassword = (char*)json_object_get_string(val_obj);
-				if (strcmp(WifiSsid, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
+				if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
 			}
 			if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
@@ -945,37 +945,37 @@ int main(int argc, char *argv[]) {
 			}
 			if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
 				WifiIpAddress = (char*)json_object_get_string(val_obj);
-				if (strcmp(WifiIpAddress, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress) != 0) Wcnt++;
+				if (strcmp(WifiIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress) != 0) Wcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
 			}
 			if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
 				WifiSubmaskAddress = (char*)json_object_get_string(val_obj);
-				if (strcmp(WifiSubmaskAddress, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress) != 0) Wcnt++;
+				if (strcmp(WifiSubmaskAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress) != 0) Wcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
 			}
 			if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
 				WifiGatewayAddress = (char*)json_object_get_string(val_obj);
-				if (strcmp(WifiGatewayAddress, ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress) != 0) Wcnt++;
+				if (strcmp(WifiGatewayAddress, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress) != 0) Wcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
 			}
 			if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
 				TelcomApn = (char*)json_object_get_string(val_obj);
-				if (strcmp(TelcomApn, ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn) != 0) Tcnt++;
+				if (strcmp(TelcomApn, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn) != 0) Tcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
 			}
 			if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
 				TelcomChapPapId = (char*)json_object_get_string(val_obj);
-				if (strcmp(TelcomChapPapId, ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId) != 0) Tcnt++;
+				if (strcmp(TelcomChapPapId, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId) != 0) Tcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
 			}
 			if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
 				TelcomChapPapPwd = (char*)json_object_get_string(val_obj);
-				if (strcmp(TelcomChapPapPwd, ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd) != 0) Tcnt++;
+				if (strcmp(TelcomChapPapPwd, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd) != 0) Tcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
 			}
 			if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
 				TelcomIpAddress = (char*)json_object_get_string(val_obj);
-				if (strcmp(TelcomIpAddress, ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress) != 0) Tcnt++;
+				if (strcmp(TelcomIpAddress, (char*)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress) != 0) Tcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
 			}
 			if( json_object_object_get_ex(jobj, "TelcomEnabled", &val_obj) ) {
@@ -1001,7 +1001,9 @@ int main(int argc, char *argv[]) {
 			char *ChargeBoxId=NULL;
 			char *chargePointVendor=NULL;
 			int OcppSecurityProfile=0;
+			int MaintainServerSecurityProfile=0;
 			char *OcppSecurityPassword=NULL;
+			char *MaintainServerSecurityPassword=NULL;
 			int isEnableLocalPowerSharging=0;
 			char *OcppReceiptrURL=NULL;
 			char *MaintainServerURL=NULL;
@@ -1051,6 +1053,14 @@ int main(int argc, char *argv[]) {
 				OcppSecurityPassword = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword,OcppSecurityPassword);
 			}
+			if( json_object_object_get_ex(jobj, "MaintainServerSecurityProfile", &val_obj) ) {
+				MaintainServerSecurityProfile = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile = MaintainServerSecurityProfile;
+			}
+			if( json_object_object_get_ex(jobj, "MaintainServerSecurityPassword", &val_obj) ) {
+				MaintainServerSecurityPassword = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword,MaintainServerSecurityPassword);
+			}
 			if( json_object_object_get_ex(jobj, "isEnableLocalPowerSharging", &val_obj) ) {
 				isEnableLocalPowerSharging = json_object_get_int(val_obj);
 				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging = isEnableLocalPowerSharging;
@@ -1350,8 +1360,8 @@ int main(int argc, char *argv[]) {
 		char *Connector2[2];
 		char *Connector3[2];
 		char *Network[2];
-		unsigned char connector1FwVer[32];
-		unsigned char connector2FwVer[32];
+		//unsigned char connector1FwVer[32];
+		//unsigned char connector2FwVer[32];
 		short gunQty;
 		char *RatedPower1[2];
 		char *RatedPower2[2];
@@ -1406,9 +1416,9 @@ int main(int argc, char *argv[]) {
 		substr((char *)RatedPower1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,4,1);
 		substr((char *)RatedPower2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,5,1);
 		substr((char *)RatedPower3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,6,1);
-		int p1=atoi(RatedPower1);
-		int p2=atoi(RatedPower2);
-		int p3=atoi(RatedPower3);
+		int p1=atoi((char *)RatedPower1);
+		int p2=atoi((char *)RatedPower2);
+		int p3=atoi((char *)RatedPower3);
 		if(strcmp(IsAcDc, "D") == 0){
 			RatedPower=(p1*10+p2)*pow(10,p3-1);
 			if(RatedPower>=30){
@@ -1663,6 +1673,8 @@ int main(int argc, char *argv[]) {
 		struct json_object *chargePointVendor;
 		struct json_object *OcppSecurityProfile;
 		struct json_object *OcppSecurityPassword;
+		struct json_object *MaintainServerSecurityProfile;
+		struct json_object *MaintainServerSecurityPassword;
 		struct json_object *isEnableLocalPowerSharging;
 		struct json_object *OcppReceiptrURL;
 		struct json_object *MaintainServerURL;
@@ -2339,6 +2351,8 @@ int main(int argc, char *argv[]) {
 		ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
 		OcppSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile);
 		OcppSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword);
+		MaintainServerSecurityProfile = json_object_new_int(ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile);
+		MaintainServerSecurityPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword);
 		chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
 		MaintainServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL);
 		if(strcmp(IsDO, "AX") == 0){
@@ -2761,6 +2775,8 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
 		json_object_object_add(jobj4,"OcppSecurityProfile",OcppSecurityProfile);
 		json_object_object_add(jobj4,"OcppSecurityPassword",OcppSecurityPassword);
+		json_object_object_add(jobj4,"MaintainServerSecurityProfile",MaintainServerSecurityProfile);
+		json_object_object_add(jobj4,"MaintainServerSecurityPassword",MaintainServerSecurityPassword);
 		json_object_object_add(jobj4,"MaintainServerURL",MaintainServerURL);
 		if(strcmp(IsDO, "AX") == 0){
 			json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);

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

@@ -12513,10 +12513,10 @@ int handleResetRequest(char *uuid, char *payload)
 	sstr[c] = '\0';
 	strcpy(typestr,sstr);
 
-	sprintf((char *)ShmOCPP16DataPH->Reset.Type, "%s" ,typestr);
+	sprintf((char *)ShmOCPP16Data->Reset.Type, "%s" ,typestr);
 	if((strcmp(typestr, ResetTypeStr[Hard])==0) || (strcmp(typestr, ResetTypeStr[Soft])==0))
 	{
-		ShmOCPP16DataPH->MsMsg.bits.ResetReq = 1;
+		ShmOCPP16Data->MsMsg.bits.ResetReq = 1;
 	    strcpy((char *)ShmOCPP16DataPH->Reset.guid, uuid);
 	    strcpy(comfirmstr, ResetStatusStr[ResetStatus_Accepted]);
 	    sprintf((char *)ShmOCPP16DataPH->Reset.ResponseStatus, "%s" ,comfirmstr);
@@ -13907,7 +13907,7 @@ void *UpdateFirmwareProcess(void *data)
     }
 
 	// OCPPPH only, must announce CSU upgrade firmware
-	if(strstr((char*)ShmOCPP16DataPH->FirmwareStatusNotification.Status, FirmwareStatusStr[FirmwareStatus_Downloaded]) != NULL)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate = 1;
+	if(strstr((char*)ShmOCPP16DataPH->FirmwareStatusNotification.Status, FirmwareStatusStr[FirmwareStatus_Downloaded]) != NULL)ShmOCPP16Data->MsMsg.bits.UpdateFirmwareReq = 1;
 
 	interLock.isUpdateFirmwareGoing = 0;
 	pthread_exit(NULL);
@@ -14931,14 +14931,14 @@ int initialConfigurationTable(void)
 		// AuthorizationKey
 		ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemAccessibility = 1;
 		strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemName, "AuthorizationKey");
-		strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData, (char*)ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword );
+		strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData, (char*)ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword );
 
 		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","AuthorizationKey", "false", ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData);
 
 		// SecurityProfile
 		ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemAccessibility = 1;
 		strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemName, "SecurityProfile");
-		sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile );
+		sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile );
 
 		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SecurityProfile", "false", ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData);
 
@@ -15354,14 +15354,14 @@ int initialConfigurationTable(void)
 				{
 					ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
 					//sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData, "%s", valuestr);
-					sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData, "%s", ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword);
+					sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData, "%s", ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword);
 				}
 
 				if(strcmp(keystr, "SecurityProfile") == 0)
 				{
 					ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
 					//sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", atoi(valuestr) );
-					sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile );
+					sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile );
 				}
 
 				if(strcmp(keystr, "DefaultPrice") == 0)
@@ -17769,7 +17769,7 @@ int setKeyValue(char *key, char *value)
     	{
     		strcpy(str, (const char*)value);
     		sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData, "%s", str);
-    		strcpy((char*)ShmSysConfigAndInfo->SysConfig.OcppSecurityPassword, (char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData);
+    		strcpy((char*)ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityPassword, (char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[AuthorizationKey].ItemData);
     		isSuccess = ConfigurationStatus_Accepted;
     	}
     	else
@@ -17796,7 +17796,7 @@ int setKeyValue(char *key, char *value)
     			if(atoi((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData) <= (check_ascii - 0x30))
     			{
     				sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", atoi(value) );
-    				ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile = atoi(value);
+    				ShmSysConfigAndInfo->SysConfig.MaintainServerSecurityProfile = atoi(value);
     				isSuccess = ConfigurationStatus_Accepted;
     			}
     			else
@@ -18428,6 +18428,7 @@ int GetOcppConnStatus(void)
 
 void SetOcppConnStatus(uint8_t status)
 {
+	ShmOCPP16DataPH->OcppConnStatus = status;
 	ShmSysConfigAndInfo->SysInfo.MaintainServerConnStatus = status;
 }
 

+ 6 - 3
EVSE/Projects/define.h

@@ -551,9 +551,12 @@ struct SysConfigData
     /************PowerCabinet************/
     WiringInfoData          WiringInfo;
 
-    unsigned char           OcppReceiptrURL[512];       // Charging receipt display URL
-    unsigned char           isAuthrizeByEVCCID;         // is Authorize by EVCCID (CCS)
-    unsigned char 			MaintainServerURL[512];		//ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char			OcppReceiptrURL[512];       		// Charging receipt display URL
+    unsigned char			isAuthrizeByEVCCID;         		// is Authorize by EVCCID (CCS)
+    unsigned char			MaintainServerURL[512];				// ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"
+    unsigned char			MaintainServerSecurityProfile;      // Maintain server security profile 0~3
+    unsigned char			MaintainServerSecurityPassword[41]; // Maintain server AuthorizationKey for security profile
+
 };
 
 struct ChargingInfoData

+ 25 - 2
EVSE/rootfs/var/www/set_backend.php

@@ -251,7 +251,6 @@ CORE STYLES ABOVE - NO TOUCHY
 												<option value="0" <?php echo $obj->{'OcppSecurityProfile'}=="0"?"selected":""?>>None security</option>
 												<option value="1" <?php echo $obj->{'OcppSecurityProfile'}=="1"?"selected":""?>>Unsecured Transport with Basic Atuentication</option>
 												<option value="2" <?php echo $obj->{'OcppSecurityProfile'}=="2"?"selected":""?>>TLS with Basic Authentication</option>
-												<option value="3" <?php echo $obj->{'OcppSecurityProfile'}=="3"?"selected":""?>>TLS with Client Side Certificates</option>
 											</select>
 										</div>
 										<div id="OcppSecurityPasswordDiv" class="form-group" style="display:<?php echo $am101;?>">
@@ -280,6 +279,19 @@ CORE STYLES ABOVE - NO TOUCHY
 											<label>Maintain Server URL</label>
 											<input type="text" name="MaintainServerURL" id="MaintainServerURL" class="form-control" value="<?php echo $obj->{'MaintainServerURL'};?>">
 										</div>
+										
+										<div class="form-group" style="display:<?php echo $am101;?>">
+											<label>Maintain Server Security Profile</label>
+											<select class="form-control" id="MaintainServerSecurityProfile" name="MaintainServerSecurityProfile" onchange="MaintainServerSecurityProfile_changed()">
+												<option value="0" <?php echo $obj->{'MaintainServerSecurityProfile'}=="0"?"selected":""?>>None security</option>
+												<option value="1" <?php echo $obj->{'MaintainServerSecurityProfile'}=="1"?"selected":""?>>Unsecured Transport with Basic Atuentication</option>
+												<option value="2" <?php echo $obj->{'MaintainServerSecurityProfile'}=="2"?"selected":""?>>TLS with Basic Authentication</option>
+											</select>
+										</div>
+										<div id="MaintainServerSecurityPasswordDiv" class="form-group" style="display:<?php echo $am101;?>">
+											<label>Maintain Server Security Password</label>
+											<input type="text" name="MaintainServerSecurityPassword" id="MaintainServerSecurityPassword" class="form-control" value="<?php echo $obj->{'MaintainServerSecurityPassword'};?>">
+										</div>
 									</section>
 								</article>
 <?php if(substr($ModelName,0,1)=="D" && substr($ModelName,3,1)=="C"){ ?>
@@ -354,6 +366,7 @@ CORE STYLES ABOVE - NO TOUCHY
 	});
 <?php } ?>
 	OcppSecurityProfile_changed();
+	MaintainServerSecurityProfile_changed();
 	document.getElementById("save").onclick = function() {
 		if(formCheck())
 		{
@@ -374,7 +387,9 @@ CORE STYLES ABOVE - NO TOUCHY
 						"&ChargeBoxId=" + escape(document.getElementById("ChargeBoxId").value)+
 						"&chargePointVendor=" + escape(document.getElementById("chargePointVendor").value)+
 						"&OcppSecurityProfile=" + document.getElementById("OcppSecurityProfile").value+
-						"&OcppSecurityPassword=" + escape(document.getElementById("OcppSecurityPassword").value);
+						"&OcppSecurityPassword=" + escape(document.getElementById("OcppSecurityPassword").value)+
+						"&MaintainServerSecurityProfile=" + document.getElementById("MaintainServerSecurityProfile").value+
+						"&MaintainServerSecurityPassword=" + escape(document.getElementById("MaintainServerSecurityPassword").value);
 <?php if(substr($ModelName,0,2)=="AX"){?>
 				data += "&isEnableLocalPowerSharging=" + document.getElementById("isEnableLocalPowerSharging").value+
 						"&OcppReceiptrURL=" + document.getElementById("OcppReceiptrURL").value;
@@ -505,6 +520,14 @@ CORE STYLES ABOVE - NO TOUCHY
 			document.getElementById("OcppSecurityPasswordDiv").style.display="none";
 		}
 	}
+	function MaintainServerSecurityProfile_changed(){
+		if(document.getElementById("MaintainServerSecurityProfile").value == "1" || document.getElementById("MaintainServerSecurityProfile").value == "2"){
+			document.getElementById("MaintainServerSecurityPasswordDiv").style.display="block";
+		}
+		else{
+			document.getElementById("MaintainServerSecurityPasswordDiv").style.display="none";
+		}
+	}
 
 <?php if(substr($ModelName,0,2)=="AX"){?>
 	function isEnableLocalPowerSharging_changed(){

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

@@ -63,6 +63,13 @@
 		if(isset($_REQUEST['OcppSecurityPassword'])){
 			$json['OcppSecurityPassword']		= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['OcppSecurityPassword'])))));
 		}
+		if(isset($_REQUEST['MaintainServerSecurityProfile'])){
+			checkValue("MaintainServerSecurityProfile");
+			$json['MaintainServerSecurityProfile']		= (int)$_REQUEST['MaintainServerSecurityProfile'];
+		}
+		if(isset($_REQUEST['MaintainServerSecurityPassword'])){
+			$json['MaintainServerSecurityPassword']		= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['MaintainServerSecurityPassword'])))));
+		}
 		if(isset($_REQUEST['isEnableLocalPowerSharging'])){
 			checkValue("isEnableLocalPowerSharging");
 			$json['isEnableLocalPowerSharging']	= (int)$_REQUEST['isEnableLocalPowerSharging'];