Browse Source

2020-03-30 / ct_chen

Actions:
1. authorisation mode changed 0:enable, 1:disable

Files:
1. as list
ct_chen 5 years ago
parent
commit
232cd6a8f5

+ 289 - 64
EVSE/Modularization/WebService.c

@@ -43,8 +43,11 @@
 
 #define MtdBlockSize 0x600000
 
-struct SysConfigAndInfo *ShmSysConfigAndInfo;
-struct StatusCodeData *ShmStatusCodeData;
+struct SysConfigAndInfo		*ShmSysConfigAndInfo;
+struct StatusCodeData		*ShmStatusCodeData;
+struct CHAdeMOData			*ShmCHAdeMOData;
+struct GBTData				*ShmGBTData;
+struct CcsData				*ShmCcsData;
 
 void trim(char *s);
 int mystrcmp(char *p1, char *p2);
@@ -200,6 +203,11 @@ int ModelType(char* type,char* network){
 	}
 	return result;
 }
+// 四捨五入 取到 小數點第 2 位 
+float rounding(float a) 
+{
+    return (int)(a*100+0.5)/100.0;
+}
 //==========================================
 // Init all share memory
 //==========================================
@@ -341,6 +349,11 @@ int main(int argc, char *argv[]) {
 			// int DefaultLanguage = 0;
 			int RfidCardNumEndian = 0;
 			int PsuAcInputType = 0;
+			char isAPP = NULL;
+			char isQRCode = NULL;
+			char isRFID = NULL;
+			char QRCodeMadeMode = NULL;
+			char *QRCodeContent = NULL;
 
 			if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
 				SystemId = (char*)json_object_get_string(val_obj);
@@ -348,31 +361,43 @@ int main(int argc, char *argv[]) {
 			if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
 				SystemDateTime = (char*)json_object_get_string(val_obj);
 			}
-//			if( json_object_object_get_ex(jobj, "AcPhaseCount", &val_obj) ) {
-//				AcPhaseCount = json_object_get_int(val_obj);
-//			}
 			if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
 				FactoryConfiguration = json_object_get_int(val_obj);
 			}
 			if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
 				AuthorisationMode = json_object_get_int(val_obj);
 			}
-			// if( json_object_object_get_ex(jobj, "DefaultLanguage", &val_obj) ) {
-				// DefaultLanguage = json_object_get_int(val_obj);
-			// }
 			if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
 				RfidCardNumEndian = json_object_get_int(val_obj);
 			}
 			if( json_object_object_get_ex(jobj, "PsuAcInputType", &val_obj) ) {
 				PsuAcInputType = json_object_get_int(val_obj);
 			}
+			// if( json_object_object_get_ex(jobj, "isAPP", &val_obj) ) {
+				// isAPP = json_object_get_int(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "isQRCode", &val_obj) ) {
+				// isQRCode = json_object_get_int(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "isRFID", &val_obj) ) {
+				// isRFID = json_object_get_int(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "QRCodeMadeMode", &val_obj) ) {
+				// QRCodeMadeMode = json_object_get_int(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "QRCodeContent", &val_obj) ) {
+				// QRCodeContent = json_object_get_string(val_obj);
+			// }
 			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
-//			ShmSysConfigAndInfo->SysConfig.AcPhaseCount = AcPhaseCount;
 			ShmSysConfigAndInfo->SysInfo.FactoryConfiguration = FactoryConfiguration;
 			ShmSysConfigAndInfo->SysConfig.AuthorisationMode = AuthorisationMode;
-			// ShmSysConfigAndInfo->SysConfig.DefaultLanguage = DefaultLanguage;
 			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);
 
 			if(strlen(SystemDateTime)>0){
 				char cmd[100];
@@ -401,6 +426,32 @@ int main(int argc, char *argv[]) {
 			char *LocalWhiteCard7 = NULL;
 			char *LocalWhiteCard8 = NULL;
 			char *LocalWhiteCard9 = NULL;
+			char isBilling = 0;
+			char Currency = 0;
+			float Fee0 = 0;
+			float Fee1 = 0;
+			float Fee2 = 0;
+			float Fee3 = 0;
+			float Fee4 = 0;
+			float Fee5 = 0;
+			float Fee6 = 0;
+			float Fee7 = 0;
+			float Fee8 = 0;
+			float Fee9 = 0;
+			float Fee10 = 0;
+			float Fee11 = 0;
+			float Fee12 = 0;
+			float Fee13 = 0;
+			float Fee14 = 0;
+			float Fee15 = 0;
+			float Fee16 = 0;
+			float Fee17 = 0;
+			float Fee18 = 0;
+			float Fee19 = 0;
+			float Fee20 = 0;
+			float Fee21 = 0;
+			float Fee22 = 0;
+			float Fee23 = 0;
 
 			if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
 				MaxChargingEnergy = json_object_get_int(val_obj);
@@ -447,6 +498,84 @@ int main(int argc, char *argv[]) {
 			if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
 				LocalWhiteCard9 = (char*)json_object_get_string(val_obj);
 			}
+			// if( json_object_object_get_ex(jobj, "isBilling", &val_obj) ) {
+				// isBilling = json_object_get_int(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Currency", &val_obj) ) {
+				// Currency = json_object_get_int(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee0", &val_obj) ) {
+				// Fee0 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee1", &val_obj) ) {
+				// Fee1 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee2", &val_obj) ) {
+				// Fee2 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee3", &val_obj) ) {
+				// Fee3 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee4", &val_obj) ) {
+				// Fee4 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee5", &val_obj) ) {
+				// Fee5 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee6", &val_obj) ) {
+				// Fee6 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee7", &val_obj) ) {
+				// Fee7 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee8", &val_obj) ) {
+				// Fee8 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee9", &val_obj) ) {
+				// Fee9 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee10", &val_obj) ) {
+				// Fee10 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee11", &val_obj) ) {
+				// Fee11 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee12", &val_obj) ) {
+				// Fee12 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee13", &val_obj) ) {
+				// Fee13 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee14", &val_obj) ) {
+				// Fee14 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee15", &val_obj) ) {
+				// Fee15 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee16", &val_obj) ) {
+				// Fee16 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee17", &val_obj) ) {
+				// Fee17 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee18", &val_obj) ) {
+				// Fee18 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee19", &val_obj) ) {
+				// Fee19 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee20", &val_obj) ) {
+				// Fee20 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee21", &val_obj) ) {
+				// Fee21 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee22", &val_obj) ) {
+				// Fee22 = json_object_get_double(val_obj);
+			// }
+			// if( json_object_object_get_ex(jobj, "Fee23", &val_obj) ) {
+				// Fee23 = json_object_get_double(val_obj);
+			// }
 			ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
 			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
 			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
@@ -462,6 +591,32 @@ int main(int argc, char *argv[]) {
 			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]);
@@ -472,9 +627,6 @@ int main(int argc, char *argv[]) {
 			char *Eth0SubmaskAddress=NULL;
 			char *Eth0GatewayAddress=NULL;
 			int Eth1DhcpClient=0;
-			// char *Eth1IpAddress=NULL;
-			// char *Eth1SubmaskAddress=NULL;
-			// char *Eth1GatewayAddress=NULL;
 			int WifiMode=0;
 			char *WifiSsid=NULL;
 			char *WifiPassword=NULL;
@@ -487,9 +639,6 @@ int main(int argc, char *argv[]) {
 			char *TelcomChapPapId=NULL;
 			char *TelcomChapPapPwd=NULL;
 			char *TelcomIpAddress=NULL;
-			// if( json_object_object_get_ex(jobj, "FtpServer", &val_obj) ) {
-				// FtpServer = (char*)json_object_get_string(val_obj);
-			// }
 			if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
 				Eth0DhcpClient = json_object_get_int(val_obj);
 			}
@@ -502,18 +651,6 @@ int main(int argc, char *argv[]) {
 			if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
 				Eth0GatewayAddress = (char*)json_object_get_string(val_obj);
 			}
-			// if( json_object_object_get_ex(jobj, "Eth1DhcpClient", &val_obj) ) {
-				// Eth1DhcpClient = json_object_get_int(val_obj);
-			// }
-			// if( json_object_object_get_ex(jobj, "Eth1IpAddress", &val_obj) ) {
-				// Eth1IpAddress = (char*)json_object_get_string(val_obj);
-			// }
-			// if( json_object_object_get_ex(jobj, "Eth1SubmaskAddress", &val_obj) ) {
-				// Eth1SubmaskAddress = (char*)json_object_get_string(val_obj);
-			// }
-			// if( json_object_object_get_ex(jobj, "Eth1GatewayAddress", &val_obj) ) {
-				// Eth1GatewayAddress = (char*)json_object_get_string(val_obj);
-			// }
 			if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
 				WifiMode = json_object_get_int(val_obj);
 			}
@@ -551,15 +688,11 @@ int main(int argc, char *argv[]) {
 				TelcomIpAddress = (char*)json_object_get_string(val_obj);
 			}
 
-			// strcpy((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer,FtpServer);
 			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;
-			// strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,Eth1IpAddress);
-			// strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,Eth1SubmaskAddress);
-			// strcpy((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,Eth1GatewayAddress);
 			ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode=WifiMode;
 			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
 			strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
@@ -637,7 +770,7 @@ int main(int argc, char *argv[]) {
 		if (strcmp(argv[1], "aaa") == 0) {
 			//struct SysConfigData 	SysConfig;
 		//system
-		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DWLU770111T1P0D");
+		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ModelName, "DSLU601U1JT1P0D");
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber, "SerialNumber");
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemId, "1234567890");
 		strcpy((char *)&ShmSysConfigAndInfo->SysConfig.SystemDateTime, "2019-12-31 23:59:59");
@@ -821,28 +954,61 @@ int main(int argc, char *argv[]) {
 		char *Connector2[2];
 		char *Connector3[2];
 		char *Network[2];
+		unsigned char connector1FwVer[32];
+		unsigned char connector2FwVer[32];
+		short gunQty;
 		substr((char *)IsAcDc,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
 		substr((char *)Connector1,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
-		substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
-		substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
+		substr((char *)Connector2,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
+		substr((char *)Connector3,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
 		substr((char *)Network,(const char *)ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
 		int connectorType1,connectorType2,connectorType3;
 		connectorType1=ConnectorType((char *)Connector1);
 		connectorType2=ConnectorType((char *)Connector2);
 		connectorType3=ConnectorType((char *)Connector3);
-//		modelType=ModelType((char *)IsAcDc,(char *)Network);
-//		printf("modelType:%d\n",modelType);
+		if(connectorType1 == connectorType2){
+			gunQty = 1;
+		}
+		else{
+			gunQty = 0;
+		}
+		if(connectorType1 != 0){
+			if(connectorType1 == 1){
+				//strcpy((char *)&connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version);
+//				memcpy(connector1FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
+			}
+			else if(connectorType1 == 2){
+				//strcpy((char *)&connector1FwVer,ShmGBTData->evse[0].version);
+//				memcpy(connector1FwVer,ShmGBTData->evse[0].version,ARRAY_SIZE(ShmGBTData->evse[0].version));
+			}
+			else if(connectorType1 == 3){
+				//strcpy((char *)&connector1FwVer,ShmCHAdeMOData->evse[0].version);
+//				memcpy(connector1FwVer,ShmCHAdeMOData->evse[0].version,ARRAY_SIZE(ShmCHAdeMOData->evse[0].version));
+			}
+		}
+		if(connectorType2 != 0){
+			if(connectorType2 == 1){
+				//strcpy((char *)&connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version);
+//				memcpy(connector2FwVer,ShmCcsData->V2GMessage_DIN70121->version,ARRAY_SIZE(ShmCcsData->V2GMessage_DIN70121->version));
+			}
+			else if(connectorType2 == 2){
+				//strcpy((char *)&connector2FwVer,ShmGBTData->evse[gunQty].version);
+//				memcpy(connector2FwVer,ShmGBTData->evse[gunQty].version,ARRAY_SIZE(ShmGBTData->evse[gunQty].version));
+			}
+			else if(connectorType2 == 3){
+//				strcpy((char *)&connector2FwVer,ShmCHAdeMOData->evse[gunQty].version);
+//				memcpy(connector2FwVer,ShmCHAdeMOData->evse[gunQty].version,ARRAY_SIZE(ShmCHAdeMOData->evse[gunQty].version));
+			}
+		}
 
 		struct json_object *jobj1;
 		struct json_object *jobj2;
 		struct json_object *jobj3;
 		struct json_object *jobj4;
-//		struct json_object *array_obj;
 		//system
 		struct json_object *ModelName;
 		struct json_object *SerialNumber;
 		struct json_object *SystemId;
-//		struct json_object *SystemDateTime;
 		struct json_object *AcPhaseCount;
 		struct json_object *FactoryConfiguration;
 		struct json_object *AuthorisationMode;
@@ -855,6 +1021,12 @@ int main(int argc, char *argv[]) {
 		struct json_object *RfidCardNumEndian;
 		struct json_object *PsuAcInputType;
 		struct json_object *RatingCurrent;
+		struct json_object *AcRatingCurrent;
+		// struct json_object *isAPP;
+		// struct json_object *isQRCode;
+		// struct json_object *isRFID;
+		// struct json_object *QRCodeMadeMode;
+		// struct json_object *QRCodeContent;
 		struct json_object *AuxPower5V;
 		struct json_object *AuxPower12V;
 		struct json_object *AuxPower24V;
@@ -876,6 +1048,9 @@ int main(int argc, char *argv[]) {
 		struct json_object *RelayModuleHwRev;
 		struct json_object *RelayModuleFwRev;
 		struct json_object *TelcomModemFwRev;
+		struct json_object *Connector1FwRev;
+		struct json_object *Connector2FwRev;
+		struct json_object *LedModuleFwRev;
 		struct json_object *SystemAmbientTemp;
 		struct json_object *SystemCriticalTemp;
 		struct json_object *CcsConnectorTemp;
@@ -894,13 +1069,13 @@ int main(int argc, char *argv[]) {
 		struct json_object *PhaseLossPolicy;
 		struct json_object *LocalWhiteCard[10];
 		struct json_object *LocalWhiteCardArr= json_object_new_array();
-//		struct json_object *CcsAuthentication;
-//		struct json_object *AcCcsChargingMode;
-//		struct json_object *UserId;
+		// struct json_object *isBilling;
+		// struct json_object *Currency;
+		// struct json_object *Fee[24];
+		// struct json_object *FeeArr= json_object_new_array();
 		struct json_object *ChargingInfo1;
 		struct json_object *ChargingInfo2;
 		struct json_object *ChargingInfo3;
-//		struct json_object *CardNumber[3];
 		struct json_object *StartUserId[3];
 		struct json_object *StartDateTime[3];
 		struct json_object *StopDateTime[3];
@@ -965,7 +1140,6 @@ int main(int argc, char *argv[]) {
 		struct json_object *ChargeBoxId;
 		struct json_object *chargePointVendor;
 
-//		array_obj = json_object_new_array();
 		jobj1=json_object_new_object();
 		jobj2=json_object_new_object();
 		jobj3=json_object_new_object();
@@ -974,7 +1148,6 @@ int main(int argc, char *argv[]) {
 		ModelName = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ModelName);
 		SerialNumber = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SerialNumber);
 		SystemId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.SystemId);
-//		SystemDateTime = json_object_new_string(ShmSysConfigAndInfo->SysConfig.SystemDateTime);
 		AcPhaseCount = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcPhaseCount);
 		FactoryConfiguration = json_object_new_int(ShmSysConfigAndInfo->SysInfo.FactoryConfiguration);
 		AuthorisationMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AuthorisationMode);
@@ -987,6 +1160,12 @@ int main(int argc, char *argv[]) {
 		RfidCardNumEndian = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian);
 		PsuAcInputType = json_object_new_int(ShmSysConfigAndInfo->SysConfig.PsuAcInputType);
 		RatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.RatingCurrent);
+		// AcRatingCurrent = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AcRatingCurrent);
+		// isAPP = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isAPP);
+		// isQRCode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isQRCode);
+		// isRFID = json_object_new_int(ShmSysConfigAndInfo->SysConfig.isRFID);
+		// QRCodeMadeMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.QRCodeMadeMode);
+		// QRCodeContent = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.QRCodeContent);
 		AuxPower5V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower5V);
 		AuxPower12V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower12V);
 		AuxPower24V = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AuxPower24V);
@@ -1008,6 +1187,9 @@ int main(int argc, char *argv[]) {
 		RelayModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
 		RelayModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
 		TelcomModemFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
+		// Connector1FwRev = json_object_new_string((char *)&connector1FwVer);
+		// Connector2FwRev = json_object_new_string((char *)&connector2FwVer);
+		//LedModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LedModuleFwRev);
 		SystemAmbientTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
 		SystemCriticalTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
 		CcsConnectorTemp = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
@@ -1041,7 +1223,32 @@ int main(int argc, char *argv[]) {
 		LocalWhiteCard[7] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
 		LocalWhiteCard[8] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
 		LocalWhiteCard[9] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
-		//UserId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.UserId);
+		// isBilling = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.isBilling);
+		// Currency = json_object_new_int(ShmSysConfigAndInfo->SysConfig.BillingData.Currency);
+		// Fee[0] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[0]);
+		// Fee[1] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[1]);
+		// Fee[2] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[2]);
+		// Fee[3] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[3]);
+		// Fee[4] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[4]);
+		// Fee[5] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[5]);
+		// Fee[6] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[6]);
+		// Fee[7] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[7]);
+		// Fee[8] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[8]);
+		// Fee[9] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[9]);
+		// Fee[10] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[10]);
+		// Fee[11] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[11]);
+		// Fee[12] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[12]);
+		// Fee[13] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[13]);
+		// Fee[14] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[14]);
+		// Fee[15] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[15]);
+		// Fee[16] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[16]);
+		// Fee[17] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[17]);
+		// Fee[18] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[18]);
+		// Fee[19] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[19]);
+		// Fee[20] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[20]);
+		// Fee[21] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[21]);
+		// Fee[22] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[22]);
+		// Fee[23] = json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[23]);
 		if(connectorType1 != 0){
 			if(connectorType1 == 1){//CCS
 				PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
@@ -1058,7 +1265,6 @@ int main(int argc, char *argv[]) {
 				Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
 				type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
 				EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
-//				CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].CardNumber);
 				StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
 				StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
 				StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
@@ -1081,7 +1287,6 @@ int main(int argc, char *argv[]) {
 				Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
 				type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
 				EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
-//				CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].CardNumber);
 				StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
 				StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
 				StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
@@ -1104,7 +1309,6 @@ int main(int argc, char *argv[]) {
 				Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
 				type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
 				EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
-//				CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].CardNumber);
 				StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
 				StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
 				StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
@@ -1127,7 +1331,6 @@ int main(int argc, char *argv[]) {
 				Type[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
 				type_index[0] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
 				EvBatterytargetCurrent[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
-//				CardNumber[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].CardNumber);
 				StartUserId[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
 				StartDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
 				StopDateTime[0] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
@@ -1152,7 +1355,6 @@ int main(int argc, char *argv[]) {
 				Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
 				type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
 				EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
-//				CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].CardNumber);
 				StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
@@ -1175,7 +1377,6 @@ int main(int argc, char *argv[]) {
 				Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
 				type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
 				EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
-//				CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].CardNumber);
 				StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
@@ -1198,7 +1399,6 @@ int main(int argc, char *argv[]) {
 				Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
 				type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
 				EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
-//				CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].CardNumber);
 				StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
@@ -1221,7 +1421,6 @@ int main(int argc, char *argv[]) {
 				Type[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
 				type_index[1] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
 				EvBatterytargetCurrent[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
-//				CardNumber[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].CardNumber);
 				StartUserId[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
 				StartDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
 				StopDateTime[1] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
@@ -1246,7 +1445,6 @@ int main(int argc, char *argv[]) {
 				Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type);
 				type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index);
 				EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent);
-//				CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].CardNumber);
 				StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartUserId);
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].StopDateTime);
@@ -1269,7 +1467,6 @@ int main(int argc, char *argv[]) {
 				Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].Type);
 				type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].type_index);
 				EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetCurrent);
-//				CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].CardNumber);
 				StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartUserId);
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].StopDateTime);
@@ -1292,7 +1489,6 @@ int main(int argc, char *argv[]) {
 				Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].Type);
 				type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].type_index);
 				EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetCurrent);
-//				CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].CardNumber);
 				StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartUserId);
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].StopDateTime);
@@ -1315,7 +1511,6 @@ int main(int argc, char *argv[]) {
 				Type[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].Type);
 				type_index[2] = json_object_new_int(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].type_index);
 				EvBatterytargetCurrent[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].EvBatterytargetCurrent);
-//				CardNumber[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].CardNumber);
 				StartUserId[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartUserId);
 				StartDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StartDateTime);
 				StopDateTime[2] = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AcChargingData[AcGunQty].StopDateTime);
@@ -1374,7 +1569,6 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj1,"ModelName",ModelName);
 		json_object_object_add(jobj1,"SerialNumber",SerialNumber);
 		json_object_object_add(jobj1,"SystemId",SystemId);
-//		json_object_object_add(jobj1,"SystemDateTime",SystemDateTime);
 		json_object_object_add(jobj1,"AcPhaseCount",AcPhaseCount);
 		json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
 		json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
@@ -1387,6 +1581,12 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj1,"RfidCardNumEndian",RfidCardNumEndian);
 		json_object_object_add(jobj1,"PsuAcInputType",PsuAcInputType);
 		json_object_object_add(jobj1,"RatingCurrent",RatingCurrent);
+		// json_object_object_add(jobj1,"AcRatingCurrent",AcRatingCurrent);
+		// json_object_object_add(jobj1,"isAPP",isAPP);
+		// json_object_object_add(jobj1,"isQRCode",isQRCode);
+		// json_object_object_add(jobj1,"isRFID",isRFID);
+		// json_object_object_add(jobj1,"QRCodeMadeMode",QRCodeMadeMode);
+		// json_object_object_add(jobj1,"QRCodeContent",QRCodeContent);
 		json_object_object_add(jobj1,"AuxPower5V",AuxPower5V);
 		json_object_object_add(jobj1,"AuxPower12V",AuxPower12V);
 		json_object_object_add(jobj1,"AuxPower24V",AuxPower24V);
@@ -1408,6 +1608,9 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj1,"RelayModuleHwRev",RelayModuleHwRev);
 		json_object_object_add(jobj1,"RelayModuleFwRev",RelayModuleFwRev);
 		json_object_object_add(jobj1,"TelcomModemFwRev",TelcomModemFwRev);
+		// json_object_object_add(jobj1,"Connector1FwRev",Connector1FwRev);
+		// json_object_object_add(jobj1,"Connector2FwRev",Connector2FwRev);
+		// json_object_object_add(jobj1,"LedModuleFwRev",LedModuleFwRev);
 		json_object_object_add(jobj1,"SystemAmbientTemp",SystemAmbientTemp);
 		json_object_object_add(jobj1,"SystemCriticalTemp",SystemCriticalTemp);
 		json_object_object_add(jobj1,"CcsConnectorTemp",CcsConnectorTemp);
@@ -1437,10 +1640,34 @@ int main(int argc, char *argv[]) {
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[8]);
 		json_object_array_add(LocalWhiteCardArr,LocalWhiteCard[9]);
 		json_object_object_add(jobj2,"LocalWhiteCard",LocalWhiteCardArr);
-//		json_object_object_add(jobj2,"CcsAuthentication",CcsAuthentication);
-//		json_object_object_add(jobj2,"AcCcsChargingMode",AcCcsChargingMode);
+		// json_object_object_add(jobj2,"isBilling",isBilling);
+		// json_object_object_add(jobj2,"Currency",Currency);
+		// json_object_array_add(FeeArr,Fee[0]);
+		// json_object_array_add(FeeArr,Fee[1]);
+		// json_object_array_add(FeeArr,Fee[2]);
+		// json_object_array_add(FeeArr,Fee[3]);
+		// json_object_array_add(FeeArr,Fee[4]);
+		// json_object_array_add(FeeArr,Fee[5]);
+		// json_object_array_add(FeeArr,Fee[6]);
+		// json_object_array_add(FeeArr,Fee[7]);
+		// json_object_array_add(FeeArr,Fee[8]);
+		// json_object_array_add(FeeArr,Fee[9]);
+		// json_object_array_add(FeeArr,Fee[10]);
+		// json_object_array_add(FeeArr,Fee[11]);
+		// json_object_array_add(FeeArr,Fee[12]);
+		// json_object_array_add(FeeArr,Fee[13]);
+		// json_object_array_add(FeeArr,Fee[14]);
+		// json_object_array_add(FeeArr,Fee[15]);
+		// json_object_array_add(FeeArr,Fee[16]);
+		// json_object_array_add(FeeArr,Fee[17]);
+		// json_object_array_add(FeeArr,Fee[18]);
+		// json_object_array_add(FeeArr,Fee[19]);
+		// json_object_array_add(FeeArr,Fee[20]);
+		// json_object_array_add(FeeArr,Fee[21]);
+		// json_object_array_add(FeeArr,Fee[22]);
+		// json_object_array_add(FeeArr,Fee[23]);
+		// json_object_object_add(jobj2,"Fee",FeeArr);
 		if(connectorType1 != 0){
-//			json_object_object_add(ChargingInfo1,"CardNumber",CardNumber[0]);
 			json_object_object_add(ChargingInfo1,"StartUserId",StartUserId[0]);
 			json_object_object_add(ChargingInfo1,"StartDateTime",StartDateTime[0]);
 			json_object_object_add(ChargingInfo1,"StopDateTime",StopDateTime[0]);
@@ -1463,7 +1690,6 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(jobj2,"ChargingInfo1",ChargingInfo1);
 		}
 		if(connectorType2 != 0){
-//			json_object_object_add(ChargingInfo2,"CardNumber",CardNumber[1]);
 			json_object_object_add(ChargingInfo2,"StartUserId",StartUserId[1]);
 			json_object_object_add(ChargingInfo2,"StartDateTime",StartDateTime[1]);
 			json_object_object_add(ChargingInfo2,"StopDateTime",StopDateTime[1]);
@@ -1486,7 +1712,6 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(jobj2,"ChargingInfo2",ChargingInfo2);
 		}
 		if(connectorType3 != 0){
-//			json_object_object_add(ChargingInfo3,"CardNumber",CardNumber[2]);
 			json_object_object_add(ChargingInfo3,"StartUserId",StartUserId[2]);
 			json_object_object_add(ChargingInfo3,"StartDateTime",StartDateTime[2]);
 			json_object_object_add(ChargingInfo3,"StopDateTime",StopDateTime[2]);

+ 62 - 4
EVSE/Projects/define.h

@@ -149,8 +149,8 @@ enum SYSTEM_STATUS
 
 enum AUTHORIZATION_MODE
 {
-	AUTH_MODE_BACKEND_OCPP		= 0,
-	AUTH_MODE_FREE			= 1
+	AUTH_MODE_ENABLE		= 0,
+	AUTH_MODE_DISABLE		= 1
 };
 
 enum LCD_LANGUAGE
@@ -301,7 +301,7 @@ struct BillingConfigData
 {
 	unsigned char		isBilling;					//0:not for business	1:for business
 	unsigned char		Currency;					//
-	unsigned short		Fee[24];					//fee for 24 hours
+	float				Fee[24];					//fee for 24 hours
 };
 
 struct SysConfigData
@@ -313,7 +313,7 @@ struct SysConfigData
 	unsigned char			SystemId[128];				//charger system ID
 	unsigned char			SystemDateTime[32];			//charger system date and time
 	unsigned char			AcPhaseCount;				//AC EVSE power phase quantity,  1: One phase	3: Three phase
-	unsigned char			AuthorisationMode;			//0: OCPP backend, 1: free mode
+	unsigned char			AuthorisationMode;			//0: enable, 1: disable
 	unsigned char			DefaultLanguage;			//
 	unsigned char			RfidCardNumEndian;			//0: little endian,  1: big endian
 	unsigned short			AcPlugInTimes;				//0~65535
@@ -503,6 +503,64 @@ struct SysConfigAndInfo
 	struct WARNING_CODE_INFO			SysWarningInfo;
 };
 
+char Currency[54][3]=
+{
+	"AED",	// - Emirati Dirham
+	"ARS",	// - Argentine Peso
+	"AUD",	// - Australian Dollar
+	"BGN",	// - Bulgarian Lev
+	"BHD",	// - Bahraini Dinar
+	"BND",	// - Bruneian Dollar
+	"BRL",	// - Brazilian Real
+	"BWP",	// - Botswana Pula
+	"CAD",	// - Canadian Dollar
+	"CHF",	// - Swiss Franc
+	"CLP",	// - Chilean Peso
+	"CNY",	// - Chinese Yuan Renminbi
+	"COP",	// - Colombian Peso
+	"CZK",	// - Czech Koruna
+	"DKK",	// - Danish Krone
+	"EUR",	// - Euro
+	"GBP",	// - British Pound
+	"HKD",	// - Hong Kong Dollar
+	"HRK",	// - Croatian Kuna
+	"HUF",	// - Hungarian Forint
+	"IDR",	// - Indonesian Rupiah
+	"ILS",	// - Israeli Shekel
+	"INR",	// - Indian Rupee
+	"IRR",	// - Iranian Rial
+	"ISK",	// - Icelandic Krona
+	"JPY",	// - Japanese Yen
+	"KRW",	// - South Korean Won
+	"KWD",	// - Kuwaiti Dinar
+	"KZT",	// - Kazakhstani Tenge
+	"LKR",	// - Sri Lankan Rupee
+	"LYD",	// - Libyan Dinar
+	"MUR",	// - Mauritian Rupee
+	"MXN",	// - Mexican Peso
+	"MYR",	// - Malaysian Ringgit
+	"NOK",	// - Norwegian Krone
+	"NPR",	// - Nepalese Rupee
+	"NZD",	// - New Zealand Dollar
+	"OMR",	// - Omani Rial
+	"PHP",	// - Philippine Peso
+	"PKR",	// - Pakistani Rupee
+	"PLN",	// - Polish Zloty
+	"QAR",	// - Qatari Riyal
+	"RON",	// - Romanian New Leu
+	"RUB",	// - Russian Ruble
+	"SAR",	// - Saudi Arabian Riyal
+	"SEK",	// - Swedish Krona
+	"SGD",	// - Singapore Dollar
+	"THB",	// - Thai Baht
+	"TRY",	// - Turkish Lira
+	"TTD",	// - Trinidadian Dollar
+	"TWD",	// - Taiwan New Dollar
+	"USD",	// - US Dollar
+	"VEF",	// - Venezuelan Bolivar
+	"ZAR"	// - South African Rand	
+};
+
 /**************************************************************************************/
 /**************************Alarm Share memory**************************************/
 /***************************************************************************************

+ 256 - 10
EVSE/rootfs/var/www/set_charging.php

@@ -5,6 +5,7 @@
 	$obj = json_decode(trim($output[1]),true);//var_dump($obj);
 	$system = json_decode(trim($output[0]),true);//var_dump($obj);
 	$RatingCurrent = $system['RatingCurrent'];
+	$AcRatingCurrent = $system['AcRatingCurrent'];
 	$ModelName = $system['ModelName'];
 	$RatingPower = substr($ModelName,4,2)*pow(10,-1+substr($ModelName,6,1));
 	$Connector1=substr($ModelName,7,1);
@@ -266,7 +267,7 @@ img {
 		<!--
 		Main Content start
 		//-->
-		<a id="loadinghref"><div id="loading" style="display:none;"><img src="img/giphy.gif"/></div></a>
+		<a id="loadinghref"><div id="loading" style="display:none;"><input type="hidden" name="ModelName" id="ModelName" value="<?php echo $ModelName;?>"><img src="img/giphy.gif"/></div></a>
 		<section class="envor-section">
 			<div class="container">
 				<div class="row">
@@ -297,6 +298,13 @@ img {
 											<input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $RatingCurrent;?>">
 											<small class="form-text text-muted-red"><label id="MaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
 										</div>
+										<div class="form-group" id="AcMaxChargingCurrentDiv">
+											<label>AC Max Charging Current</label>
+											<small class="form-text text-muted-red">amp</small>
+											<input type="text" name="AcMaxChargingCurrent" id="AcMaxChargingCurrent" class="form-control" value="<?php echo $obj['AcMaxChargingCurrent'];?>" placeholder="<?php echo ($obj['AcMaxChargingCurrent']==0||$obj['AcMaxChargingCurrent']=="")?"'0' means unlimit":"";?>" title="'0' means unlimit" onchange="MaxValue_changed(document.getElementById('AcMaxChargingCurrent').id,document.getElementById('AcMaxChargingCurrentText').id);">
+											<input type="hidden" name="AcRatingCurrent" id="AcRatingCurrent" value="<?php echo $AcRatingCurrent;?>">
+											<small class="form-text text-muted-red"><label id="AcMaxChargingCurrentText" style="display:none;">'0' means unlimit</label></small>
+										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>Max Charging Duration</label>
 											<small class="form-text text-muted-red">minutes</small>
@@ -350,6 +358,169 @@ img {
 											<label>Local White Card9</label>
 											<input type="text" name="LocalWhiteCard9" id="LocalWhiteCard9" class="form-control" value="<?php echo $obj['LocalWhiteCard'][9];?>">
 										</div>
+<?php /* LCM UI 相關參數
+										<div class="form-group"  id="isBillingDiv">
+											<label>
+											<input type="checkbox" id="isBilling" name="isBilling" <?php echo $obj['isBilling']==1?"checked":"";?> onclick="isBilling_clicked()">
+											Billing</label>
+										</div>
+										<div class="form-group" id="CurrencyDiv">
+											<label>Currency</label>
+											<select class="form-control" id="Currency" name="Currency">
+												<option value="1" <?php echo $obj['Currency']=="1"?"selected":""?>>AED - Emirati Dirham</option>
+												<option value="2" <?php echo $obj['Currency']=="2"?"selected":""?>>ARS - Argentine Peso</option>
+												<option value="3" <?php echo $obj['Currency']=="3"?"selected":""?>>AUD - Australian Dollar</option>
+												<option value="4" <?php echo $obj['Currency']=="4"?"selected":""?>>BGN - Bulgarian Lev</option>
+												<option value="5" <?php echo $obj['Currency']=="5"?"selected":""?>>BHD - Bahraini Dinar</option>
+												<option value="6" <?php echo $obj['Currency']=="6"?"selected":""?>>BND - Bruneian Dollar</option>
+												<option value="7" <?php echo $obj['Currency']=="7"?"selected":""?>>BRL - Brazilian Real</option>
+												<option value="8" <?php echo $obj['Currency']=="8"?"selected":""?>>BWP - Botswana Pula</option>
+												<option value="9" <?php echo $obj['Currency']=="9"?"selected":""?>>CAD - Canadian Dollar</option>
+												<option value="10" <?php echo $obj['Currency']=="10"?"selected":""?>>CHF - Swiss Franc</option>
+												<option value="11" <?php echo $obj['Currency']=="11"?"selected":""?>>CLP - Chilean Peso</option>
+												<option value="12" <?php echo $obj['Currency']=="12"?"selected":""?>>CNY - Chinese Yuan Renminbi</option>
+												<option value="13" <?php echo $obj['Currency']=="13"?"selected":""?>>COP - Colombian Peso</option>
+												<option value="14" <?php echo $obj['Currency']=="14"?"selected":""?>>CZK - Czech Koruna</option>
+												<option value="15" <?php echo $obj['Currency']=="15"?"selected":""?>>DKK - Danish Krone</option>
+												<option value="16" <?php echo $obj['Currency']=="16"?"selected":""?>>EUR - Euro</option>
+												<option value="17" <?php echo $obj['Currency']=="17"?"selected":""?>>GBP - British Pound</option>
+												<option value="18" <?php echo $obj['Currency']=="18"?"selected":""?>>HKD - Hong Kong Dollar</option>
+												<option value="19" <?php echo $obj['Currency']=="19"?"selected":""?>>HRK - Croatian Kuna</option>
+												<option value="20" <?php echo $obj['Currency']=="20"?"selected":""?>>HUF - Hungarian Forint</option>
+												<option value="21" <?php echo $obj['Currency']=="21"?"selected":""?>>IDR - Indonesian Rupiah</option>
+												<option value="22" <?php echo $obj['Currency']=="22"?"selected":""?>>ILS - Israeli Shekel</option>
+												<option value="23" <?php echo $obj['Currency']=="23"?"selected":""?>>INR - Indian Rupee</option>
+												<option value="24" <?php echo $obj['Currency']=="24"?"selected":""?>>IRR - Iranian Rial</option>
+												<option value="25" <?php echo $obj['Currency']=="25"?"selected":""?>>ISK - Icelandic Krona</option>
+												<option value="26" <?php echo $obj['Currency']=="26"?"selected":""?>>JPY - Japanese Yen</option>
+												<option value="27" <?php echo $obj['Currency']=="27"?"selected":""?>>KRW - South Korean Won</option>
+												<option value="28" <?php echo $obj['Currency']=="28"?"selected":""?>>KWD - Kuwaiti Dinar</option>
+												<option value="29" <?php echo $obj['Currency']=="29"?"selected":""?>>KZT - Kazakhstani Tenge</option>
+												<option value="30" <?php echo $obj['Currency']=="30"?"selected":""?>>LKR - Sri Lankan Rupee</option>
+												<option value="31" <?php echo $obj['Currency']=="31"?"selected":""?>>LYD - Libyan Dinar</option>
+												<option value="32" <?php echo $obj['Currency']=="32"?"selected":""?>>MUR - Mauritian Rupee</option>
+												<option value="33" <?php echo $obj['Currency']=="33"?"selected":""?>>MXN - Mexican Peso</option>
+												<option value="34" <?php echo $obj['Currency']=="34"?"selected":""?>>MYR - Malaysian Ringgit</option>
+												<option value="35" <?php echo $obj['Currency']=="35"?"selected":""?>>NOK - Norwegian Krone</option>
+												<option value="36" <?php echo $obj['Currency']=="36"?"selected":""?>>NPR - Nepalese Rupee</option>
+												<option value="37" <?php echo $obj['Currency']=="37"?"selected":""?>>NZD - New Zealand Dollar</option>
+												<option value="38" <?php echo $obj['Currency']=="38"?"selected":""?>>OMR - Omani Rial</option>
+												<option value="39" <?php echo $obj['Currency']=="39"?"selected":""?>>PHP - Philippine Peso</option>
+												<option value="40" <?php echo $obj['Currency']=="40"?"selected":""?>>PKR - Pakistani Rupee</option>
+												<option value="41" <?php echo $obj['Currency']=="41"?"selected":""?>>PLN - Polish Zloty</option>
+												<option value="42" <?php echo $obj['Currency']=="42"?"selected":""?>>QAR - Qatari Riyal</option>
+												<option value="43" <?php echo $obj['Currency']=="43"?"selected":""?>>RON - Romanian New Leu</option>
+												<option value="44" <?php echo $obj['Currency']=="44"?"selected":""?>>RUB - Russian Ruble</option>
+												<option value="45" <?php echo $obj['Currency']=="45"?"selected":""?>>SAR - Saudi Arabian Riyal</option>
+												<option value="46" <?php echo $obj['Currency']=="46"?"selected":""?>>SEK - Swedish Krona</option>
+												<option value="47" <?php echo $obj['Currency']=="47"?"selected":""?>>SGD - Singapore Dollar</option>
+												<option value="48" <?php echo $obj['Currency']=="48"?"selected":""?>>THB - Thai Baht</option>
+												<option value="49" <?php echo $obj['Currency']=="49"?"selected":""?>>TRY - Turkish Lira</option>
+												<option value="50" <?php echo $obj['Currency']=="50"?"selected":""?>>TTD - Trinidadian Dollar</option>
+												<option value="51" <?php echo $obj['Currency']=="51"?"selected":""?>>TWD - Taiwan New Dollar</option>
+												<option value="52" <?php echo $obj['Currency']=="52"?"selected":""?>>USD - US Dollar</option>
+												<option value="53" <?php echo $obj['Currency']=="53"?"selected":""?>>VEF - Venezuelan Bolivar</option>
+												<option value="54" <?php echo $obj['Currency']=="54"?"selected":""?>>ZAR - South African Rand</option>
+											</select>
+										</div>
+										<div class="form-group" id="FeeDiv">
+											<div class="form-group">
+												<label>Fee 00:00~00:59</label>
+												<input type="text" name="Fee0" id="Fee0" class="form-control" value="<?php echo round($obj['Fee'][0],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 01:00~01:59</label>
+												<input type="text" name="Fee0" id="Fee1" class="form-control" value="<?php echo round($obj['Fee'][1],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 02:00~02:59</label>
+												<input type="text" name="Fee2" id="Fee2" class="form-control" value="<?php echo round($obj['Fee'][2],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 03:00~03:59</label>
+												<input type="text" name="Fee3" id="Fee3" class="form-control" value="<?php echo round($obj['Fee'][3],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 04:00~04:59</label>
+												<input type="text" name="Fee4" id="Fee4" class="form-control" value="<?php echo round($obj['Fee'][4],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 05:00~05:59</label>
+												<input type="text" name="Fee5" id="Fee5" class="form-control" value="<?php echo round($obj['Fee'][5],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 06:00~06:59</label>
+												<input type="text" name="Fee6" id="Fee6" class="form-control" value="<?php echo round($obj['Fee'][6],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 07:00~07:59</label>
+												<input type="text" name="Fee7" id="Fee7" class="form-control" value="<?php echo round($obj['Fee'][7],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 08:00~08:59</label>
+												<input type="text" name="Fee8" id="Fee8" class="form-control" value="<?php echo round($obj['Fee'][8],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 09:00~09:59</label>
+												<input type="text" name="Fee9" id="Fee9" class="form-control" value="<?php echo round($obj['Fee'][9],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 10:00~10:59</label>
+												<input type="text" name="Fee10" id="Fee10" class="form-control" value="<?php echo round($obj['Fee'][10],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 11:00~11:59</label>
+												<input type="text" name="Fee11" id="Fee11" class="form-control" value="<?php echo round($obj['Fee'][11],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 12:00~12:59</label>
+												<input type="text" name="Fee12" id="Fee12" class="form-control" value="<?php echo round($obj['Fee'][12],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 13:00~13:59</label>
+												<input type="text" name="Fee13" id="Fee13" class="form-control" value="<?php echo round($obj['Fee'][13],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 14:00~14:59</label>
+												<input type="text" name="Fee14" id="Fee14" class="form-control" value="<?php echo round($obj['Fee'][14],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 15:00~15:59</label>
+												<input type="text" name="Fee15" id="Fee15" class="form-control" value="<?php echo round($obj['Fee'][15],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 16:00~16:59</label>
+												<input type="text" name="Fee16" id="Fee16" class="form-control" value="<?php echo round($obj['Fee'][16],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 17:00~17:59</label>
+												<input type="text" name="Fee17" id="Fee17" class="form-control" value="<?php echo round($obj['Fee'][17],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 18:00~18:59</label>
+												<input type="text" name="Fee18" id="Fee18" class="form-control" value="<?php echo round($obj['Fee'][18],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 19:00~19:59</label>
+												<input type="text" name="Fee19" id="Fee19" class="form-control" value="<?php echo round($obj['Fee'][19],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 20:00~20:59</label>
+												<input type="text" name="Fee20" id="Fee20" class="form-control" value="<?php echo round($obj['Fee'][20],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 21:00~21:59</label>
+												<input type="text" name="Fee21" id="Fee21" class="form-control" value="<?php echo round($obj['Fee'][21],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 22:00~22:59</label>
+												<input type="text" name="Fee22" id="Fee22" class="form-control" value="<?php echo round($obj['Fee'][22],2);?>">
+											</div>
+											<div class="form-group">
+												<label>Fee 23:00~23:59</label>
+												<input type="text" name="Fee23" id="Fee23" class="form-control" value="<?php echo round($obj['Fee'][23],2);?>">
+											</div>
+										</div>*/?>
 <?php /*										<div class="form-group" style="display:<?php echo $am111;?>">
 											<label>CcsAuthentication</label>
 											<select class="form-control" id="CcsAuthentication" name="CcsAuthentication">
@@ -644,6 +815,16 @@ img {
 		if(document.getElementById("MaxChargingDuration").value=="0" || document.getElementById("MaxChargingDuration").value==""){
 			document.getElementById("MaxChargingDurationText").style.display="block";
 		}
+		if(document.getElementById("ModelName").value.substr(8,1) != "0"){
+			document.getElementById("AcMaxChargingCurrentDiv").style.display="block";
+			if(document.getElementById("AcMaxChargingCurrent").value=="0" || document.getElementById("AcMaxChargingCurrent").value==""){
+				document.getElementById("AcMaxChargingCurrentText").style.display="block";
+			}
+		}
+		else{
+			document.getElementById("AcMaxChargingCurrentDiv").style.display="none";
+		}
+//		isBilling_clicked();
 	});
 
 	document.getElementById("save").onclick = function() {
@@ -659,6 +840,7 @@ img {
 			var data =  "MaxChargingEnergy=" + document.getElementById("MaxChargingEnergy").value +
 						"&MaxChargingPower=" + document.getElementById("MaxChargingPower").value +
 						"&MaxChargingCurrent=" + document.getElementById("MaxChargingCurrent").value+
+						"&AcMaxChargingCurrent=" + document.getElementById("AcMaxChargingCurrent").value+
 						"&MaxChargingDuration=" + document.getElementById("MaxChargingDuration").value+
 						"&PhaseLossPolicy=" + document.getElementById("PhaseLossPolicy").value+
 						"&LocalWhiteCard0=" + document.getElementById("LocalWhiteCard0").value+
@@ -671,8 +853,32 @@ img {
 						"&LocalWhiteCard7=" + document.getElementById("LocalWhiteCard7").value+
 						"&LocalWhiteCard8=" + document.getElementById("LocalWhiteCard8").value+
 						"&LocalWhiteCard9=" + document.getElementById("LocalWhiteCard9").value;
-//						"&CcsAuthentication=" + document.getElementById("CcsAuthentication").value+
-//						"&AcCcsChargingModel=" + document.getElementById("AcCcsChargingModel").value;
+						// "&isBilling=" + (document.getElementById("isBilling").checked?1:0)+
+						// "&Currency=" + document.getElementById("Currency").value+
+						// "&Fee0=" + document.getElementById("Fee0").value+
+						// "&Fee1=" + document.getElementById("Fee1").value+
+						// "&Fee2=" + document.getElementById("Fee2").value+
+						// "&Fee3=" + document.getElementById("Fee3").value+
+						// "&Fee4=" + document.getElementById("Fee4").value+
+						// "&Fee5=" + document.getElementById("Fee5").value+
+						// "&Fee6=" + document.getElementById("Fee6").value+
+						// "&Fee7=" + document.getElementById("Fee7").value+
+						// "&Fee8=" + document.getElementById("Fee8").value+
+						// "&Fee9=" + document.getElementById("Fee9").value+
+						// "&Fee10=" + document.getElementById("Fee10").value+
+						// "&Fee11=" + document.getElementById("Fee11").value+
+						// "&Fee12=" + document.getElementById("Fee12").value+
+						// "&Fee13=" + document.getElementById("Fee13").value+
+						// "&Fee14=" + document.getElementById("Fee14").value+
+						// "&Fee15=" + document.getElementById("Fee15").value+
+						// "&Fee16=" + document.getElementById("Fee16").value+
+						// "&Fee17=" + document.getElementById("Fee17").value+
+						// "&Fee18=" + document.getElementById("Fee18").value+
+						// "&Fee19=" + document.getElementById("Fee19").value+
+						// "&Fee20=" + document.getElementById("Fee20").value+
+						// "&Fee21=" + document.getElementById("Fee21").value+
+						// "&Fee22=" + document.getElementById("Fee22").value+
+						// "&Fee23=" + document.getElementById("Fee23").value;
 			
 			// POST 請求必須設置表頭在 open() 下面,send() 上面
 			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -712,6 +918,7 @@ img {
 		var MaxChargingEnergy = document.getElementById("MaxChargingEnergy").value;
 		var MaxChargingPower = document.getElementById("MaxChargingPower").value;
 		var MaxChargingCurrent = document.getElementById("MaxChargingCurrent").value;
+		var AcMaxChargingCurrent = document.getElementById("AcMaxChargingCurrent").value;
 		var MaxChargingDuration = document.getElementById("MaxChargingDuration").value;
 		
 		if(LocalWhiteCard0 != ""){
@@ -786,20 +993,32 @@ img {
 		}
 		if(MaxChargingEnergy >65535)
 		{
-			alert("MaxChargingEnergy must <= 65535!");
+			alert("Max Charging Energy must <= 65535!");
 			document.getElementById("MaxChargingEnergy").focus();
 			return false;
 		}
 		if(MaxChargingEnergy < 0)
 		{
-			alert("MaxChargingEnergy must >= 0!");
+			alert("Max Charging Energy must >= 0!");
 			document.getElementById("MaxChargingEnergy").focus();
 			return false;
 		}
+		if(AcMaxChargingCurrent >65535)
+		{
+			alert("Ac Max Charging Current must <= 65535!");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
+		if(AcMaxChargingCurrent < 0)
+		{
+			alert("Ac Max Charging Current must >= 0!");
+			document.getElementById("MaxChargingCurrent").focus();
+			return false;
+		}
 		if(RatingPower!="" && RatingPower!=0){
 			if(MaxChargingPower > RatingPower)
 			{
-				alert("MaxChargingPower must be less than RatingPower("+RatingPower+")!");
+				alert("Max Charging Power must be less than RatingPower("+RatingPower+")!");
 				document.getElementById("MaxChargingPower").focus();
 				return false;
 			}
@@ -807,21 +1026,21 @@ img {
 		else{
 			if(MaxChargingPower >65535)
 			{
-				alert("MaxChargingPower must <= 65535!");
+				alert("Max Charging Power must <= 65535!");
 				document.getElementById("MaxChargingPower").focus();
 				return false;
 			}
 		}
 		if(MaxChargingPower < 0)
 		{
-			alert("MaxChargingPower must >= 0!");
+			alert("Max Charging Power must >= 0!");
 			document.getElementById("MaxChargingPower").focus();
 			return false;
 		}
 		if(RatingCurrent!="" && RatingCurrent!=0){
 			if(MaxChargingCurrent > RatingCurrent)
 			{
-				alert("MaxChargingCurrent must be less than RatingCurrent("+RatingCurrent+")!");
+				alert("Max Charging Current must be less than RatingCurrent("+RatingCurrent+")!");
 				document.getElementById("MaxChargingCurrent").focus();
 				return false;
 			}
@@ -829,11 +1048,27 @@ img {
 		else{
 			if(MaxChargingCurrent >65535)
 			{
-				alert("MaxChargingCurrent must <= 65535!");
+				alert("Max Charging Current must <= 65535!");
 				document.getElementById("MaxChargingCurrent").focus();
 				return false;
 			}
 		}
+		if(AcRatingCurrent!="" && AcRatingCurrent!=0){
+			if(AcMaxChargingCurrent > AcRatingCurrent)
+			{
+				alert("Ac Max Charging Current must be less than Ac Rating Current("+RatingCurrent+")!");
+				document.getElementById("AcMaxChargingCurrent").focus();
+				return false;
+			}
+		}
+		else{
+			if(AcMaxChargingCurrent >65535)
+			{
+				alert("Ac Max Charging Current must <= 65535!");
+				document.getElementById("AcMaxChargingCurrent").focus();
+				return false;
+			}
+		}
 		if(MaxChargingCurrent < 0)
 		{
 			alert("MaxChargingCurrent must >= 0!");
@@ -865,6 +1100,17 @@ img {
 		}
 	}
 
+	function isBilling_clicked(){
+		if(document.getElementById("isBilling").checked){
+			document.getElementById("CurrencyDiv").style.display="block";
+			document.getElementById("FeeDiv").style.display="block";
+		}
+		else{
+			document.getElementById("CurrencyDiv").style.display="none";
+			document.getElementById("FeeDiv").style.display="none";
+		}
+	}
+
 	function isNumberKey(evt)
 	{
 		var charCode = (evt.which) ? evt.which : event.keyCode

+ 26 - 2
EVSE/rootfs/var/www/set_charging_action.php

@@ -44,8 +44,32 @@
 		$json['LocalWhiteCard7']			= isset($_POST['LocalWhiteCard7'])?$_POST['LocalWhiteCard7']:"";
 		$json['LocalWhiteCard8']			= isset($_POST['LocalWhiteCard8'])?$_POST['LocalWhiteCard8']:"";
 		$json['LocalWhiteCard9']			= isset($_POST['LocalWhiteCard9'])?$_POST['LocalWhiteCard9']:"";
-//		$json['CcsAuthentication']			= $_POST['CcsAuthentication'];
-//		$json['AcCcsChargingModel']			= $_POST['AcCcsChargingModel'];
+		// $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):"";
 		
 //		ob_start();
 		

+ 117 - 4
EVSE/rootfs/var/www/set_system.php

@@ -15,6 +15,36 @@
 			$AcPhaseCount='unknown';
 			break;
 	}
+	$ModelName = $obj->{'ModelName'};
+	$RatingPower = substr($ModelName,4,2)*pow(10,-1+substr($ModelName,6,1));
+	$Connector1=substr($ModelName,7,1);
+	$Connector2=substr($ModelName,8,1);
+	$Connector3=substr($ModelName,9,1);
+	$connectorType1=ConnectorType($Connector1);
+	$connectorType2=ConnectorType($Connector2);
+	$connectorType3=ConnectorType($Connector3);
+	function ConnectorType($connector){
+		$result="";
+		if($connector == "0"){
+			$result= "";
+		}
+		else if($connector == "U" || $connector == "E"){
+			$result= "CCS";
+		}
+		else if($connector == "G" || $connector == "D"){
+			$result= "GB";
+		}
+		else if($connector == "J"){
+			$result= "CHAdeMO";
+		}
+		else if($connector == "1" || $connector == "2" || $connector == "3" || $connector == "4" || $connector == "5" || $connector == "6"){
+			$result= "AC";
+		}
+		else{
+			$result= "";
+		}
+		return $result;
+	}
 ?>
 <style>
 img {
@@ -99,12 +129,14 @@ img {
 											</select>*/?>
 										</div>
 										<div class="form-group" style="display:<?php echo $am111;?>">
-											<label>Authorisation Mode</label>
-											<select type="text" class="form-control" id="AuthorisationMode" name="AuthorisationMode" onchange="AuthorisationMode_changed();">
+											<label>
+											<input type="checkbox" id="AuthorisationMode" name="AuthorisationMode" <?php echo $obj->{'AuthorisationMode'}==0?"checked":"";?>>
+											Authorisation</label>
+<?php /*											<select type="text" class="form-control" id="AuthorisationMode" name="AuthorisationMode" onchange="AuthorisationMode_changed();">
 												<option value="0" <?php echo $obj->{'AuthorisationMode'}=="0"?"selected":""?>>OCPP backend</option>
 												<option value="1" <?php echo $obj->{'AuthorisationMode'}=="1"?"selected":""?>>free mode</option>
 											</select>
-											<small class="form-text text-muted-red"><label id="AuthorisationModeText" style="display:none;">You should set parameter about OCPP after this setting</label></small>
+											<small class="form-text text-muted-red"><label id="AuthorisationModeText" style="display:none;">You should set parameter about OCPP after this setting</label></small>*/?>
 										</div>
 <?php /*										<div class="form-group" style="display:<?php echo $am001;?>">
 											<label>Default Language</label>
@@ -169,6 +201,34 @@ img {
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'RatingCurrent'};?> amp">
 											<input type="hidden" name="RatingCurrent" id="RatingCurrent" value="<?php echo $obj->{'RatingCurrent'};?>">
 										</div>
+										<div class="form-group" id="AcRatingCurrentDiv">
+											<label>AC Rating Current</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'AcRatingCurrent'};?> amp">
+											<input type="hidden" name="AcRatingCurrent" id="AcRatingCurrent" value="<?php echo $obj->{'AcRatingCurrent'};?>">
+										</div>
+<?php /* LCM UI 相關參數, 待主程式完成後再處理
+										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label id="isAPPLabel">
+											<input type="checkbox" id="isAPP" name="isAPP" <?php echo $obj->{'isAPP'}==1?"checked":"";?>>
+											APP</label>
+											<label id="isQRCodeLabel">
+											<input type="checkbox" id="isQRCode" name="isQRCode" <?php echo $obj->{'isQRCode'}==1?"checked":"";?> onclick="isQRCode_clicked()">
+											QR Code</label>
+											<label id="isRFIDLabel">
+											<input type="checkbox" id="isRFID" name="isRFID" <?php echo $obj->{'isRFID'}==1?"checked":"";?>>
+											RFID</label>
+										</div>
+										<div class="form-group" id="QRCodeMadeModeDiv">
+											<label>QR Code Made Mode</label>
+											<select class="form-control" id="QRCodeMadeMode" name="QRCodeMadeMode" onchange="QRCodeMadeMode_changed()">
+												<option value="0" <?php echo $obj->{'QRCodeMadeMode'}=="0"?"selected":""?>>default</option>
+												<option value="1" <?php echo $obj->{'QRCodeMadeMode'}=="1"?"selected":""?>>customized</option>
+											</select>
+										</div>
+										<div class="form-group" id="QRCodeContentDiv">
+											<label>QR Code Content</label>
+											<input type="text" name="QRCodeContent" id="QRCodeContent" class="form-control" placeholder="<?php echo $obj->{'QRCodeContent'};?>" value="<?php echo $obj->{'QRCodeContent'};?>">
+										</div>*/?>
 									</section>
 								</article>
 <?php /*								<!--Aux. power Information-->
@@ -286,6 +346,21 @@ img {
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'TelcomModemFwRev'};?>">
 											<input type="hidden" name="TelcomModemFwRev" id="TelcomModemFwRev" value="<?php echo $obj->{'TelcomModemFwRev'};?>">
 										</div>
+<?php /*										<div class="form-group" id="Connector1FwRevDiv">
+											<label>Connector1(<?php echo $connectorType1;?>) Fw Rev</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Connector1FwRev'};?>">
+											<input type="hidden" name="Connector1FwRev" id="Connector1FwRev" value="<?php echo $obj->{'Connector1FwRev'};?>">
+										</div>
+										<div class="form-group" id="Connector2FwRevDiv">
+											<label>Connector2(<?php echo $connectorType2;?>) Fw Rev</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'Connector2FwRev'};?>">
+											<input type="hidden" name="Connector2FwRev" id="Connector2FwRev" value="<?php echo $obj->{'Connector2FwRev'};?>">
+										</div>*/?>
+<?php /*										<div class="form-group" style="display:<?php echo $am001;?>">
+											<label>Led Module Fw Rev</label>
+											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'LedModuleFwRev'};?>">
+											<input type="hidden" name="LedModuleFwRev" id="LedModuleFwRev" value="<?php echo $obj->{'LedModuleFwRev'};?>">
+										</div>*/?>
 									</section>
 								</article>
 								<!--Temperature Information-->
@@ -373,6 +448,19 @@ img {
 		if(document.getElementById("AuthorisationMode").value=="0"){
 			document.getElementById("AuthorisationModeText").style.display="block";
 		}
+		// if(document.getElementById("ModelName").value.substr(8,1) != "0"){
+			// document.getElementById("AcRatingCurrentDiv").style.display="block";
+		// }
+		// else{
+			// document.getElementById("AcRatingCurrentDiv").style.display="none";
+		// }
+		// if(document.getElementById("ModelName").value.substr(0,1) != "D"){
+			// document.getElementById("isAPPLabel").style.display="none";
+			// document.getElementById("isQRCodeLabel").style.display="none";
+			// document.getElementById("isRFIDLabel").style.display="none";
+		// }
+//		isQRCode_clicked();
+//		QRCodeMadeMode_changed();
 	});
 
 	document.getElementById("save").onclick = function() {
@@ -389,7 +477,12 @@ img {
 						"&SystemDateTime=" + document.getElementById("SystemDateTime").value+
 //						"&AcPhaseCount=" + document.getElementById("AcPhaseCount").value+
 						"&FactoryConfiguration=" + (document.getElementById("FactoryConfiguration").checked?1:0)+
-						"&AuthorisationMode=" + document.getElementById("AuthorisationMode").value+
+						"&AuthorisationMode=" + (document.getElementById("AuthorisationMode").checked?0:1)+
+						// "&isAPP=" + (document.getElementById("isAPP").checked?1:0)+
+						// "&isQRCode=" + (document.getElementById("isQRCode").checked?1:0)+
+						// "&isRFID=" + (document.getElementById("isRFID").checked?1:0)+
+						// "&QRCodeMadeMode=" + document.getElementById("QRCodeMadeMode").value+
+						// "&QRCodeContent=" + document.getElementById("QRCodeContent").value+
 //						"&DefaultLanguage=" + document.getElementById("DefaultLanguage").value+
 						"&RfidCardNumEndian=" + document.getElementById("RfidCardNumEndian").value+
 						"&PsuAcInputType=" + document.getElementById("PsuAcInputType").value;
@@ -447,6 +540,26 @@ img {
 		}
 	}
 
+	function isQRCode_clicked(){
+		if(document.getElementById("isQRCode").checked){
+			document.getElementById("QRCodeMadeModeDiv").style.display="block";
+			QRCodeMadeMode_changed();
+		}
+		else{
+			document.getElementById("QRCodeMadeModeDiv").style.display="none";
+			document.getElementById("QRCodeContentDiv").style.display="none";
+		}
+	}
+
+	function QRCodeMadeMode_changed(){
+		if(document.getElementById("QRCodeMadeMode").value == "1"){
+			document.getElementById("QRCodeContentDiv").style.display="block";
+		}
+		else{
+			document.getElementById("QRCodeContentDiv").style.display="none";
+		}
+	}
+
 	Date.prototype.Format = function (fmt) { //author: meizz 
 		var o = {
 			"M+": this.getMonth() + 1, //月份 

+ 34 - 9
EVSE/rootfs/var/www/set_system_action.php

@@ -22,16 +22,25 @@
 		}
 //		checkValue("AcPhaseCount",1);
 //		checkValue("FactoryConfiguration",1);
-		checkValue("AuthorisationMode",1);
+		checkValue("AuthorisationMode",2);
+		// checkValue("isAPP",2);
+		// checkValue("isQRCode",2);
+		// checkValue("isRFID",2);
+		// checkValue("QRCodeMadeMode",2);
 //		checkValue("DefaultLanguage",2);
 		checkValue("RfidCardNumEndian",1);
 		checkValue("PsuAcInputType",1);
 //		$json = json_decode(file_get_contents("system.txt"), true);
 		$json['SystemId']				= $_POST["SystemId"];
-		$json['SystemDateTime'] 		= $_POST['SystemDateTime'];
-//		$json['AcPhaseCount'] 			= $_POST['AcPhaseCount'];
+		$json['SystemDateTime']			= $_POST['SystemDateTime'];
+//		$json['AcPhaseCount']			= $_POST['AcPhaseCount'];
 		$json['FactoryConfiguration']	= $_POST['FactoryConfiguration'];
-		$json['AuthorisationMode']	 	= $_POST['AuthorisationMode'];
+		$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['DefaultLanguage']		= $_POST['DefaultLanguage'];
 		$json['RfidCardNumEndian']		= $_POST['RfidCardNumEndian'];
 		$json['PsuAcInputType']			= $_POST['PsuAcInputType'];
@@ -68,7 +77,7 @@
 			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";
+						$jsone['message'] = "You have entered a wrong length on " . $id . ", it should be 1 byte";
 						echo json_encode($jsone);
 						exit;
 				}
@@ -82,20 +91,36 @@
 		}
 		if($idx==2){
 			if($_POST[$id]!=""){
-				if(strlen($_POST[$id])>2){
+				if(strlen($_POST[$id])!=1){
 						$jsone['result'] = "Fail";
-						$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+						$jsone['message'] = "You have entered a wrong length on " . $id . ", it should be 1 byte";
 						echo json_encode($jsone);
 						exit;
 				}
-				if(!ereg("[0-9]",$_POST[$id]) & !ereg("[0-9]{2}",$_POST[$id])){
+				if(!ereg("[0-1]",$_POST[$id])){
 						$jsone['result'] = "Fail";
-						$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+						$jsone['message'] = "You have entered a wrong value on " . $id . ", it should be 0 or 1";
 						echo json_encode($jsone);
 						exit;
 				}
 			}
 		}
+		// if($idx==2){
+			// if($_POST[$id]!=""){
+				// if(strlen($_POST[$id])>2){
+						// $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]) & !ereg("[0-9]{2}",$_POST[$id])){
+						// $jsone['result'] = "Fail";
+						// $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric";
+						// echo json_encode($jsone);
+						// exit;
+				// }
+			// }
+		// }
 	}
 
 ?>