|
@@ -355,10 +355,10 @@ int main(int argc, char *argv[]) {
|
|
|
if (strcmp(argv[1], "2") == 0) {
|
|
|
struct json_object *jobj = json_tokener_parse(argv[2]);
|
|
|
json_object *val_obj = NULL;
|
|
|
- const char *MaxChargingEnergy=NULL;
|
|
|
- const char *MaxChargingPower = NULL;
|
|
|
- const char *MaxChargingCurrent = NULL;
|
|
|
- const char *MaxChargingDuration = NULL;
|
|
|
+ const int *MaxChargingEnergy= 0;
|
|
|
+ const int *MaxChargingPower = 0;
|
|
|
+ const int *MaxChargingCurrent = 0;
|
|
|
+ const int *MaxChargingDuration = 0;
|
|
|
const char *PhaseLossPolicy = NULL;
|
|
|
const char *LocalWhiteCard0 = NULL;
|
|
|
const char *LocalWhiteCard1 = NULL;
|
|
@@ -372,16 +372,16 @@ int main(int argc, char *argv[]) {
|
|
|
const char *LocalWhiteCard9 = NULL;
|
|
|
|
|
|
if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
|
|
|
- MaxChargingEnergy = json_object_get_string(val_obj);
|
|
|
+ MaxChargingEnergy = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
|
|
|
- MaxChargingPower = json_object_get_string(val_obj);
|
|
|
+ MaxChargingPower = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
|
|
|
- MaxChargingCurrent = json_object_get_string(val_obj);
|
|
|
+ MaxChargingCurrent = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
|
|
|
- MaxChargingDuration = json_object_get_string(val_obj);
|
|
|
+ MaxChargingDuration = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
|
|
|
PhaseLossPolicy = json_object_get_string(val_obj);
|
|
@@ -416,10 +416,10 @@ int main(int argc, char *argv[]) {
|
|
|
if( json_object_object_get_ex(jobj, "LocalWhiteCard9", &val_obj) ) {
|
|
|
LocalWhiteCard9 = json_object_get_string(val_obj);
|
|
|
}
|
|
|
- strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy,MaxChargingEnergy);
|
|
|
- strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaxChargingPower,MaxChargingPower);
|
|
|
- strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent,MaxChargingCurrent);
|
|
|
- strcpy((char *)&ShmSysConfigAndInfo->SysConfig.MaxChargingDuration,MaxChargingDuration);
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy = MaxChargingEnergy;
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingPower = MaxChargingPower;
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent = MaxChargingCurrent;
|
|
|
+ ShmSysConfigAndInfo->SysConfig.MaxChargingDuration = MaxChargingDuration;
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy,PhaseLossPolicy);
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
|
|
@@ -432,10 +432,10 @@ int main(int argc, char *argv[]) {
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
|
|
|
//Set default configuration
|
|
|
- strcpy((char *)&SysConfig.MaxChargingEnergy, MaxChargingEnergy);
|
|
|
- strcpy((char *)&SysConfig.MaxChargingPower, MaxChargingPower);
|
|
|
- strcpy((char *)&SysConfig.MaxChargingCurrent, MaxChargingCurrent);
|
|
|
- strcpy((char *)&SysConfig.MaxChargingDuration,MaxChargingDuration);
|
|
|
+ SysConfig.MaxChargingEnergy = MaxChargingEnergy;
|
|
|
+ SysConfig.MaxChargingPower = MaxChargingPower;
|
|
|
+ SysConfig.MaxChargingCurrent = MaxChargingCurrent;
|
|
|
+ SysConfig.MaxChargingDuration = MaxChargingDuration;
|
|
|
strcpy((char *)&SysConfig.PhaseLossPolicy,PhaseLossPolicy);
|
|
|
strcpy((char *)&SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
|
|
|
strcpy((char *)&SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
|
|
@@ -490,7 +490,7 @@ int main(int argc, char *argv[]) {
|
|
|
if( json_object_object_get_ex(jobj, "Eth1DhcpClient", &val_obj) ) {
|
|
|
Eth1DhcpClient = json_object_get_string(val_obj);
|
|
|
}
|
|
|
- if( json_object_object_get_ex(jobj, "Eth10IpAddress", &val_obj) ) {
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth1IpAddress", &val_obj) ) {
|
|
|
Eth1IpAddress = json_object_get_string(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "Eth1SubmaskAddress", &val_obj) ) {
|
|
@@ -591,16 +591,19 @@ int main(int argc, char *argv[]) {
|
|
|
const char *ChargeBoxId=NULL;
|
|
|
|
|
|
if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
|
|
|
- BackendConnTimeout =(int *)json_object_get_int(val_obj);
|
|
|
+ //BackendConnTimeout = json_object_get_string(val_obj);
|
|
|
+ BackendConnTimeout = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "OfflinePolicy", &val_obj) ) {
|
|
|
OfflinePolicy = json_object_get_string(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "OfflineMaxChargeEnergy", &val_obj) ) {
|
|
|
- OfflineMaxChargeEnergy = (int *)json_object_get_int(val_obj);
|
|
|
+ //OfflineMaxChargeEnergy = json_object_get_string(val_obj);
|
|
|
+ OfflineMaxChargeEnergy = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
|
|
|
- OfflineMaxChargeDuration = (int *)json_object_get_int(val_obj);
|
|
|
+ //OfflineMaxChargeDuration = json_object_get_string(val_obj);
|
|
|
+ OfflineMaxChargeDuration = json_object_get_int(val_obj);
|
|
|
}
|
|
|
if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
|
|
|
OcppServerURL = json_object_get_string(val_obj);
|
|
@@ -609,10 +612,10 @@ int main(int argc, char *argv[]) {
|
|
|
ChargeBoxId = json_object_get_string(val_obj);
|
|
|
}
|
|
|
|
|
|
- SysConfig.BackendConnTimeout=(int)BackendConnTimeout;
|
|
|
+ ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OfflinePolicy,OfflinePolicy);
|
|
|
- SysConfig.OfflineMaxChargeEnergy=(int)OfflineMaxChargeEnergy;
|
|
|
- SysConfig.OfflineMaxChargeDuration=(int)OfflineMaxChargeDuration;
|
|
|
+ ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = OfflineMaxChargeEnergy;
|
|
|
+ ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
|
|
|
//Set default configuration
|
|
@@ -679,9 +682,6 @@ int main(int argc, char *argv[]) {
|
|
|
ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes=0;
|
|
|
ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes=0;
|
|
|
//Set default configuration
|
|
|
- //strcpy(SysConfig->ModelName)
|
|
|
-// strcpy(SysConfig->SystemId, ShmSysConfigAndInfo->SysConfig.SystemId);
|
|
|
-// strcpy(SysConfig->SystemDateTime, ShmSysConfigAndInfo->SysConfig.SystemDateTime);
|
|
|
strcpy(SysConfig.SystemId, "0987654321");
|
|
|
strcpy(SysConfig.SystemDateTime, "2019-08-12 00:00:00");
|
|
|
//charging
|
|
@@ -744,7 +744,6 @@ int main(int argc, char *argv[]) {
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,"TelcomChapPapPwd");
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei,"TelcomModemImei");
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi,"TelcomSimImsi");
|
|
|
- //sprintf(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid,"TelcomSimIccid");
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus,"1");
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode,"1");
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,"TelcomIpAddress");
|
|
@@ -819,9 +818,6 @@ int main(int argc, char *argv[]) {
|
|
|
connectorType2=ConnectorType((char *)Connector2);
|
|
|
connectorType3=ConnectorType((char *)Connector3);
|
|
|
// modelType=ModelType((char *)IsAcDc,(char *)Network);
|
|
|
-// printf("connectorType1:%d\n",connectorType1);
|
|
|
-// printf("connectorType2:%d\n",connectorType2);
|
|
|
-// printf("connectorType3:%d\n",connectorType3);
|
|
|
// printf("modelType:%d\n",modelType);
|
|
|
|
|
|
struct json_object *jobj1;
|
|
@@ -1285,6 +1281,7 @@ int main(int argc, char *argv[]) {
|
|
|
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);
|
|
|
json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
|