|
@@ -280,11 +280,9 @@ int main(int argc, char *argv[]) {
|
|
|
sleep(5);
|
|
|
return 0;
|
|
|
}
|
|
|
-
|
|
|
- if (argc == 3 & isdigit(*argv[1])) {
|
|
|
+ //web page submit
|
|
|
+ if ((argc == 3) & (strlen(argv[1]) == 1)) {
|
|
|
struct SysConfigData SysConfig;
|
|
|
- int fd, wrd;
|
|
|
- unsigned int Chk;
|
|
|
unsigned char *ptr;
|
|
|
ptr=malloc(sizeof(struct SysConfigData));
|
|
|
if(ptr==NULL)
|
|
@@ -296,31 +294,50 @@ int main(int argc, char *argv[]) {
|
|
|
}
|
|
|
memset(ptr,0,sizeof(struct SysConfigData));
|
|
|
memset(&SysConfig,0,sizeof(struct SysConfigData));
|
|
|
-
|
|
|
+ //web page submit system
|
|
|
if (strcmp(argv[1], "1") == 0) {
|
|
|
struct json_object *jobj = json_tokener_parse(argv[2]);
|
|
|
- struct json_object *SystemId = json_object_object_get(jobj, "SystemId");
|
|
|
- struct json_object *SystemDateTime = json_object_object_get(jobj,"SystemDateTime");
|
|
|
- struct json_object *FactoryConfiguration = json_object_object_get(jobj, "FactoryConfiguration");
|
|
|
- struct json_object *AuthorisationMode = json_object_object_get(jobj,"AuthorisationMode");
|
|
|
- struct json_object *DefaultLanguage = json_object_object_get(jobj,"DefaultLanguage");
|
|
|
- struct json_object *RfidCardNumEndian = json_object_object_get(jobj,"RfidCardNumEndian");
|
|
|
- sprintf(ShmSysConfigAndInfo->SysConfig.SystemId,json_object_get_string(SystemId));
|
|
|
- sprintf(ShmSysConfigAndInfo->SysConfig.SystemDateTime,json_object_get_string(SystemDateTime));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysInfo.FactoryConfiguration,json_object_get_string(FactoryConfiguration));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AuthorisationMode,json_object_get_string(AuthorisationMode));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.DefaultLanguage,json_object_get_string(DefaultLanguage));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian,json_object_get_string(RfidCardNumEndian));
|
|
|
+ json_object *val_obj = NULL;
|
|
|
+ const char *SystemId=NULL;
|
|
|
+ const char *SystemDateTime = NULL;
|
|
|
+ const char *FactoryConfiguration = NULL;
|
|
|
+ const char *AuthorisationMode = NULL;
|
|
|
+ const char *DefaultLanguage = NULL;
|
|
|
+ const char *RfidCardNumEndian = NULL;
|
|
|
+
|
|
|
+ if( json_object_object_get_ex(jobj, "SystemId", &val_obj) ) {
|
|
|
+ SystemId = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "SystemDateTime", &val_obj) ) {
|
|
|
+ SystemDateTime = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "FactoryConfiguration", &val_obj) ) {
|
|
|
+ FactoryConfiguration = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "AuthorisationMode", &val_obj) ) {
|
|
|
+ AuthorisationMode = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "DefaultLanguage", &val_obj) ) {
|
|
|
+ DefaultLanguage = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "RfidCardNumEndian", &val_obj) ) {
|
|
|
+ RfidCardNumEndian = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ strcpy((char *)ShmSysConfigAndInfo->SysConfig.SystemId,SystemId);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FactoryConfiguration,FactoryConfiguration);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AuthorisationMode,AuthorisationMode);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.DefaultLanguage,DefaultLanguage);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian,RfidCardNumEndian);
|
|
|
//Set default configuration
|
|
|
- //strcpy(SysConfig.SystemId, "11111111111111");
|
|
|
- //strcpy(SysConfig.SystemDateTime, "2020-01-01 00:00:00");
|
|
|
- strcpy(SysConfig.SystemId, json_object_get_string(SystemId));
|
|
|
- //strcpy(SysConfig.SystemDateTime, json_object_get_string(SystemDateTime));
|
|
|
- strcpy(&SysConfig.AuthorisationMode, json_object_get_string(AuthorisationMode));
|
|
|
- strcpy(&SysConfig.DefaultLanguage, json_object_get_string(DefaultLanguage));
|
|
|
- strcpy(&SysConfig.RfidCardNumEndian,json_object_get_string(RfidCardNumEndian));
|
|
|
- if(SystemDateTime!=""){
|
|
|
- if(system(sprintf("date -s %",SystemDateTime))==0){
|
|
|
+ strcpy((char *)SysConfig.SystemId, SystemId);
|
|
|
+ strcpy((char *)&SysConfig.AuthorisationMode, AuthorisationMode);
|
|
|
+ strcpy((char *)&SysConfig.DefaultLanguage, DefaultLanguage);
|
|
|
+ strcpy((char *)&SysConfig.RfidCardNumEndian,RfidCardNumEndian);
|
|
|
+
|
|
|
+ if(strlen(SystemDateTime)>0){
|
|
|
+ char cmd[100];
|
|
|
+ sprintf(cmd,"date -s '%s'",SystemDateTime);
|
|
|
+ if(system(cmd)==0){
|
|
|
system("hwclock -w");
|
|
|
}
|
|
|
|
|
@@ -328,146 +345,274 @@ int main(int argc, char *argv[]) {
|
|
|
}
|
|
|
if (strcmp(argv[1], "2") == 0) {
|
|
|
struct json_object *jobj = json_tokener_parse(argv[2]);
|
|
|
- struct json_object *MaxChargingEnergy = json_object_object_get(jobj,"MaxChargingEnergy");
|
|
|
- struct json_object *MaxChargingPower = json_object_object_get(jobj,"MaxChargingPower");
|
|
|
- struct json_object *MaxChargingCurrent = json_object_object_get(jobj, "MaxChargingCurrent");
|
|
|
- struct json_object *MaxChargingDuration = json_object_object_get(jobj,"MaxChargingDuration");
|
|
|
- struct json_object *PhaseLossPolicy = json_object_object_get(jobj,"PhaseLossPolicy");
|
|
|
- struct json_object *LocalWhiteCard0 = json_object_object_get(jobj,"LocalWhiteCard0");
|
|
|
- struct json_object *LocalWhiteCard1 = json_object_object_get(jobj,"LocalWhiteCard1");
|
|
|
- struct json_object *LocalWhiteCard2 = json_object_object_get(jobj,"LocalWhiteCard2");
|
|
|
- struct json_object *LocalWhiteCard3 = json_object_object_get(jobj,"LocalWhiteCard3");
|
|
|
- struct json_object *LocalWhiteCard4 = json_object_object_get(jobj,"LocalWhiteCard4");
|
|
|
- struct json_object *LocalWhiteCard5 = json_object_object_get(jobj,"LocalWhiteCard5");
|
|
|
- struct json_object *LocalWhiteCard6 = json_object_object_get(jobj,"LocalWhiteCard6");
|
|
|
- struct json_object *LocalWhiteCard7 = json_object_object_get(jobj,"LocalWhiteCard7");
|
|
|
- struct json_object *LocalWhiteCard8 = json_object_object_get(jobj,"LocalWhiteCard8");
|
|
|
- struct json_object *LocalWhiteCard9 = json_object_object_get(jobj,"LocalWhiteCard9");
|
|
|
- struct json_object *UserId = json_object_object_get(jobj,"UserId");
|
|
|
+ json_object *val_obj = NULL;
|
|
|
+ const char *MaxChargingEnergy=NULL;
|
|
|
+ const char *MaxChargingPower = NULL;
|
|
|
+ const char *MaxChargingCurrent = NULL;
|
|
|
+ const char *MaxChargingDuration = NULL;
|
|
|
+ const char *PhaseLossPolicy = NULL;
|
|
|
+ const char *LocalWhiteCard0 = NULL;
|
|
|
+ const char *LocalWhiteCard1 = NULL;
|
|
|
+ const char *LocalWhiteCard2 = NULL;
|
|
|
+ const char *LocalWhiteCard3 = NULL;
|
|
|
+ const char *LocalWhiteCard4 = NULL;
|
|
|
+ const char *LocalWhiteCard5 = NULL;
|
|
|
+ const char *LocalWhiteCard6 = NULL;
|
|
|
+ const char *LocalWhiteCard7 = NULL;
|
|
|
+ const char *LocalWhiteCard8 = NULL;
|
|
|
+ const char *LocalWhiteCard9 = NULL;
|
|
|
|
|
|
- ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy=json_object_get_int(MaxChargingEnergy);
|
|
|
- ShmSysConfigAndInfo->SysConfig.MaxChargingPower=json_object_get_int(MaxChargingPower);
|
|
|
- ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent=json_object_get_int(MaxChargingCurrent);
|
|
|
- ShmSysConfigAndInfo->SysConfig.MaxChargingDuration=json_object_get_int(MaxChargingDuration);
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy,json_object_get_string(PhaseLossPolicy));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0],json_object_get_string(LocalWhiteCard0));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1],json_object_get_string(LocalWhiteCard1));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2],json_object_get_string(LocalWhiteCard2));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3],json_object_get_string(LocalWhiteCard3));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4],json_object_get_string(LocalWhiteCard4));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5],json_object_get_string(LocalWhiteCard5));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6],json_object_get_string(LocalWhiteCard6));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7],json_object_get_string(LocalWhiteCard7));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8],json_object_get_string(LocalWhiteCard8));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9],json_object_get_string(LocalWhiteCard9));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.UserId,json_object_get_string(UserId));
|
|
|
+ if( json_object_object_get_ex(jobj, "MaxChargingEnergy", &val_obj) ) {
|
|
|
+ MaxChargingEnergy = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "MaxChargingPower", &val_obj) ) {
|
|
|
+ MaxChargingPower = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "MaxChargingCurrent", &val_obj) ) {
|
|
|
+ MaxChargingCurrent = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "MaxChargingDuration", &val_obj) ) {
|
|
|
+ MaxChargingDuration = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "PhaseLossPolicy", &val_obj) ) {
|
|
|
+ PhaseLossPolicy = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard0", &val_obj) ) {
|
|
|
+ LocalWhiteCard0 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard1", &val_obj) ) {
|
|
|
+ LocalWhiteCard1 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard2", &val_obj) ) {
|
|
|
+ LocalWhiteCard2 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard3", &val_obj) ) {
|
|
|
+ LocalWhiteCard3 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard4", &val_obj) ) {
|
|
|
+ LocalWhiteCard4 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard5", &val_obj) ) {
|
|
|
+ LocalWhiteCard5 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard6", &val_obj) ) {
|
|
|
+ LocalWhiteCard6 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard7", &val_obj) ) {
|
|
|
+ LocalWhiteCard7 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "LocalWhiteCard8", &val_obj) ) {
|
|
|
+ LocalWhiteCard8 = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy,PhaseLossPolicy);
|
|
|
+ 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);
|
|
|
//Set default configuration
|
|
|
- SysConfig.MaxChargingEnergy=json_object_get_int(MaxChargingEnergy);
|
|
|
- SysConfig.MaxChargingPower=json_object_get_int(MaxChargingPower);
|
|
|
- SysConfig.MaxChargingCurrent=json_object_get_int(MaxChargingCurrent);
|
|
|
- SysConfig.MaxChargingDuration=json_object_get_int(MaxChargingDuration);
|
|
|
- strcpy(&SysConfig.PhaseLossPolicy, json_object_get_string(PhaseLossPolicy));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[0],json_object_get_string(LocalWhiteCard0));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[1],json_object_get_string(LocalWhiteCard1));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[2],json_object_get_string(LocalWhiteCard2));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[3],json_object_get_string(LocalWhiteCard3));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[4],json_object_get_string(LocalWhiteCard4));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[5],json_object_get_string(LocalWhiteCard5));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[6],json_object_get_string(LocalWhiteCard6));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[7],json_object_get_string(LocalWhiteCard7));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[8],json_object_get_string(LocalWhiteCard8));
|
|
|
- strcpy(SysConfig.LocalWhiteCard[9],json_object_get_string(LocalWhiteCard9));
|
|
|
- strcpy(SysConfig.UserId,json_object_get_string(UserId));
|
|
|
+ strcpy((char *)&SysConfig.MaxChargingEnergy, MaxChargingEnergy);
|
|
|
+ strcpy((char *)&SysConfig.MaxChargingPower, MaxChargingPower);
|
|
|
+ strcpy((char *)&SysConfig.MaxChargingCurrent, MaxChargingCurrent);
|
|
|
+ strcpy((char *)&SysConfig.MaxChargingDuration,MaxChargingDuration);
|
|
|
+ strcpy((char *)&SysConfig.PhaseLossPolicy,PhaseLossPolicy);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[0],LocalWhiteCard0);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[1],LocalWhiteCard1);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[2],LocalWhiteCard2);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[3],LocalWhiteCard3);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[4],LocalWhiteCard4);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[5],LocalWhiteCard5);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[6],LocalWhiteCard6);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[7],LocalWhiteCard7);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[8],LocalWhiteCard8);
|
|
|
+ strcpy((char *)SysConfig.LocalWhiteCard[9],LocalWhiteCard9);
|
|
|
}
|
|
|
if (strcmp(argv[1], "3") == 0) {
|
|
|
struct json_object *jobj = json_tokener_parse(argv[2]);
|
|
|
- struct json_object *FtpServer = json_object_object_get(jobj,"FtpServer");
|
|
|
- struct json_object *Eth0DhcpClient = json_object_object_get(jobj,"Eth0DhcpClient");
|
|
|
- struct json_object *Eth0IpAddress = json_object_object_get(jobj, "Eth0IpAddress");
|
|
|
- struct json_object *Eth0SubmaskAddress = json_object_object_get(jobj,"Eth0SubmaskAddress");
|
|
|
- struct json_object *Eth0GatewayAddress = json_object_object_get(jobj,"Eth0GatewayAddress");
|
|
|
- struct json_object *Eth1DhcpClient = json_object_object_get(jobj,"Eth1DhcpClient");
|
|
|
- struct json_object *Eth1IpAddress = json_object_object_get(jobj, "Eth1IpAddress");
|
|
|
- struct json_object *Eth1SubmaskAddress = json_object_object_get(jobj,"Eth1SubmaskAddress");
|
|
|
- struct json_object *Eth1GatewayAddress = json_object_object_get(jobj,"Eth1GatewayAddress");
|
|
|
- struct json_object *WifiMode = json_object_object_get(jobj,"WifiMode");
|
|
|
- struct json_object *WifiSsid = json_object_object_get(jobj,"WifiSsid");
|
|
|
- struct json_object *WifiPassword = json_object_object_get(jobj,"WifiPassword");
|
|
|
- struct json_object *WifiDhcpServer = json_object_object_get(jobj,"WifiDhcpServer");
|
|
|
- struct json_object *WifiDhcpClient = json_object_object_get(jobj,"WifiDhcpClient");
|
|
|
- struct json_object *WifiIpAddress = json_object_object_get(jobj,"WifiIpAddress");
|
|
|
- struct json_object *WifiSubmaskAddress = json_object_object_get(jobj,"WifiSubmaskAddress");
|
|
|
- struct json_object *WifiGatewayAddress = json_object_object_get(jobj,"WifiGatewayAddress");
|
|
|
- struct json_object *TelcomApn = json_object_object_get(jobj,"TelcomApn");
|
|
|
- struct json_object *TelcomChapPapId = json_object_object_get(jobj,"TelcomChapPapId");
|
|
|
- struct json_object *TelcomChapPapPwd = json_object_object_get(jobj,"TelcomChapPapPwd");
|
|
|
- struct json_object *TelcomIpAddress = json_object_object_get(jobj,"TelcomIpAddress");
|
|
|
+ json_object *val_obj = NULL;
|
|
|
+ const char *FtpServer=NULL;
|
|
|
+ const char *Eth0DhcpClient=NULL;
|
|
|
+ const char *Eth0IpAddress=NULL;
|
|
|
+ const char *Eth0SubmaskAddress=NULL;
|
|
|
+ const char *Eth0GatewayAddress=NULL;
|
|
|
+ const char *Eth1DhcpClient=NULL;
|
|
|
+ const char *Eth1IpAddress=NULL;
|
|
|
+ const char *Eth1SubmaskAddress=NULL;
|
|
|
+ const char *Eth1GatewayAddress=NULL;
|
|
|
+ const char *WifiMode=NULL;
|
|
|
+ const char *WifiSsid=NULL;
|
|
|
+ const char *WifiPassword=NULL;
|
|
|
+ const char *WifiDhcpServer=NULL;
|
|
|
+ const char *WifiDhcpClient=NULL;
|
|
|
+ const char *WifiIpAddress=NULL;
|
|
|
+ const char *WifiSubmaskAddress=NULL;
|
|
|
+ const char *WifiGatewayAddress=NULL;
|
|
|
+ const char *TelcomApn=NULL;
|
|
|
+ const char *TelcomChapPapId=NULL;
|
|
|
+ const char *TelcomChapPapPwd=NULL;
|
|
|
+ const char *TelcomIpAddress=NULL;
|
|
|
+ if( json_object_object_get_ex(jobj, "FtpServer", &val_obj) ) {
|
|
|
+ FtpServer = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth0DhcpClient", &val_obj) ) {
|
|
|
+ Eth0DhcpClient = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth0IpAddress", &val_obj) ) {
|
|
|
+ Eth0IpAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth0SubmaskAddress", &val_obj) ) {
|
|
|
+ Eth0SubmaskAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth0GatewayAddress", &val_obj) ) {
|
|
|
+ Eth0GatewayAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ 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) ) {
|
|
|
+ Eth1IpAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth1SubmaskAddress", &val_obj) ) {
|
|
|
+ Eth1SubmaskAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "Eth1GatewayAddress", &val_obj) ) {
|
|
|
+ Eth1GatewayAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiMode", &val_obj) ) {
|
|
|
+ WifiMode = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiSsid", &val_obj) ) {
|
|
|
+ WifiSsid = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiPassword", &val_obj) ) {
|
|
|
+ WifiPassword = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
|
|
|
+ WifiDhcpServer = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiDhcpClient", &val_obj) ) {
|
|
|
+ WifiDhcpClient = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiIpAddress", &val_obj) ) {
|
|
|
+ WifiIpAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiSubmaskAddress", &val_obj) ) {
|
|
|
+ WifiSubmaskAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "WifiGatewayAddress", &val_obj) ) {
|
|
|
+ WifiGatewayAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "TelcomApn", &val_obj) ) {
|
|
|
+ TelcomApn = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "TelcomChapPapId", &val_obj) ) {
|
|
|
+ TelcomChapPapId = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "TelcomChapPapPwd", &val_obj) ) {
|
|
|
+ TelcomChapPapPwd = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "TelcomIpAddress", &val_obj) ) {
|
|
|
+ TelcomIpAddress = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.FtpServer,json_object_get_string(FtpServer));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient,json_object_get_string(Eth0DhcpClient));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,json_object_get_string(Eth0IpAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress,json_object_get_string(Eth0SubmaskAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress,json_object_get_string(Eth0GatewayAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient,json_object_get_string(Eth1DhcpClient));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,json_object_get_string(Eth1IpAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress,json_object_get_string(Eth1SubmaskAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress,json_object_get_string(Eth1GatewayAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient,json_object_get_string(WifiDhcpClient));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,json_object_get_string(WifiSsid));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,json_object_get_string(WifiPassword));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer,json_object_get_string(WifiDhcpServer));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress,json_object_get_string(WifiIpAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress,json_object_get_string(WifiSubmaskAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress,json_object_get_string(WifiGatewayAddress));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn,json_object_get_string(TelcomApn));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,json_object_get_string(TelcomChapPapId));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd,json_object_get_string(TelcomChapPapPwd));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,json_object_get_string(TelcomIpAddress));
|
|
|
+ strcpy((char *)ShmSysConfigAndInfo->SysConfig.FtpServer,FtpServer);
|
|
|
+ strcpy((char *)&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);
|
|
|
+ strcpy((char *)&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);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode,WifiMode);
|
|
|
+ strcpy((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid,WifiSsid);
|
|
|
+ strcpy((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer,WifiDhcpServer);
|
|
|
+ strcpy((char *)&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);
|
|
|
//Set default configuration
|
|
|
- strcpy(SysConfig.FtpServer, json_object_get_string(FtpServer));
|
|
|
- strcpy(&SysConfig.Eth0Interface.EthDhcpClient, json_object_get_string(Eth0DhcpClient));
|
|
|
- strcpy(SysConfig.Eth0Interface.EthIpAddress, json_object_get_string(Eth0IpAddress));
|
|
|
- strcpy(SysConfig.Eth0Interface.EthSubmaskAddress, json_object_get_string(Eth0SubmaskAddress));
|
|
|
- strcpy(SysConfig.Eth0Interface.EthGatewayAddress, json_object_get_string(Eth0GatewayAddress));
|
|
|
- strcpy(&SysConfig.Eth1Interface.EthDhcpClient, json_object_get_string(Eth1DhcpClient));
|
|
|
- strcpy(SysConfig.Eth1Interface.EthIpAddress, json_object_get_string(Eth1IpAddress));
|
|
|
- strcpy(SysConfig.Eth1Interface.EthSubmaskAddress, json_object_get_string(Eth1SubmaskAddress));
|
|
|
- strcpy(SysConfig.Eth1Interface.EthGatewayAddress, json_object_get_string(Eth1GatewayAddress));
|
|
|
- strcpy(&SysConfig.AthInterface.WifiDhcpClient, json_object_get_string(WifiDhcpClient));
|
|
|
- strcpy(SysConfig.AthInterface.WifiSsid, json_object_get_string(WifiSsid));
|
|
|
- strcpy(SysConfig.AthInterface.WifiPassword, json_object_get_string(WifiPassword));
|
|
|
- strcpy(&SysConfig.AthInterface.WifiDhcpServer, json_object_get_string(WifiDhcpServer));
|
|
|
- strcpy(SysConfig.AthInterface.WifiIpAddress, json_object_get_string(WifiIpAddress));
|
|
|
- strcpy(SysConfig.AthInterface.WifiSubmaskAddress, json_object_get_string(WifiSubmaskAddress));
|
|
|
- strcpy(SysConfig.AthInterface.WifiGatewayAddress, json_object_get_string(WifiGatewayAddress));
|
|
|
- strcpy(SysConfig.TelecomInterface.TelcomApn, json_object_get_string(TelcomApn));
|
|
|
- strcpy(SysConfig.TelecomInterface.TelcomChapPapId, json_object_get_string(TelcomChapPapId));
|
|
|
- strcpy(SysConfig.TelecomInterface.TelcomChapPapPwd, json_object_get_string(TelcomChapPapPwd));
|
|
|
- strcpy(SysConfig.TelecomInterface.TelcomIpAddress, json_object_get_string(TelcomIpAddress));
|
|
|
-
|
|
|
+ strcpy((char *)SysConfig.FtpServer, FtpServer);
|
|
|
+ strcpy((char *)&SysConfig.Eth0Interface.EthDhcpClient, Eth0DhcpClient);
|
|
|
+ strcpy((char *)SysConfig.Eth0Interface.EthIpAddress, Eth0IpAddress);
|
|
|
+ strcpy((char *)SysConfig.Eth0Interface.EthSubmaskAddress, Eth0SubmaskAddress);
|
|
|
+ strcpy((char *)SysConfig.Eth0Interface.EthGatewayAddress, Eth0GatewayAddress);
|
|
|
+ strcpy((char *)&SysConfig.Eth1Interface.EthDhcpClient, Eth1DhcpClient);
|
|
|
+ strcpy((char *)SysConfig.Eth1Interface.EthIpAddress, Eth1IpAddress);
|
|
|
+ strcpy((char *)SysConfig.Eth1Interface.EthSubmaskAddress, Eth1SubmaskAddress);
|
|
|
+ strcpy((char *)SysConfig.Eth1Interface.EthGatewayAddress, Eth1GatewayAddress);
|
|
|
+ strcpy((char *)&SysConfig.AthInterface.WifiMode, WifiMode);
|
|
|
+ strcpy((char *)SysConfig.AthInterface.WifiSsid, WifiSsid);
|
|
|
+ strcpy((char *)SysConfig.AthInterface.WifiPassword, WifiPassword);
|
|
|
+ strcpy((char *)&SysConfig.AthInterface.WifiDhcpServer, WifiDhcpServer);
|
|
|
+ strcpy((char *)&SysConfig.AthInterface.WifiDhcpClient, WifiDhcpClient);
|
|
|
+ strcpy((char *)SysConfig.AthInterface.WifiIpAddress, WifiIpAddress);
|
|
|
+ strcpy((char *)SysConfig.AthInterface.WifiSubmaskAddress, WifiSubmaskAddress);
|
|
|
+ strcpy((char *)SysConfig.AthInterface.WifiGatewayAddress, WifiGatewayAddress);
|
|
|
+ strcpy((char *)SysConfig.TelecomInterface.TelcomApn, TelcomApn);
|
|
|
+ strcpy((char *)SysConfig.TelecomInterface.TelcomChapPapId, TelcomChapPapId);
|
|
|
+ strcpy((char *)SysConfig.TelecomInterface.TelcomChapPapPwd, TelcomChapPapPwd);
|
|
|
+ strcpy((char *)SysConfig.TelecomInterface.TelcomIpAddress, TelcomIpAddress);
|
|
|
}
|
|
|
if (strcmp(argv[1], "4") == 0) {
|
|
|
struct json_object *jobj = json_tokener_parse(argv[2]);
|
|
|
- struct json_object *BackendConnTimeout = json_object_object_get(jobj,"BackendConnTimeout");
|
|
|
- struct json_object *OfflinePolicy = json_object_object_get(jobj,"OfflinePolicy");
|
|
|
- struct json_object *OfflineMaxChargeEnergy = json_object_object_get(jobj, "OfflineMaxChargeEnergy");
|
|
|
- struct json_object *OfflineMaxChargeDuration = json_object_object_get(jobj,"OfflineMaxChargeDuration");
|
|
|
- struct json_object *OcppServerURL = json_object_object_get(jobj,"OcppServerURL");
|
|
|
- struct json_object *ChargeBoxId = json_object_object_get(jobj,"ChargeBoxId");
|
|
|
+ json_object *val_obj = NULL;
|
|
|
+ const int *BackendConnTimeout=0;
|
|
|
+ const char *OfflinePolicy=NULL;
|
|
|
+ const int *OfflineMaxChargeEnergy=0;
|
|
|
+ const int *OfflineMaxChargeDuration=0;
|
|
|
+ const char *OcppServerURL=NULL;
|
|
|
+ const char *ChargeBoxId=NULL;
|
|
|
+
|
|
|
+ if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
|
|
|
+ BackendConnTimeout =(int *)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);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "OfflineMaxChargeDuration", &val_obj) ) {
|
|
|
+ OfflineMaxChargeDuration = (int *)json_object_get_int(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "OcppServerURL", &val_obj) ) {
|
|
|
+ OcppServerURL = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
+ if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
|
|
|
+ ChargeBoxId = json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
|
|
|
- ShmSysConfigAndInfo->SysConfig.BackendConnTimeout=json_object_get_int(BackendConnTimeout);
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.OfflinePolicy,json_object_get_string(OfflinePolicy));
|
|
|
- ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy=json_object_get_int(OfflineMaxChargeEnergy);
|
|
|
- ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration=json_object_get_int(OfflineMaxChargeDuration);
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.OcppServerURL,json_object_get_string(OcppServerURL));
|
|
|
- sprintf(&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,json_object_get_string(ChargeBoxId));
|
|
|
+ SysConfig.BackendConnTimeout=(int)BackendConnTimeout;
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OfflinePolicy,OfflinePolicy);
|
|
|
+ SysConfig.OfflineMaxChargeEnergy=(int)OfflineMaxChargeEnergy;
|
|
|
+ SysConfig.OfflineMaxChargeDuration=(int)OfflineMaxChargeDuration;
|
|
|
+ strcpy((char *)ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
|
|
|
+ strcpy((char *)ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
|
|
|
//Set default configuration
|
|
|
- SysConfig.BackendConnTimeout=json_object_get_int(BackendConnTimeout);
|
|
|
- strcpy(&SysConfig.OfflinePolicy,json_object_get_string(OfflinePolicy));
|
|
|
- SysConfig.OfflineMaxChargeEnergy=json_object_get_int(OfflineMaxChargeEnergy);
|
|
|
- SysConfig.OfflineMaxChargeDuration=json_object_get_int(OfflineMaxChargeDuration);
|
|
|
- strcpy(SysConfig.OcppServerURL,json_object_get_string(OcppServerURL));
|
|
|
- strcpy(SysConfig.ChargeBoxId,json_object_get_string(ChargeBoxId));
|
|
|
+ SysConfig.BackendConnTimeout=(int)BackendConnTimeout;
|
|
|
+ strcpy((char *)&SysConfig.OfflinePolicy, OfflinePolicy);
|
|
|
+ SysConfig.OfflineMaxChargeEnergy=(int)OfflineMaxChargeEnergy;
|
|
|
+ SysConfig.OfflineMaxChargeDuration=(int)OfflineMaxChargeDuration;
|
|
|
+ strcpy((char *)SysConfig.OcppServerURL, OcppServerURL);
|
|
|
+ strcpy((char *)SysConfig.ChargeBoxId, ChargeBoxId);
|
|
|
}
|
|
|
|
|
|
StoreUsrConfigData(&SysConfig);
|
|
@@ -476,7 +621,7 @@ int main(int argc, char *argv[]) {
|
|
|
DEBUG_INFO("WebServiceConfig update OK");
|
|
|
#endif
|
|
|
}
|
|
|
- if (argc == 2) { //init share memory
|
|
|
+ if (argc == 2) { //init share memory for test
|
|
|
if (strcmp(argv[1], "aaa") == 0) {
|
|
|
struct SysConfigData SysConfig;
|
|
|
//system
|
|
@@ -624,46 +769,46 @@ int main(int argc, char *argv[]) {
|
|
|
}
|
|
|
}
|
|
|
//upgrade firmware
|
|
|
- if (argc == 3 & strcmp(argv[1], "upgrade") == 0) {
|
|
|
+ if ((argc == 3) & (strcmp(argv[1], "upgrade") == 0)) {
|
|
|
struct json_object *jobj;
|
|
|
struct json_object *Result;
|
|
|
struct json_object *Message;
|
|
|
char cmd[100];
|
|
|
jobj=json_object_new_object();
|
|
|
//system
|
|
|
- if(&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == "0"){
|
|
|
- strcpy(&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate, "1");
|
|
|
- Result = json_object_new_string("success");
|
|
|
- Message = json_object_new_string("file is uploaded");
|
|
|
- }
|
|
|
- else{
|
|
|
+ //if((char)ShmSysConfigAndInfo->SysInfo.FirmwareUpdate == '0'){
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate, "1");
|
|
|
+ Result = json_object_new_string("success");
|
|
|
+ Message = json_object_new_string("file is uploaded");
|
|
|
+ //}
|
|
|
+ /*else{
|
|
|
sprintf(cmd,"rm /mnt/%s",argv[2]);
|
|
|
system(cmd);
|
|
|
Result = json_object_new_string("error");
|
|
|
Message = json_object_new_string("machine is busy");
|
|
|
- }
|
|
|
+ }*/
|
|
|
json_object_object_add(jobj,"Result",Result);
|
|
|
json_object_object_add(jobj,"Message",Message);
|
|
|
printf("%s\n", json_object_to_json_string(jobj));
|
|
|
|
|
|
}
|
|
|
//web page query all
|
|
|
- if (argc == 2 & strcmp(argv[1], "query") == 0) {
|
|
|
+ if ((argc == 2) & (strcmp(argv[1], "query") == 0)) {
|
|
|
char *IsAcDc[2];
|
|
|
char *Connector1[2];
|
|
|
char *Connector2[2];
|
|
|
char *Connector3[2];
|
|
|
char *Network[2];
|
|
|
- substr(IsAcDc,ShmSysConfigAndInfo->SysConfig.ModelName,0,1);
|
|
|
- substr(Connector1,ShmSysConfigAndInfo->SysConfig.ModelName,7,1);
|
|
|
- substr(Connector2,ShmSysConfigAndInfo->SysConfig.ModelName,8,1);
|
|
|
- substr(Connector3,ShmSysConfigAndInfo->SysConfig.ModelName,9,1);
|
|
|
- substr(Network,ShmSysConfigAndInfo->SysConfig.ModelName,10,1);
|
|
|
- int connectorType1,connectorType2,connectorType3,modelType;
|
|
|
- connectorType1=ConnectorType(Connector1);
|
|
|
- connectorType2=ConnectorType(Connector2);
|
|
|
- connectorType3=ConnectorType(Connector3);
|
|
|
- modelType=ModelType(IsAcDc,Network);
|
|
|
+ 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 *)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("connectorType1:%d\n",connectorType1);
|
|
|
// printf("connectorType2:%d\n",connectorType2);
|
|
|
// printf("connectorType3:%d\n",connectorType3);
|
|
@@ -673,12 +818,12 @@ int main(int argc, char *argv[]) {
|
|
|
struct json_object *jobj2;
|
|
|
struct json_object *jobj3;
|
|
|
struct json_object *jobj4;
|
|
|
- struct json_object *array_obj;
|
|
|
+// 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 *SystemDateTime;
|
|
|
struct json_object *FactoryConfiguration;
|
|
|
struct json_object *AuthorisationMode;
|
|
|
struct json_object *DefaultLanguage;
|
|
@@ -727,8 +872,8 @@ 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 *CcsAuthentication;
|
|
|
+// struct json_object *AcCcsChargingMode;
|
|
|
struct json_object *UserId;
|
|
|
struct json_object *ChargingInfo1;
|
|
|
struct json_object *ChargingInfo2;
|
|
@@ -776,7 +921,7 @@ int main(int argc, char *argv[]) {
|
|
|
struct json_object *TelcomChapPapPwd;
|
|
|
struct json_object *TelcomModemImei;
|
|
|
struct json_object *TelcomSimImsi;
|
|
|
- struct json_object *TelcomSimIccid;
|
|
|
+// struct json_object *TelcomSimIccid;
|
|
|
struct json_object *TelcomSimStatus;
|
|
|
struct json_object *TelcomModemMode;
|
|
|
struct json_object *TelcomIpAddress;
|
|
@@ -791,46 +936,46 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
|
|
- array_obj = json_object_new_array();
|
|
|
+// array_obj = json_object_new_array();
|
|
|
jobj1=json_object_new_object();
|
|
|
jobj2=json_object_new_object();
|
|
|
jobj3=json_object_new_object();
|
|
|
jobj4=json_object_new_object();
|
|
|
//system
|
|
|
- ModelName = json_object_new_string(&ShmSysConfigAndInfo->SysConfig.ModelName);
|
|
|
- SerialNumber = json_object_new_string(&ShmSysConfigAndInfo->SysConfig.SerialNumber);
|
|
|
- SystemId = json_object_new_string(&ShmSysConfigAndInfo->SysConfig.SystemId);
|
|
|
+ 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);
|
|
|
- FactoryConfiguration = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.FactoryConfiguration,1);
|
|
|
- AuthorisationMode = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.AuthorisationMode,1);
|
|
|
- DefaultLanguage = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.DefaultLanguage,1);
|
|
|
+ FactoryConfiguration = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.FactoryConfiguration,1);
|
|
|
+ AuthorisationMode = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.AuthorisationMode,1);
|
|
|
+ DefaultLanguage = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.DefaultLanguage,1);
|
|
|
InputVoltageR = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageR);
|
|
|
InputVoltageS = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageS);
|
|
|
InputVoltageT = json_object_new_double(ShmSysConfigAndInfo->SysInfo.InputVoltageT);
|
|
|
SystemFanRotaSpeed = json_object_new_int((int)ShmSysConfigAndInfo->SysInfo.SystemFanRotaSpeed);
|
|
|
PsuFanRotaSpeed = json_object_new_int((int)ShmSysConfigAndInfo->SysInfo.PsuFanRotaSpeed);
|
|
|
- RfidCardNumEndian = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian,1);
|
|
|
- AuxPower5V = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.AuxPower5V,1);
|
|
|
- AuxPower12V = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.AuxPower12V,1);
|
|
|
- AuxPower24V = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.AuxPower24V,1);
|
|
|
- AuxPower48V = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.AuxPower48V,1);
|
|
|
- CsuHwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
|
|
|
- CsuBootLoadFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
|
|
|
- CsuKernelFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
|
|
|
- CsuRootFsFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
|
|
|
- CsuPrimFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
|
|
|
- LcmHwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
|
|
|
- LcmFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
|
|
|
- PsuHwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
|
|
|
- PsuPrimFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
|
|
|
- PsuSecFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
|
|
|
- AuxPwrHwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
|
|
|
- AuxPwrFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
|
|
|
- FanModuleHwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
|
|
|
- FanModuleFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
|
|
|
- RelayModuleHwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.RelayModuleHwRev);
|
|
|
- RelayModuleFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev);
|
|
|
- TelcomModemFwRev = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.TelcomModemFwRev);
|
|
|
+ RfidCardNumEndian = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian,1);
|
|
|
+ AuxPower5V = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.AuxPower5V,1);
|
|
|
+ AuxPower12V = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.AuxPower12V,1);
|
|
|
+ AuxPower24V = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.AuxPower24V,1);
|
|
|
+ AuxPower48V = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.AuxPower48V,1);
|
|
|
+ CsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuHwRev);
|
|
|
+ CsuBootLoadFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuBootLoadFwRev);
|
|
|
+ CsuKernelFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuKernelFwRev);
|
|
|
+ CsuRootFsFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
|
|
|
+ CsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev);
|
|
|
+ LcmHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmHwRev);
|
|
|
+ LcmFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.LcmFwRev);
|
|
|
+ PsuHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuHwRev);
|
|
|
+ PsuPrimFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuPrimFwRev);
|
|
|
+ PsuSecFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.PsuSecFwRev);
|
|
|
+ AuxPwrHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev);
|
|
|
+ AuxPwrFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev);
|
|
|
+ FanModuleHwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleHwRev);
|
|
|
+ FanModuleFwRev = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FanModuleFwRev);
|
|
|
+ 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);
|
|
|
SystemAmbientTemp = json_object_new_int((int)ShmSysConfigAndInfo->SysInfo.SystemAmbientTemp);
|
|
|
SystemCriticalTemp = json_object_new_int((int)ShmSysConfigAndInfo->SysInfo.SystemCriticalTemp);
|
|
|
CcsConnectorTemp = json_object_new_int((int)ShmSysConfigAndInfo->SysInfo.CcsConnectorTemp);
|
|
@@ -840,7 +985,7 @@ int main(int argc, char *argv[]) {
|
|
|
Ccs1PlugInTime = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.Ccs1PlugInTime);
|
|
|
Ccs2PlugInTimes = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.Ccs2PlugInTimes);
|
|
|
ChademoPlugInTimes = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.ChademoPlugInTimes);
|
|
|
- FirmwareUpdate = json_object_new_string(&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
|
|
|
+ FirmwareUpdate = json_object_new_string((char *)&ShmSysConfigAndInfo->SysInfo.FirmwareUpdate);
|
|
|
//charging
|
|
|
int CcsGunQty=0;
|
|
|
int GbGunQty=0;
|
|
@@ -852,18 +997,18 @@ int main(int argc, char *argv[]) {
|
|
|
MaxChargingPower = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.MaxChargingPower);
|
|
|
MaxChargingCurrent = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
|
|
|
MaxChargingDuration = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.MaxChargingDuration);
|
|
|
- PhaseLossPolicy = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy,1);
|
|
|
- LocalWhiteCard[0] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
|
|
|
- LocalWhiteCard[1] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
|
|
|
- LocalWhiteCard[2] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
|
|
|
- LocalWhiteCard[3] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
|
|
|
- LocalWhiteCard[4] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
|
|
|
- LocalWhiteCard[5] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
|
|
|
- LocalWhiteCard[6] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
|
|
|
- LocalWhiteCard[7] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[7]);
|
|
|
- LocalWhiteCard[8] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[8]);
|
|
|
- LocalWhiteCard[9] = json_object_new_string(ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[9]);
|
|
|
- UserId = json_object_new_string(&ShmSysConfigAndInfo->SysConfig.UserId);
|
|
|
+ PhaseLossPolicy = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy,1);
|
|
|
+ LocalWhiteCard[0] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[0]);
|
|
|
+ LocalWhiteCard[1] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[1]);
|
|
|
+ LocalWhiteCard[2] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[2]);
|
|
|
+ LocalWhiteCard[3] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[3]);
|
|
|
+ LocalWhiteCard[4] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[4]);
|
|
|
+ LocalWhiteCard[5] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[5]);
|
|
|
+ LocalWhiteCard[6] = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.LocalWhiteCard[6]);
|
|
|
+ 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);
|
|
|
if(connectorType1 != 0){
|
|
|
if(connectorType1 == 1){//CCS
|
|
|
PresentChargingVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].PresentChargingVoltage);
|
|
@@ -875,11 +1020,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
|
|
|
- SystemStatus[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus,1);
|
|
|
- Index[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index,1);
|
|
|
- Type[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type,1);
|
|
|
- type_index[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus,1);
|
|
|
+ Index[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index,1);
|
|
|
+ Type[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type,1);
|
|
|
+ type_index[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent,1);
|
|
|
CcsGunQty++;
|
|
|
}
|
|
|
else if(connectorType1 == 2){//GB
|
|
@@ -892,11 +1037,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
|
|
|
- SystemStatus[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].SystemStatus,1);
|
|
|
- Index[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Index,1);
|
|
|
- Type[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Type,1);
|
|
|
- type_index[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].SystemStatus,1);
|
|
|
+ Index[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Index,1);
|
|
|
+ Type[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Type,1);
|
|
|
+ type_index[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].EvBatterytargetCurrent,1);
|
|
|
GbGunQty++;
|
|
|
}
|
|
|
else if(connectorType1 == 3){//CHAdeMO
|
|
@@ -909,11 +1054,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[0] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
|
|
|
- SystemStatus[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].SystemStatus,1);
|
|
|
- Index[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Index,1);
|
|
|
- Type[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Type,1);
|
|
|
- type_index[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[0] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].SystemStatus,1);
|
|
|
+ Index[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Index,1);
|
|
|
+ Type[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Type,1);
|
|
|
+ type_index[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[0] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].EvBatterytargetCurrent,1);
|
|
|
CHAdeMOGunQty++;
|
|
|
}
|
|
|
}
|
|
@@ -928,11 +1073,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
|
|
|
- SystemStatus[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus,1);
|
|
|
- Index[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index,1);
|
|
|
- Type[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type,1);
|
|
|
- type_index[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus,1);
|
|
|
+ Index[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index,1);
|
|
|
+ Type[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type,1);
|
|
|
+ type_index[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent,1);
|
|
|
CcsGunQty++;
|
|
|
}
|
|
|
else if(connectorType2 == 2){//GB
|
|
@@ -945,11 +1090,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
|
|
|
- SystemStatus[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].SystemStatus,1);
|
|
|
- Index[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Index,1);
|
|
|
- Type[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Type,1);
|
|
|
- type_index[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].SystemStatus,1);
|
|
|
+ Index[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Index,1);
|
|
|
+ Type[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Type,1);
|
|
|
+ type_index[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].EvBatterytargetCurrent,1);
|
|
|
GbGunQty++;
|
|
|
}
|
|
|
else if(connectorType2 == 3){//CHAdeMO
|
|
@@ -962,11 +1107,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[1] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
|
|
|
- SystemStatus[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].SystemStatus,1);
|
|
|
- Index[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Index,1);
|
|
|
- Type[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Type,1);
|
|
|
- type_index[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[1] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].SystemStatus,1);
|
|
|
+ Index[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Index,1);
|
|
|
+ Type[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Type,1);
|
|
|
+ type_index[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[1] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].EvBatterytargetCurrent,1);
|
|
|
CHAdeMOGunQty++;
|
|
|
}
|
|
|
}
|
|
@@ -981,11 +1126,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterySoc);
|
|
|
- SystemStatus[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus,1);
|
|
|
- Index[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index,1);
|
|
|
- Type[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type,1);
|
|
|
- type_index[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].SystemStatus,1);
|
|
|
+ Index[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Index,1);
|
|
|
+ Type[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].Type,1);
|
|
|
+ type_index[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CcsGunQty].EvBatterytargetCurrent,1);
|
|
|
CcsGunQty++;
|
|
|
}
|
|
|
else if(connectorType3 == 2){//GB
|
|
@@ -998,11 +1143,11 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.GbChargingData[GbGunQty].EvBatterySoc);
|
|
|
- SystemStatus[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].SystemStatus,1);
|
|
|
- Index[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Index,1);
|
|
|
- Type[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Type,1);
|
|
|
- type_index[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].SystemStatus,1);
|
|
|
+ Index[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Index,1);
|
|
|
+ Type[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].Type,1);
|
|
|
+ type_index[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[GbGunQty].EvBatterytargetCurrent,1);
|
|
|
GbGunQty++;
|
|
|
}
|
|
|
else if(connectorType3 == 3){//CHAdeMO
|
|
@@ -1015,63 +1160,63 @@ int main(int argc, char *argv[]) {
|
|
|
EvBatteryMaxVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatteryMaxVoltage);
|
|
|
EvBatterytargetVoltage[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterytargetVoltage);
|
|
|
EvBatterySoc[2] = json_object_new_double(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[CHAdeMOGunQty].EvBatterySoc);
|
|
|
- SystemStatus[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].SystemStatus,1);
|
|
|
- Index[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Index,1);
|
|
|
- Type[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Type,1);
|
|
|
- type_index[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].type_index,1);
|
|
|
- EvBatterytargetCurrent[2] = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].EvBatterytargetCurrent,1);
|
|
|
+ SystemStatus[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].SystemStatus,1);
|
|
|
+ Index[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Index,1);
|
|
|
+ Type[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].Type,1);
|
|
|
+ type_index[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].type_index,1);
|
|
|
+ EvBatterytargetCurrent[2] = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.CcsChargingData[CHAdeMOGunQty].EvBatterytargetCurrent,1);
|
|
|
CHAdeMOGunQty++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//network
|
|
|
- InternetConn = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.InternetConn,1);
|
|
|
- FtpServer = json_object_new_string(&ShmSysConfigAndInfo->SysConfig.FtpServer);
|
|
|
- Eth0DhcpClient = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient,1);
|
|
|
- Eth0MacAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
|
|
|
- Eth0IpAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
|
|
|
- Eth0SubmaskAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
|
|
|
- Eth0GatewayAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
|
|
|
- Eth1DhcpClient = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient,1);
|
|
|
- Eth1MacAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
|
|
|
- Eth1IpAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
|
|
|
- Eth1SubmaskAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
|
|
|
- Eth1GatewayAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
|
|
|
- WifiMode = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode,1);
|
|
|
- WifiSsid = json_object_new_string(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
|
|
|
- WifiPassword = json_object_new_string(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
|
|
|
+ InternetConn = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.InternetConn,1);
|
|
|
+ FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
|
|
|
+ Eth0DhcpClient = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient,1);
|
|
|
+ Eth0MacAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthMacAddress);
|
|
|
+ Eth0IpAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress);
|
|
|
+ Eth0SubmaskAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
|
|
|
+ Eth0GatewayAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
|
|
|
+ Eth1DhcpClient = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthDhcpClient,1);
|
|
|
+ Eth1MacAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthMacAddress);
|
|
|
+ Eth1IpAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress);
|
|
|
+ Eth1SubmaskAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
|
|
|
+ Eth1GatewayAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthGatewayAddress);
|
|
|
+ WifiMode = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode,1);
|
|
|
+ WifiSsid = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
|
|
|
+ WifiPassword = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
|
|
|
WifiRssi = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
|
|
|
- WifiDhcpServer = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer,1);
|
|
|
- WifiDhcpClient = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient,1);
|
|
|
- WifiMacAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
|
|
|
- WifiIpAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
|
|
|
- WifiSubmaskAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
|
|
|
- WifiGatewayAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
|
|
|
- TelcomApn = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
|
|
|
+ WifiDhcpServer = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer,1);
|
|
|
+ WifiDhcpClient = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient,1);
|
|
|
+ WifiMacAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMacAddress);
|
|
|
+ WifiIpAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiIpAddress);
|
|
|
+ WifiSubmaskAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSubmaskAddress);
|
|
|
+ WifiGatewayAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiGatewayAddress);
|
|
|
+ TelcomApn = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
|
|
|
TelcomRssi = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
|
|
|
- TelcomChapPapId = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
|
|
|
- TelcomChapPapPwd = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
|
|
|
- TelcomModemImei = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
|
|
|
- TelcomSimImsi = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
|
|
|
+ TelcomChapPapId = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
|
|
|
+ TelcomChapPapPwd = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd);
|
|
|
+ TelcomModemImei = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);
|
|
|
+ TelcomSimImsi = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);
|
|
|
//TelcomSimIccid = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimIccid);
|
|
|
- TelcomSimStatus = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus,1);
|
|
|
- TelcomModemMode = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode,1);
|
|
|
- TelcomIpAddress = json_object_new_string(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
|
|
|
+ TelcomSimStatus = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus,1);
|
|
|
+ TelcomModemMode = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode,1);
|
|
|
+ TelcomIpAddress = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress);
|
|
|
//backend
|
|
|
BackendConnTimeout = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.BackendConnTimeout);
|
|
|
- OfflinePolicy = json_object_new_string_len(&ShmSysConfigAndInfo->SysConfig.OfflinePolicy,1);
|
|
|
+ OfflinePolicy = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysConfig.OfflinePolicy,1);
|
|
|
OfflineMaxChargeEnergy = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy);
|
|
|
OfflineMaxChargeDuration = json_object_new_int((int)ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration);
|
|
|
- OcppConnStatus = json_object_new_string_len(&ShmSysConfigAndInfo->SysInfo.OcppConnStatus,1);
|
|
|
- OcppServerURL = json_object_new_string(ShmSysConfigAndInfo->SysConfig.OcppServerURL);
|
|
|
- ChargeBoxId = json_object_new_string(ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
|
|
|
+ OcppConnStatus = json_object_new_string_len((char *)&ShmSysConfigAndInfo->SysInfo.OcppConnStatus,1);
|
|
|
+ OcppServerURL = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.OcppServerURL);
|
|
|
+ ChargeBoxId = json_object_new_string((char *)ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
|
|
|
|
|
|
|
|
|
//system
|
|
|
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,"SystemDateTime",SystemDateTime);
|
|
|
json_object_object_add(jobj1,"FactoryConfiguration",FactoryConfiguration);
|
|
|
json_object_object_add(jobj1,"AuthorisationMode",AuthorisationMode);
|
|
|
json_object_object_add(jobj1,"DefaultLanguage",DefaultLanguage);
|
|
@@ -1111,6 +1256,7 @@ int main(int argc, char *argv[]) {
|
|
|
json_object_object_add(jobj1,"Ccs1PlugInTimes",Ccs1PlugInTime);
|
|
|
json_object_object_add(jobj1,"Ccs2PlugInTimes",Ccs2PlugInTimes);
|
|
|
json_object_object_add(jobj1,"ChademoPlugInTimes",ChademoPlugInTimes);
|
|
|
+ json_object_object_add(jobj1,"FirmwareUpdate",FirmwareUpdate);
|
|
|
printf("%s\n", json_object_to_json_string(jobj1));
|
|
|
json_object_put(jobj1);
|
|
|
//charging
|