Bläddra i källkod

2021-10-15 / ct_chen

Actions:
1. Webservice:  [Backend] Add receipt url configuration for "AX"; [System] Add isAutorizeByEVCCID for "DC"

Files:
1. EVSE/Modularization/WebService.c
   EVSE/rootfs/var/www/set_backend.php
   EVSE/rootfs/var/www/set_backend_action.php
   EVSE/rootfs/var/www/set_system.php
   EVSE/rootfs/var/www/set_system_action.php
ct_chen 3 år sedan
förälder
incheckning
bb8de80b3d

+ 16 - 0
EVSE/Modularization/WebService.c

@@ -400,6 +400,7 @@ int main(int argc, char *argv[]) {
 			char QRCodeMadeMode = 0;
 			char *QRCodeContent = NULL;
 			char Intensity = 0;
+			char isAuthrizeByEVCCID = 0;
 			char *DDSystemId1=NULL;
 			int DDFactoryConfiguration1 = 0;
 			int DDAuthorisationMode1 = 0;
@@ -499,6 +500,10 @@ int main(int argc, char *argv[]) {
 				Intensity = json_object_get_int(val_obj);
 				ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
 			}
+			if( json_object_object_get_ex(jobj, "isAuthrizeByEVCCID", &val_obj) ) {
+				isAuthrizeByEVCCID = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID = isAuthrizeByEVCCID;
+			}
 			if( json_object_object_get_ex(jobj, "DDSystemId1", &val_obj) ) {
 				DDSystemId1 = (char*)json_object_get_string(val_obj);
 				strcpy((char *)&ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[0].SystemId,DDSystemId1);
@@ -998,6 +1003,7 @@ int main(int argc, char *argv[]) {
 			int OcppSecurityProfile=0;
 			char *OcppSecurityPassword=NULL;
 			int isEnableLocalPowerSharging=0;
+			char *OcppReceiptrURL=NULL;
 			/*for TTIA*/
 			char isEnableTTIA=0;
 			char *server_addr=NULL;
@@ -1048,6 +1054,10 @@ int main(int argc, char *argv[]) {
 				isEnableLocalPowerSharging = json_object_get_int(val_obj);
 				ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging = isEnableLocalPowerSharging;
 			}
+			if( json_object_object_get_ex(jobj, "OcppReceiptrURL", &val_obj) ) {
+				OcppReceiptrURL = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL,OcppReceiptrURL);
+			}
 			/*for TTIA*/
 			if( json_object_object_get_ex(jobj, "isEnableTTIA", &val_obj) ) {
 				isEnableTTIA = json_object_get_int(val_obj);
@@ -1431,6 +1441,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *QRCodeMadeMode;
 		struct json_object *QRCodeContent;
 		struct json_object *Intensity;
+		struct json_object *isAuthrizeByEVCCID;
 		struct json_object *AuxPower5V;
 		struct json_object *AuxPower12V;
 		struct json_object *AuxPower24V;
@@ -1645,6 +1656,7 @@ int main(int argc, char *argv[]) {
 		struct json_object *OcppSecurityProfile;
 		struct json_object *OcppSecurityPassword;
 		struct json_object *isEnableLocalPowerSharging;
+		struct json_object *OcppReceiptrURL;
 		/*for TTIA*/
 		struct json_object *isEnableTTIA;
 		struct json_object *server_addr;
@@ -1684,6 +1696,7 @@ int main(int argc, char *argv[]) {
 		QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
 		QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
 		Intensity = json_object_new_int(ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity);
+		isAuthrizeByEVCCID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAuthrizeByEVCCID);
 		AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
 		AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
 		AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
@@ -2318,6 +2331,7 @@ int main(int argc, char *argv[]) {
 		chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
 		if(strcmp(IsDO, "AX") == 0){
 			isEnableLocalPowerSharging = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging);
+			OcppReceiptrURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppReceiptrURL);
 		}
 		/*for TTIA*/
 		if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){
@@ -2356,6 +2370,7 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
 		json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
 		json_object_object_add(jobj1,"Intensity",Intensity);
+		json_object_object_add(jobj1,"isAuthrizeByEVCCID",isAuthrizeByEVCCID);
 		json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
 		json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
 		json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
@@ -2734,6 +2749,7 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj4,"OcppSecurityPassword",OcppSecurityPassword);
 		if(strcmp(IsDO, "AX") == 0){
 			json_object_object_add(jobj4,"isEnableLocalPowerSharging",isEnableLocalPowerSharging);
+			json_object_object_add(jobj4,"OcppReceiptrURL",OcppReceiptrURL);
 		}
 		/*for TTIA*/
 		if(strcmp(IsAcDc, "D") == 0 && strcmp(SafetyRegulation, "C") == 0){

+ 6 - 1
EVSE/rootfs/var/www/set_backend.php

@@ -250,6 +250,10 @@ CORE STYLES ABOVE - NO TOUCHY
 											<input type="text" name="OcppSecurityPassword" id="OcppSecurityPassword" class="form-control" value="<?php echo $obj->{'OcppSecurityPassword'};?>">
 										</div>
 <?php if(substr($ModelName,0,2)=="AX"){?>
+										<div class="form-group" style="display:block">
+											<label>Ocpp Receipt URL</label>
+											<input type="text" name="OcppReceiptrURL" id="OcppReceiptrURL" class="form-control" value="<?php echo $obj->{'OcppReceiptrURL'};?>">
+										</div>
 										<div class="form-group" style="display:block">
 											<label>Local Loading Balance</label>
 											<select class="form-control" id="isEnableLocalPowerSharging" name="isEnableLocalPowerSharging" onChange="isEnableLocalPowerSharging_changed()">
@@ -353,7 +357,8 @@ CORE STYLES ABOVE - NO TOUCHY
 						"&OcppSecurityProfile=" + document.getElementById("OcppSecurityProfile").value+
 						"&OcppSecurityPassword=" + escape(document.getElementById("OcppSecurityPassword").value);
 <?php if(substr($ModelName,0,2)=="AX"){?>
-				data += "&isEnableLocalPowerSharging=" + document.getElementById("isEnableLocalPowerSharging").value;
+				data += "&isEnableLocalPowerSharging=" + document.getElementById("isEnableLocalPowerSharging").value+
+						"&OcppReceiptrURL=" + document.getElementById("OcppReceiptrURL").value;
 <?php } ?>
 <?php if(substr($ModelName,0,1)=="D" && substr($ModelName,3,1)=="C"){?>
 				data += "&isEnableTTIA=" + (document.getElementById("isEnableTTIA").checked?"1":"0")+

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

@@ -56,6 +56,9 @@
 			checkValue("isEnableLocalPowerSharging");
 			$json['isEnableLocalPowerSharging']		= (int)$_REQUEST['isEnableLocalPowerSharging'];
 		}
+		if(isset($_REQUEST['OcppReceiptrURL'])){
+			$json['OcppReceiptrURL']		= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['OcppReceiptrURL'])))));
+		}
 		if(isset($_REQUEST['isEnableTTIA'])){
 			checkValue("isEnableTTIA");
 			$json['isEnableTTIA']		= (int)$_REQUEST['isEnableTTIA'];

+ 13 - 0
EVSE/rootfs/var/www/set_system.php

@@ -144,6 +144,11 @@ img {
 												<option value="1" <?php echo $obj->{'AuthorisationMode'}=="1"?"selected":""?>>disable</option>
 											</select>
 										</div>
+										<div class="form-group" id="isAuthrizeByEVCCIDDiv">
+											<label id="isAPPLabel">
+											<input type="checkbox" id="isAuthrizeByEVCCID" name="isAuthrizeByEVCCID" <?php echo $obj->{'isAuthrizeByEVCCID'}==1?"checked":"";?>>
+											Authorized By EVCCID</label>
+										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Input Voltage R</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj->{'InputVoltageR'},2);?> volt">
@@ -436,6 +441,7 @@ img {
 						"&isAPP=" + (document.getElementById("isAPP").checked?1:0)+
 						"&isQRCode=" + (document.getElementById("isQRCode").checked?1:0)+
 						"&isRFID=" + (document.getElementById("isRFID").checked?1:0)+
+						"&isAuthrizeByEVCCID=" + (document.getElementById("isAuthrizeByEVCCID").checked?1:0)+
 						"&QRCodeMadeMode=" + document.getElementById("QRCodeMadeMode").value+
 						"&QRCodeContent=" + document.getElementById("QRCodeContent").value+
 						"&Intensity=" + document.getElementById("Intensity").value+
@@ -488,10 +494,17 @@ img {
 				document.getElementById("isQRCode").checked=true;
 				document.getElementById("isRFID").checked=true;
 			}
+			if(document.getElementById("ModelName").value.substr(0,1) == "D"){
+				document.getElementById("isAuthrizeByEVCCIDDiv").style.display="block";
+			}
+			else{
+				document.getElementById("isAuthrizeByEVCCIDDiv").style.display="none";
+			}
 		}
 		else{
 			document.getElementById("startMode").style.display="none";
 			document.getElementById("QRCodeMadeModeDiv").style.display="none";
+			document.getElementById("isAuthrizeByEVCCIDDiv").style.display="none";
 		}
 	}
 

+ 5 - 0
EVSE/rootfs/var/www/set_system_action.php

@@ -27,6 +27,7 @@
 		checkValue("isAPP",2);
 		checkValue("isQRCode",2);
 		checkValue("isRFID",2);
+		checkValue("isAuthrizeByEVCCID",2);
 		checkValue("QRCodeMadeMode",2);
 		checkValue("Intensity",1);
 		checkValue("RfidCardNumEndian",1);
@@ -57,6 +58,10 @@
 		if(isset($_POST['isRFID'])){
 			$json['isRFID']					= (int)$_POST['isRFID'];
 		}
+		if(isset($_POST['isAuthrizeByEVCCID'])){
+			$json['isAuthrizeByEVCCID']		= (int)$_POST['isAuthrizeByEVCCID'];
+			if($json['AuthorisationMode']==1)$json['isAuthrizeByEVCCID']=0;
+		}
 		if(isset($_POST['QRCodeMadeMode'])){
 			$json['QRCodeMadeMode']			= (int)$_POST['QRCodeMadeMode'];
 		}