Эх сурвалжийг харах

2020-09-16 / ct_chen

Actions:
1. Webservice fix issue with web api using few parameter
2. modify SSL for browser security message
3. add round function for charging info

Files:
1. EVSE/Modularization/WebService.c
   EVSE/rootfs/var/www/set_backend_action.php
   EVSE/rootfs/var/www/set_charging_action.php
   EVSE/rootfs/var/www/set_network_action.php
   EVSE/rootfs/var/www/set_system_action.php
2. EVSE/rootfs/etc/lighttpd/ssl/lighttpd.pem
   EVSE/rootfs/var/www/server.p7b
3. EVSE/rootfs/var/www/set_charging.php
ct_chen 4 жил өмнө
parent
commit
bcabcbee37

+ 90 - 94
EVSE/Modularization/WebService.c

@@ -364,72 +364,70 @@ int main(int argc, char *argv[]) {
 			int AuthorisationMode = 0;
 			int RfidCardNumEndian = 0;
 			int PsuAcInputType = 0;
-			char isAPP = NULL;
-			char isQRCode = NULL;
-			char isRFID = NULL;
-			char QRCodeMadeMode = NULL;
+			char isAPP = 0;
+			char isQRCode = 0;
+			char isRFID = 0;
+			char QRCodeMadeMode = 0;
 			char *QRCodeContent = NULL;
-			char Intensity = NULL;
+			char Intensity = 0;
 
 			if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
 				SystemId = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
 			}
 			if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
 				SystemDateTime = (char*)json_object_get_string(val_obj);
+				if(strlen(SystemDateTime)>0){
+					char cmd[100];
+					sprintf(cmd,"date -s '%s'",SystemDateTime);
+					if(system(cmd)==0){
+						system("hwclock -w");
+					}
+				}
 			}
 			if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
 				PhaseLossPolicy = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
 			}
 			if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
 				FactoryConfiguration = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
 			}
 			if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
 				AuthorisationMode = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
 			}
 			if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
 				RfidCardNumEndian = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
 			}
 			if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
 				PsuAcInputType = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
 			}
 			if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
 				isAPP = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
 			}
 			if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
 				isQRCode = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
 			}
 			if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
 				isRFID = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
 			}
 			if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
 				QRCodeMadeMode = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
 			}
 			if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
 				QRCodeContent = json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
 			}
 			if( json_object_object_get_ex(jobj, "Intensity", &val_obj) ) {
 				Intensity = json_object_get_int(val_obj);
-			}
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
-			ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy = PhaseLossPolicy;
-			ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
-			ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
-			ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = RfidCardNumEndian;
-			ShmSysConfigAndInfo->SysConfig.PsuAcInputType = PsuAcInputType;
-			ShmSysConfigAndInfo->SysConfig.isAPP = isAPP;
-			ShmSysConfigAndInfo->SysConfig.isQRCode = isQRCode;
-			ShmSysConfigAndInfo->SysConfig.isRFID = isRFID;
-			ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode = QRCodeMadeMode;
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent,QRCodeContent);
-			ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
-
-			if(strlen(SystemDateTime)>0){
-				char cmd[100];
-				sprintf(cmd,"date -s '%s'",SystemDateTime);
-				if(system(cmd)==0){
-					system("hwclock -w");
-				}
-
+				ShmSysConfigAndInfo->SysConfig.LedInfo.Intensity = Intensity;
 			}
 		}
 		if (strcmp(argv[1], "2") == 0) {
@@ -479,168 +477,168 @@ int main(int argc, char *argv[]) {
 
 			if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
 				MaxChargingEnergy = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
 			}
 			if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
 				MaxChargingPower = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
 			}
 			if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
 				MaxChargingCurrent = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
 			}
 			if( json_object_object_get_ex(jobj, "AcMaxChargingCurrent", &val_obj) ) {
 				AcMaxChargingCurrent = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
 			}
 			if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
 				MaxChargingDuration = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
 				LocalWhiteCard0 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
 				LocalWhiteCard1 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
 				LocalWhiteCard2 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
 				LocalWhiteCard3 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
 				LocalWhiteCard4 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
 				LocalWhiteCard5 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
 				LocalWhiteCard6 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
 				LocalWhiteCard7 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
 				LocalWhiteCard8 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
 			}
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
 				LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
 			}
 			if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
 				isBilling = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = isBilling;
 			}
 			if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
 				Currency = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Currency = Currency;
 			}
 			if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
 				Fee0 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0] = rounding(Fee0);
 			}
 			if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
 				Fee1 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1] = rounding(Fee1);
 			}
 			if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
 				Fee2 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2] = rounding(Fee2);
 			}
 			if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
 				Fee3 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3] = rounding(Fee3);
 			}
 			if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
 				Fee4 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4] = rounding(Fee4);
 			}
 			if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
 				Fee5 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5] = rounding(Fee5);
 			}
 			if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
 				Fee6 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6] = rounding(Fee6);
 			}
 			if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
 				Fee7 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7] = rounding(Fee7);
 			}
 			if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
 				Fee8 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8] = rounding(Fee8);
 			}
 			if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
 				Fee9 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9] = rounding(Fee9);
 			}
 			if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
 				Fee10 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10] = rounding(Fee10);
 			}
 			if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
 				Fee11 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11] = rounding(Fee11);
 			}
 			if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
 				Fee12 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12] = rounding(Fee12);
 			}
 			if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
 				Fee13 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13] = rounding(Fee13);
 			}
 			if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
 				Fee14 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14] = rounding(Fee14);
 			}
 			if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
 				Fee15 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15] = rounding(Fee15);
 			}
 			if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
 				Fee16 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16] = rounding(Fee16);
 			}
 			if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
 				Fee17 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17] = rounding(Fee17);
 			}
 			if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
 				Fee18 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18] = rounding(Fee18);
 			}
 			if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
 				Fee19 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19] = rounding(Fee19);
 			}
 			if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
 				Fee20 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20] = rounding(Fee20);
 			}
 			if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
 				Fee21 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21] = rounding(Fee21);
 			}
 			if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
 				Fee22 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22] = rounding(Fee22);
 			}
 			if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
 				Fee23 = json_object_get_double(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23] = rounding(Fee23);
 			}
-			ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
-			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
-			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
-			ShmSysConfigAndInfo->SysConfig.AcMaxChargingCurrent = AcMaxChargingCurrent;
-			ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
-			ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = isBilling;
-			ShmSysConfigAndInfo->SysConfig.BillingData.Currency = Currency;
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0] = rounding(Fee0);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1] = rounding(Fee1);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2] = rounding(Fee2);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3] = rounding(Fee3);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4] = rounding(Fee4);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5] = rounding(Fee5);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6] = rounding(Fee6);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7] = rounding(Fee7);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8] = rounding(Fee8);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9] = rounding(Fee9);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10] = rounding(Fee10);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11] = rounding(Fee11);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12] = rounding(Fee12);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13] = rounding(Fee13);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14] = rounding(Fee14);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15] = rounding(Fee15);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16] = rounding(Fee16);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17] = rounding(Fee17);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18] = rounding(Fee18);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19] = rounding(Fee19);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20] = rounding(Fee20);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21] = rounding(Fee21);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22] = rounding(Fee22);
-			ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23] = rounding(Fee23);
 		}
 		if (strcmp(argv[1], "3") == 0) {
 			struct json_object *jobj = json_tokener_parse(argv[2]);
@@ -649,7 +647,6 @@ int main(int argc, char *argv[]) {
 			char *Eth0IpAddress=NULL;
 			char *Eth0SubmaskAddress=NULL;
 			char *Eth0GatewayAddress=NULL;
-			int Eth1DhcpClient=0;
 			int WifiMode=0;
 			char *WifiSsid=NULL;
 			char *WifiPassword=NULL;
@@ -662,77 +659,76 @@ int main(int argc, char *argv[]) {
 			char *TelcomChapPapId=NULL;
 			char *TelcomChapPapPwd=NULL;
 			char *TelcomIpAddress=NULL;
-			char TelcomEnabled=NULL;
+			char TelcomEnabled=0;
 			if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
 				Eth0DhcpClient = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
 			}
 			if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
 				Eth0IpAddress = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
 			}
 			if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
 				Eth0SubmaskAddress = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
 			}
 			if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
 				Eth0GatewayAddress = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
 			}
 			if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
 				WifiMode = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
 			}
 			if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
 				WifiSsid = (char*)json_object_get_string(val_obj);
+				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);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
 			}
 			if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
 				WifiDhcpServer = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
 			}
 			if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
 				WifiDhcpClient = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
 			}
 			if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
 				WifiIpAddress = (char*)json_object_get_string(val_obj);
+				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);
+				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);
+				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);
+				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);
+				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);
+				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);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
 			}
 			if( json_object_object_get_ex(jobj, "TelcomEnabled", &val_obj) ) {
 				TelcomEnabled = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled=TelcomEnabled;
 			}
 
-			ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient=Eth0DhcpClient;
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,Eth0IpAddress);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,Eth0SubmaskAddress);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,Eth0GatewayAddress);
-			ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient=Eth1DhcpClient;
-			ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
-			ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer=WifiDhcpServer;
-			ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient=WifiDhcpClient;
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,WifiIpAddress);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,WifiSubmaskAddress);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,WifiGatewayAddress);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,TelcomApn);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,TelcomChapPapId);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,TelcomChapPapPwd);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TelcomIpAddress);
-			ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomEnabled=TelcomEnabled;
 		}
 		if (strcmp(argv[1], "4") == 0) {
 			struct json_object *jobj = json_tokener_parse(argv[2]);
@@ -747,33 +743,33 @@ int main(int argc, char *argv[]) {
 
 			if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
 				BackendConnTimeout = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
 			}
 			if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
 				OfflinePolicy = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
 			}
 			if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
 				OfflineMaxChargeEnergy = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
 			}
 			if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
 				OfflineMaxChargeDuration = json_object_get_int(val_obj);
+				ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
 			}
 			if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
 				OcppServerURL = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
 			}
 			if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
 				ChargeBoxId = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
 			}
 			if( json_object_object_get_ex(jobj, "chargePointVendor", &val_obj) ) {
 				chargePointVendor = (char*)json_object_get_string(val_obj);
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
 			}
 
-			ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
-			ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
-			ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
-			ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
-			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
 		}
 		struct SysConfigData 	SysConfig;
 		memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));

+ 45 - 47
EVSE/rootfs/etc/lighttpd/ssl/lighttpd.pem

@@ -1,51 +1,49 @@
 -----BEGIN RSA PRIVATE KEY-----
-MIIEowIBAAKCAQEAyWA6XPzNbOU+xeqlUo76Kmp/CHkFiuI0dMPeSx83P7G/jJ0T
-rJgDhgSevQeyaWaXztqH7UhD8SvlN7TydgSspkmqXoPkCa4bKnAkDw/ewp2IjiPD
-moRYr3QXm76aITeHl4Vx/PYfZtkvkouKC8GRJqyc0nelehiyocTyjc8zxJPZaDbF
-jlHU3bidk6xgfRs4NyDNKe7dlAT4LrMNopSD6fAReJVOGM/eNXhU99ln82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TatVmR4tQ1Mnwl7dnFEDCo0EybLxtVIldC6MQJmPH4
+Ns8MvUWZVAmMvMpzvtJEzFTdzqWPJVrDYMaWSz9iXmAq4t1CUVIT3XJXFbOlMoX4
+6nvMNtypGOU0kdXTDSkimeo+seeVy3DvNEiCeUGGMcYJIv4NqJP3q9tlHr+fZfBO
+oU+4AO8WO+lN3PxJ6oR/ShqSMazSIAkMOnnROr+CLIU2oKrqyhkhd/A4cTt6JOe3
+nTG8Z0t840tz1sr6gr7BYaA7JHJ9pOX9xZiUwnKNARF7kvLV4yt+JJj/0Vix16zO
+kiyrwZzFOKA/2QOE2Zdilol7ZtgDmzMQodQJop9nWwIDAQABoxMwETAPBgNVHREE
+CDAGhwTAqAEKMA0GCSqGSIb3DQEBCwUAA4IBAQCXZNjVGJ+jTFP2WD7Sv8D3MZc7
+lfqebUVPAdWM/LkouR+BHOVHaeugtXEKuJ3FFHFGSGrNxwVmkpozUz7nDyexTkFQ
+7pcQHxm3BTTeZcACXxzh6lHuk42B2tP72ggkNhegO/AatKPM/NWLIbXuHLhR3Ns7
+gmLOi6PUJWjzSvGQo0djgKe5ETErPrIk86uc3Jt50Lr9fyuuwceNK8MvSEXvu4fO
+F4gnVnbhw3+tvWVVSa4OnXy1GGdefFmKFpiaSiimPgjon93ghjREN0Tw0sVzXBW1
+tNvrvetJopp4+tSHWy+/mMwWfDSEuTnncHBmXFxnuKdGtPWkcXkV5hppUkqXoQAx
+AA==
+-----END PKCS7-----

+ 34 - 21
EVSE/rootfs/var/www/set_backend_action.php

@@ -24,16 +24,27 @@
 		checkValue("OfflinePolicy");
 		checkLength("ChargeBoxId",25);
 		checkLength("chargePointVendor",20);
-//		$json = json_decode(file_get_contents("charging.txt"), true);
-//		$json = string[];
-		$json['BackendConnTimeout']			= (int)$_POST['BackendConnTimeout'];
-		$json['OfflinePolicy']				= (int)$_POST['OfflinePolicy'];
-		$json['OfflineMaxChargeEnergy']		= (int)$_POST['OfflineMaxChargeEnergy'];
-		$json['OfflineMaxChargeDuration']	= (int)$_POST['OfflineMaxChargeDuration'];
-//		$json['OcppConnStatus']				= $_POST['OcppConnStatus'];
-		$json['OcppServerURL']				= $_POST['OcppServerURL'];
-		$json['ChargeBoxId']				= $_POST['ChargeBoxId'];
-		$json['chargePointVendor']				= $_POST['chargePointVendor'];
+		if($_POST['BackendConnTimeout'] != ""){
+			$json['BackendConnTimeout']			= (int)$_POST['BackendConnTimeout'];
+		}
+		if($_POST['OfflinePolicy'] != ""){
+			$json['OfflinePolicy']				= (int)$_POST['OfflinePolicy'];
+		}
+		if($_POST['OfflineMaxChargeEnergy'] != ""){
+			$json['OfflineMaxChargeEnergy']		= (int)$_POST['OfflineMaxChargeEnergy'];
+		}
+		if($_POST['OfflineMaxChargeDuration'] != ""){
+			$json['OfflineMaxChargeDuration']	= (int)$_POST['OfflineMaxChargeDuration'];
+		}
+		if($_POST['OcppServerURL'] != ""){
+			$json['OcppServerURL']				= $_POST['OcppServerURL'];
+		}
+		if($_POST['ChargeBoxId'] != ""){
+			$json['ChargeBoxId']				= $_POST['ChargeBoxId'];
+		}
+		if($_POST['chargePointVendor'] != ""){
+			$json['chargePointVendor']				= $_POST['chargePointVendor'];
+		}
 //		ob_start();
 		
 		shell_exec('sync;sync;sync');
@@ -57,17 +68,19 @@
 	}
 
 	function checkValue($id){
-		if(strlen($_POST[$id])!=1){
-				$jsone['result'] = "Fail";
-				$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
-				echo json_encode($jsone);
-				exit;
-		}
-		if(!ereg("[0-9]",$_POST[$id])){
-				$jsone['result'] = "Fail";
-				$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
-				echo json_encode($jsone);
-				exit;
+		if($_POST[$id] != ""){
+			if(strlen($_POST[$id])!=1){
+					$jsone['result'] = "Fail";
+					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+					echo json_encode($jsone);
+					exit;
+			}
+			if(!ereg("[0-9]",$_POST[$id])){
+					$jsone['result'] = "Fail";
+					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+					echo json_encode($jsone);
+					exit;
+			}
 		}
 	}
 	function checkLength($id,$value){

+ 12 - 12
EVSE/rootfs/var/www/set_charging.php

@@ -649,22 +649,22 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?> volt">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingVoltage'],2);?> volt">
 											<input type="hidden" name="PresentChargingVoltage2" id="PresentChargingVoltage2" value="<?php echo $obj['ChargingInfo2']['PresentChargingVoltage'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Present Charging Current</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?> amp">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingCurrent'],2);?> amp">
 											<input type="hidden" name="PresentChargingCurrent2" id="PresentChargingCurrent2" value="<?php echo $obj['ChargingInfo2']['PresentChargingCurrent'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Present Charging Power</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?> kW">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargingPower'],2);?> kW">
 											<input type="hidden" name="PresentChargingPower2" id="PresentChargingPower2" value="<?php echo $obj['ChargingInfo2']['PresentChargingPower'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Present Charging Energy</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?> kWh">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['PresentChargedEnergy'],2);?> kWh">
 											<input type="hidden" name="PresentChargedEnergy2" id="PresentChargedEnergy2" value="<?php echo $obj['ChargingInfo2']['PresentChargedEnergy'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
@@ -679,12 +679,12 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?> volt">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['EvBatteryMaxVoltage'],2);?> volt">
 											<input type="hidden" name="EvBatteryMaxVoltage2" id="EvBatteryMaxVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatteryMaxVoltage'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?> volt">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo2']['EvBatterytargetVoltage'],2);?> volt">
 											<input type="hidden" name="EvBatterytargetVoltage2" id="EvBatterytargetVoltage2" value="<?php echo $obj['ChargingInfo2']['EvBatterytargetVoltage'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
@@ -732,22 +732,22 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Present Charging Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?> volt">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingVoltage'],2);?> volt">
 											<input type="hidden" name="PresentChargingVoltage3" id="PresentChargingVoltage3" value="<?php echo $obj['ChargingInfo3']['PresentChargingVoltage'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Present Charging Current</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?> amp">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingCurrent'],2);?> amp">
 											<input type="hidden" name="PresentChargingCurrent3" id="PresentChargingCurrent3" value="<?php echo $obj['ChargingInfo3']['PresentChargingCurrent'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Present Charging Power</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?> kW">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargingPower'],2);?> kW">
 											<input type="hidden" name="PresentChargingPower3" id="PresentChargingPower3" value="<?php echo $obj['ChargingInfo3']['PresentChargingPower'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Present Charging Energy</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?> kWh">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['PresentChargedEnergy'],2);?> kWh">
 											<input type="hidden" name="PresentChargedEnergy3" id="PresentChargedEnergy3" value="<?php echo $obj['ChargingInfo3']['PresentChargedEnergy'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
@@ -762,12 +762,12 @@ img {
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>EV Battery Max Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?> volt">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['EvBatteryMaxVoltage'],2);?> volt">
 											<input type="hidden" name="EvBatteryMaxVoltage3" id="EvBatteryMaxVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatteryMaxVoltage'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>EV Battery Target Voltage</label>
-											<input type="text" readonly class="form-control" placeholder="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?> volt">
+											<input type="text" readonly class="form-control" placeholder="<?php echo round($obj['ChargingInfo3']['EvBatterytargetVoltage'],2);?> volt">
 											<input type="hidden" name="EvBatterytargetVoltage3" id="EvBatterytargetVoltage3" value="<?php echo $obj['ChargingInfo3']['EvBatterytargetVoltage'];?>">
 										</div>
 										<div class="form-group" style="display:<?php echo $am001;?>">

+ 123 - 43
EVSE/rootfs/var/www/set_charging_action.php

@@ -27,49 +27,129 @@
 		checkMaxValue("MaxChargingCurrent");
 		checkMaxValue("AcMaxChargingCurrent");
 		checkMaxValue("MaxChargingDuration");
-//		$json = json_decode(file_get_contents("charging.txt"), true);
-//		$json = string[];
-		$json['MaxChargingEnergy']			= (int)$_POST['MaxChargingEnergy'];
-		$json['MaxChargingPower'] 			= (int)$_POST['MaxChargingPower'];
-		$json['MaxChargingCurrent']			= (int)$_POST['MaxChargingCurrent'];
-		$json['AcMaxChargingCurrent']		= (int)$_POST['AcMaxChargingCurrent'];
-		$json['MaxChargingDuration'] 		= (int)$_POST['MaxChargingDuration'];
-		$json['LocalWhiteCard0']			= isset($_POST['LocalWhiteCard0'])?$_POST['LocalWhiteCard0']:"";
-		$json['LocalWhiteCard1']	 		= isset($_POST['LocalWhiteCard1'])?$_POST['LocalWhiteCard1']:"";
-		$json['LocalWhiteCard2']			= isset($_POST['LocalWhiteCard2'])?$_POST['LocalWhiteCard2']:"";
-		$json['LocalWhiteCard3']			= isset($_POST['LocalWhiteCard3'])?$_POST['LocalWhiteCard3']:"";
-		$json['LocalWhiteCard4']			= isset($_POST['LocalWhiteCard4'])?$_POST['LocalWhiteCard4']:"";
-		$json['LocalWhiteCard5']			= isset($_POST['LocalWhiteCard5'])?$_POST['LocalWhiteCard5']:"";
-		$json['LocalWhiteCard6']			= isset($_POST['LocalWhiteCard6'])?$_POST['LocalWhiteCard6']:"";
-		$json['LocalWhiteCard7']			= isset($_POST['LocalWhiteCard7'])?$_POST['LocalWhiteCard7']:"";
-		$json['LocalWhiteCard8']			= isset($_POST['LocalWhiteCard8'])?$_POST['LocalWhiteCard8']:"";
-		$json['LocalWhiteCard9']			= isset($_POST['LocalWhiteCard9'])?$_POST['LocalWhiteCard9']:"";
-		$json['isBilling']					= (int)$_POST['isBilling'];
-		$json['Currency']					= (int)$_POST['Currency'];
-		$json['Fee0']						= isset($_POST['Fee0'])?round($_POST['Fee0'], 2):"";
-		$json['Fee1']						= isset($_POST['Fee1'])?round($_POST['Fee1'], 2):"";
-		$json['Fee2']						= isset($_POST['Fee2'])?round($_POST['Fee2'], 2):"";
-		$json['Fee3']						= isset($_POST['Fee3'])?round($_POST['Fee3'], 2):"";
-		$json['Fee4']						= isset($_POST['Fee4'])?round($_POST['Fee4'], 2):"";
-		$json['Fee5']						= isset($_POST['Fee5'])?round($_POST['Fee5'], 2):"";
-		$json['Fee6']						= isset($_POST['Fee6'])?round($_POST['Fee6'], 2):"";
-		$json['Fee7']						= isset($_POST['Fee7'])?round($_POST['Fee7'], 2):"";
-		$json['Fee8']						= isset($_POST['Fee8'])?round($_POST['Fee8'], 2):"";
-		$json['Fee9']						= isset($_POST['Fee9'])?round($_POST['Fee9'], 2):"";
-		$json['Fee10']						= isset($_POST['Fee10'])?round($_POST['Fee10'], 2):"";
-		$json['Fee11']						= isset($_POST['Fee11'])?round($_POST['Fee11'], 2):"";
-		$json['Fee12']						= isset($_POST['Fee12'])?round($_POST['Fee12'], 2):"";
-		$json['Fee13']						= isset($_POST['Fee13'])?round($_POST['Fee13'], 2):"";
-		$json['Fee14']						= isset($_POST['Fee14'])?round($_POST['Fee14'], 2):"";
-		$json['Fee15']						= isset($_POST['Fee15'])?round($_POST['Fee15'], 2):"";
-		$json['Fee16']						= isset($_POST['Fee16'])?round($_POST['Fee16'], 2):"";
-		$json['Fee17']						= isset($_POST['Fee17'])?round($_POST['Fee17'], 2):"";
-		$json['Fee18']						= isset($_POST['Fee18'])?round($_POST['Fee18'], 2):"";
-		$json['Fee19']						= isset($_POST['Fee19'])?round($_POST['Fee19'], 2):"";
-		$json['Fee20']						= isset($_POST['Fee20'])?round($_POST['Fee20'], 2):"";
-		$json['Fee21']						= isset($_POST['Fee21'])?round($_POST['Fee21'], 2):"";
-		$json['Fee22']						= isset($_POST['Fee22'])?round($_POST['Fee22'], 2):"";
-		$json['Fee23']						= isset($_POST['Fee23'])?round($_POST['Fee23'], 2):"";
+		if($_POST['MaxChargingEnergy'] != ""){
+			$json['MaxChargingEnergy']			= (int)$_POST['MaxChargingEnergy'];
+		}
+		if($_POST['MaxChargingPower'] != ""){
+			$json['MaxChargingPower'] 			= (int)$_POST['MaxChargingPower'];
+		}
+		if($_POST['MaxChargingCurrent'] != ""){
+			$json['MaxChargingCurrent']			= (int)$_POST['MaxChargingCurrent'];
+		}
+		if($_POST['AcMaxChargingCurrent'] != ""){
+			$json['AcMaxChargingCurrent']		= (int)$_POST['AcMaxChargingCurrent'];
+		}
+		if($_POST['MaxChargingDuration'] != ""){
+			$json['MaxChargingDuration'] 		= (int)$_POST['MaxChargingDuration'];
+		}
+		if($_POST['LocalWhiteCard0'] != ""){
+			$json['LocalWhiteCard0']			= isset($_POST['LocalWhiteCard0'])?$_POST['LocalWhiteCard0']:"";
+		}
+		if($_POST['LocalWhiteCard1'] != ""){
+			$json['LocalWhiteCard1']	 		= isset($_POST['LocalWhiteCard1'])?$_POST['LocalWhiteCard1']:"";
+		}
+		if($_POST['LocalWhiteCard2'] != ""){
+			$json['LocalWhiteCard2']			= isset($_POST['LocalWhiteCard2'])?$_POST['LocalWhiteCard2']:"";
+		}
+		if($_POST['LocalWhiteCard3'] != ""){
+			$json['LocalWhiteCard3']			= isset($_POST['LocalWhiteCard3'])?$_POST['LocalWhiteCard3']:"";
+		}
+		if($_POST['LocalWhiteCard4'] != ""){
+			$json['LocalWhiteCard4']			= isset($_POST['LocalWhiteCard4'])?$_POST['LocalWhiteCard4']:"";
+		}
+		if($_POST['LocalWhiteCard5'] != ""){
+			$json['LocalWhiteCard5']			= isset($_POST['LocalWhiteCard5'])?$_POST['LocalWhiteCard5']:"";
+		}
+		if($_POST['LocalWhiteCard6'] != ""){
+			$json['LocalWhiteCard6']			= isset($_POST['LocalWhiteCard6'])?$_POST['LocalWhiteCard6']:"";
+		}
+		if($_POST['LocalWhiteCard7'] != ""){
+			$json['LocalWhiteCard7']			= isset($_POST['LocalWhiteCard7'])?$_POST['LocalWhiteCard7']:"";
+		}
+		if($_POST['LocalWhiteCard8'] != ""){
+			$json['LocalWhiteCard8']			= isset($_POST['LocalWhiteCard8'])?$_POST['LocalWhiteCard8']:"";
+		}
+		if($_POST['LocalWhiteCard9'] != ""){
+			$json['LocalWhiteCard9']			= isset($_POST['LocalWhiteCard9'])?$_POST['LocalWhiteCard9']:"";
+		}
+		if($_POST['isBilling'] != ""){
+			$json['isBilling']					= (int)$_POST['isBilling'];
+		}
+		if($_POST['Currency'] != ""){
+			$json['Currency']					= (int)$_POST['Currency'];
+		}
+		if($_POST['Fee0'] != ""){
+			$json['Fee0']						= isset($_POST['Fee0'])?round($_POST['Fee0'], 2):"";
+		}
+		if($_POST['Fee1'] != ""){
+			$json['Fee1']						= isset($_POST['Fee1'])?round($_POST['Fee1'], 2):"";
+		}
+		if($_POST['Fee2'] != ""){
+			$json['Fee2']						= isset($_POST['Fee2'])?round($_POST['Fee2'], 2):"";
+		}
+		if($_POST['Fee3'] != ""){
+			$json['Fee3']						= isset($_POST['Fee3'])?round($_POST['Fee3'], 2):"";
+		}
+		if($_POST['Fee4'] != ""){
+			$json['Fee4']						= isset($_POST['Fee4'])?round($_POST['Fee4'], 2):"";
+		}
+		if($_POST['Fee5'] != ""){
+			$json['Fee5']						= isset($_POST['Fee5'])?round($_POST['Fee5'], 2):"";
+		}
+		if($_POST['Fee6'] != ""){
+			$json['Fee6']						= isset($_POST['Fee6'])?round($_POST['Fee6'], 2):"";
+		}
+		if($_POST['Fee7'] != ""){
+			$json['Fee7']						= isset($_POST['Fee7'])?round($_POST['Fee7'], 2):"";
+		}
+		if($_POST['Fee8'] != ""){
+			$json['Fee8']						= isset($_POST['Fee8'])?round($_POST['Fee8'], 2):"";
+		}
+		if($_POST['Fee9'] != ""){
+			$json['Fee9']						= isset($_POST['Fee9'])?round($_POST['Fee9'], 2):"";
+		}
+		if($_POST['Fee10'] != ""){
+			$json['Fee10']						= isset($_POST['Fee10'])?round($_POST['Fee10'], 2):"";
+		}
+		if($_POST['Fee11'] != ""){
+			$json['Fee11']						= isset($_POST['Fee11'])?round($_POST['Fee11'], 2):"";
+		}
+		if($_POST['Fee12'] != ""){
+			$json['Fee12']						= isset($_POST['Fee12'])?round($_POST['Fee12'], 2):"";
+		}
+		if($_POST['Fee13'] != ""){
+			$json['Fee13']						= isset($_POST['Fee13'])?round($_POST['Fee13'], 2):"";
+		}
+		if($_POST['Fee14'] != ""){
+			$json['Fee14']						= isset($_POST['Fee14'])?round($_POST['Fee14'], 2):"";
+		}
+		if($_POST['Fee15'] != ""){
+			$json['Fee15']						= isset($_POST['Fee15'])?round($_POST['Fee15'], 2):"";
+		}
+		if($_POST['Fee16'] != ""){
+			$json['Fee16']						= isset($_POST['Fee16'])?round($_POST['Fee16'], 2):"";
+		}
+		if($_POST['Fee17'] != ""){
+			$json['Fee17']						= isset($_POST['Fee17'])?round($_POST['Fee17'], 2):"";
+		}
+		if($_POST['Fee18'] != ""){
+			$json['Fee18']						= isset($_POST['Fee18'])?round($_POST['Fee18'], 2):"";
+		}
+		if($_POST['Fee19'] != ""){
+			$json['Fee19']						= isset($_POST['Fee19'])?round($_POST['Fee19'], 2):"";
+		}
+		if($_POST['Fee20'] != ""){
+			$json['Fee20']						= isset($_POST['Fee20'])?round($_POST['Fee20'], 2):"";
+		}
+		if($_POST['Fee21'] != ""){
+			$json['Fee21']						= isset($_POST['Fee21'])?round($_POST['Fee21'], 2):"";
+		}
+		if($_POST['Fee22'] != ""){
+			$json['Fee22']						= isset($_POST['Fee22'])?round($_POST['Fee22'], 2):"";
+		}
+		if($_POST['Fee23'] != ""){
+			$json['Fee23']						= isset($_POST['Fee23'])?round($_POST['Fee23'], 2):"";
+		}
 		
 //		ob_start();
 		

+ 64 - 39
EVSE/rootfs/var/www/set_network_action.php

@@ -15,44 +15,67 @@
 		checkip("Eth0IpAddress");
 		checkip("Eth0SubmaskAddress");
 		checkip("Eth0GatewayAddress");
-		// checkip("Eth1IpAddress");
-		// checkip("Eth1SubmaskAddress");
-		// checkip("Eth1GatewayAddress");
 		checkip("WifiIpAddress");
 		checkip("WifiSubmaskAddress");
 		checkip("WifiGatewayAddress");
 		checkip("TelcomIpAddress");
 		checkValue("Eth0DhcpClient");
-		// checkValue("Eth1DhcpClient");
 		checkValue("WifiMode");
 		checkValue("WifiDhcpServer");
 		checkValue("WifiDhcpClient");
 		checkValue("TelcomEnabled");
 		WifiMode_changed();
-//		$json = json_decode(file_get_contents("charging.txt"), true);
-//		$json = string[];
-//		$json['FtpServer']				= $_POST['FtpServer'];
-		$json['Eth0DhcpClient']			= $_POST['Eth0DhcpClient'];
-		$json['Eth0IpAddress']			= $_POST['Eth0IpAddress'];
-		$json['Eth0SubmaskAddress']		= $_POST['Eth0SubmaskAddress'];
-		$json['Eth0GatewayAddress']		= $_POST['Eth0GatewayAddress'];
-		// $json['Eth1DhcpClient']			= $_POST['Eth1DhcpClient'];
-		// $json['Eth1IpAddress']			= $_POST['Eth1IpAddress'];
-		// $json['Eth1SubmaskAddress']		= $_POST['Eth1SubmaskAddress'];
-		// $json['Eth1GatewayAddress']		= $_POST['Eth1GatewayAddress'];
-		$json['WifiMode']				= $_POST['WifiMode'];
-		$json['WifiSsid']				= $_POST['WifiSsid'];
-		$json['WifiPassword']			= $_POST['WifiPassword'];
-		$json['WifiDhcpServer']			= $_POST['WifiDhcpServer'];
-		$json['WifiDhcpClient']			= $_POST['WifiDhcpClient'];
-		$json['WifiIpAddress']			= $_POST['WifiIpAddress'];
-		$json['WifiSubmaskAddress']		= $_POST['WifiSubmaskAddress'];
-		$json['WifiGatewayAddress']		= $_POST['WifiGatewayAddress'];
-		$json['TelcomApn']				= $_POST['TelcomApn'];
-		$json['TelcomChapPapId']		= $_POST['TelcomChapPapId'];
-		$json['TelcomChapPapPwd']		= $_POST['TelcomChapPapPwd'];
-		$json['TelcomIpAddress']		= $_POST['TelcomIpAddress'];
-		$json['TelcomEnabled']			= $_POST['TelcomEnabled'];
+		if($_POST['Eth0DhcpClient'] != ""){
+			$json['Eth0DhcpClient']			= $_POST['Eth0DhcpClient'];
+		}
+		if($_POST['Eth0IpAddress'] != ""){
+			$json['Eth0IpAddress']			= $_POST['Eth0IpAddress'];
+		}
+		if($_POST['Eth0SubmaskAddress'] != ""){
+			$json['Eth0SubmaskAddress']		= $_POST['Eth0SubmaskAddress'];
+		}
+		if($_POST['Eth0GatewayAddress'] != ""){
+			$json['Eth0GatewayAddress']		= $_POST['Eth0GatewayAddress'];
+		}
+		if($_POST['WifiMode'] != ""){
+			$json['WifiMode']				= $_POST['WifiMode'];
+		}
+		if($_POST['WifiSsid'] != ""){
+			$json['WifiSsid']				= $_POST['WifiSsid'];
+		}
+		if($_POST['WifiPassword'] != ""){
+			$json['WifiPassword']			= $_POST['WifiPassword'];
+		}
+		if($_POST['WifiDhcpServer'] != ""){
+			$json['WifiDhcpServer']			= $_POST['WifiDhcpServer'];
+		}
+		if($_POST['WifiDhcpClient'] != ""){
+			$json['WifiDhcpClient']			= $_POST['WifiDhcpClient'];
+		}
+		if($_POST['WifiIpAddress'] != ""){
+			$json['WifiIpAddress']			= $_POST['WifiIpAddress'];
+		}
+		if($_POST['WifiSubmaskAddress'] != ""){
+			$json['WifiSubmaskAddress']		= $_POST['WifiSubmaskAddress'];
+		}
+		if($_POST['WifiGatewayAddress'] != ""){
+			$json['WifiGatewayAddress']		= $_POST['WifiGatewayAddress'];
+		}
+		if($_POST['TelcomApn'] != ""){
+			$json['TelcomApn']				= $_POST['TelcomApn'];
+		}
+		if($_POST['TelcomChapPapId'] != ""){
+			$json['TelcomChapPapId']		= $_POST['TelcomChapPapId'];
+		}
+		if($_POST['TelcomChapPapPwd'] != ""){
+			$json['TelcomChapPapPwd']		= $_POST['TelcomChapPapPwd'];
+		}
+		if($_POST['TelcomIpAddress'] != ""){
+			$json['TelcomIpAddress']		= $_POST['TelcomIpAddress'];
+		}
+		if($_POST['TelcomEnabled'] != ""){
+			$json['TelcomEnabled']			= $_POST['TelcomEnabled'];
+		}
 
 //		ob_start();
 		
@@ -92,17 +115,19 @@
 	}
 
 	function checkValue($id){
-		if(strlen($_POST[$id])!=1){
-				$jsone['result'] = "Fail";
-				$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
-				echo json_encode($jsone);
-				exit;
-		}
-		if(!ereg("[0-9]",$_POST[$id])){
-				$jsone['result'] = "Fail";
-				$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
-				echo json_encode($jsone);
-				exit;
+		if($_POST[$id] != ""){
+			if(strlen($_POST[$id])!=1){
+					$jsone['result'] = "Fail";
+					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+					echo json_encode($jsone);
+					exit;
+			}
+			if(!ereg("[0-9]",$_POST[$id])){
+					$jsone['result'] = "Fail";
+					$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+					echo json_encode($jsone);
+					exit;
+			}
 		}
 	}
 

+ 40 - 14
EVSE/rootfs/var/www/set_system_action.php

@@ -32,20 +32,46 @@
 		checkValue("RfidCardNumEndian",1);
 		checkValue("PsuAcInputType",1);
 //		$json = json_decode(file_get_contents("system.txt"), true);
-		$json['SystemId']				= $_POST["SystemId"];
-		$json['SystemDateTime']			= $_POST['SystemDateTime'];
-		$json['PhaseLossPolicy']		= (int)$_POST['PhaseLossPolicy'];
-		$json['FactoryConfiguration']	= $_POST['FactoryConfiguration'];
-		$json['AuthorisationMode']		= (int)$_POST['AuthorisationMode'];
-		$json['isAPP']					= (int)$_POST['isAPP'];
-		$json['isQRCode']			 	= (int)$_POST['isQRCode'];
-		$json['isRFID']					= (int)$_POST['isRFID'];
-		$json['QRCodeMadeMode']			= (int)$_POST['QRCodeMadeMode'];
-		$json['QRCodeContent']			= $_POST['QRCodeContent'];
-		$json['Intensity']				= (int)$_POST['Intensity'];
-		$json['RfidCardNumEndian']		= $_POST['RfidCardNumEndian'];
-		$json['PsuAcInputType']			= $_POST['PsuAcInputType'];
-		
+		if($_POST['SystemId'] != ""){
+			$json['SystemId']				= $_POST["SystemId"];
+		}
+		if($_POST['SystemDateTime'] != ""){
+			$json['SystemDateTime']			= $_POST['SystemDateTime'];
+		}
+		if($_POST['PhaseLossPolicy'] != ""){
+			$json['PhaseLossPolicy']		= (int)$_POST['PhaseLossPolicy'];
+		}
+		if($_POST['FactoryConfiguration'] != ""){
+			$json['FactoryConfiguration']	= $_POST['FactoryConfiguration'];
+		}
+		if($_POST['AuthorisationMode'] != ""){
+			$json['AuthorisationMode']		= (int)$_POST['AuthorisationMode'];
+		}
+		if($_POST['isAPP'] != ""){
+			$json['isAPP']					= (int)$_POST['isAPP'];
+		}
+		if($_POST['isQRCode'] != ""){
+			$json['isQRCode']			 	= (int)$_POST['isQRCode'];
+		}
+		if($_POST['isRFID'] != ""){
+			$json['isRFID']					= (int)$_POST['isRFID'];
+		}
+		if($_POST['QRCodeMadeMode'] != ""){
+			$json['QRCodeMadeMode']			= (int)$_POST['QRCodeMadeMode'];
+		}
+		if($_POST['QRCodeContent'] != ""){
+			$json['QRCodeContent']			= $_POST['QRCodeContent'];
+		}
+		if($_POST['Intensity'] != ""){
+			$json['Intensity']				= (int)$_POST['Intensity'];
+		}
+		if($_POST['RfidCardNumEndian'] != ""){
+			$json['RfidCardNumEndian']		= $_POST['RfidCardNumEndian'];
+		}
+		if($_POST['PsuAcInputType'] != ""){
+			$json['PsuAcInputType']			= $_POST['PsuAcInputType'];
+		}
+
 //		ob_start();
 		shell_exec('sync;sync;sync');
 		chdir("/root");