|
@@ -273,11 +273,11 @@ int StoreUsrConfigData(struct SysConfigData *UsrData)
|
|
|
if (fd>0)
|
|
|
{
|
|
|
wrd=write(fd, BufTmp, MtdBlockSize);
|
|
|
- close(fd);
|
|
|
- if(wrd<MtdBlockSize)
|
|
|
+ close(fd);
|
|
|
+ if(wrd<MtdBlockSize)
|
|
|
{
|
|
|
DEBUG_ERROR("write /dev/mtdblock11(backup) NG\r\n");
|
|
|
- result = FAIL;
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -288,8 +288,8 @@ int StoreUsrConfigData(struct SysConfigData *UsrData)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DEBUG_ERROR("write /dev/mtdblock10 NG\r\n");
|
|
|
- result = FAIL;
|
|
|
+ DEBUG_ERROR("write /dev/mtdblock10 NG\r\n");
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -301,7 +301,7 @@ int StoreUsrConfigData(struct SysConfigData *UsrData)
|
|
|
else
|
|
|
{
|
|
|
DEBUG_ERROR("alloc BlockSize NG\r\n");
|
|
|
- result = FAIL;
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
|
|
|
if(BufTmp!=NULL)
|
|
@@ -582,6 +582,7 @@ int main(int argc, char *argv[]) {
|
|
|
int OfflineMaxChargeDuration=0;
|
|
|
char *OcppServerURL=NULL;
|
|
|
char *ChargeBoxId=NULL;
|
|
|
+ char *chargePointVendor=NULL;
|
|
|
|
|
|
if( json_object_object_get_ex(jobj, "BackendConnTimeout", &val_obj) ) {
|
|
|
BackendConnTimeout = json_object_get_int(val_obj);
|
|
@@ -601,6 +602,9 @@ int main(int argc, char *argv[]) {
|
|
|
if( json_object_object_get_ex(jobj, "ChargeBoxId", &val_obj) ) {
|
|
|
ChargeBoxId = (char*)json_object_get_string(val_obj);
|
|
|
}
|
|
|
+ if( json_object_object_get_ex(jobj, "chargePointVendor", &val_obj) ) {
|
|
|
+ chargePointVendor = (char*)json_object_get_string(val_obj);
|
|
|
+ }
|
|
|
|
|
|
ShmSysConfigAndInfo->SysConfig.BackendConnTimeout = BackendConnTimeout;
|
|
|
ShmSysConfigAndInfo->SysConfig.OfflinePolicy = OfflinePolicy;
|
|
@@ -608,6 +612,7 @@ int main(int argc, char *argv[]) {
|
|
|
ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration = OfflineMaxChargeDuration;
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,OcppServerURL);
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,ChargeBoxId);
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,chargePointVendor);
|
|
|
}
|
|
|
struct SysConfigData SysConfig;
|
|
|
memcpy(&SysConfig, &ShmSysConfigAndInfo->SysConfig, sizeof(struct SysConfigData));
|
|
@@ -749,6 +754,7 @@ int main(int argc, char *argv[]) {
|
|
|
ShmSysConfigAndInfo->SysInfo.OcppConnStatus=0;
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"");
|
|
|
strcpy((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"");
|
|
|
+ strcpy((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor,"Phihong");
|
|
|
|
|
|
ShmSysConfigAndInfo->SysInfo.FirmwareUpdate=0;
|
|
|
struct SysConfigData SysConfig;
|
|
@@ -945,6 +951,7 @@ int main(int argc, char *argv[]) {
|
|
|
struct json_object *OcppConnStatus;
|
|
|
struct json_object *OcppServerURL;
|
|
|
struct json_object *ChargeBoxId;
|
|
|
+ struct json_object *chargePointVendor;
|
|
|
|
|
|
// array_obj = json_object_new_array();
|
|
|
jobj1=json_object_new_object();
|
|
@@ -1348,6 +1355,7 @@ int main(int argc, char *argv[]) {
|
|
|
OcppConnStatus = json_object_new_int(ShmSysConfigAndInfo->SysInfo.OcppConnStatus);
|
|
|
OcppServerURL = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL);
|
|
|
ChargeBoxId = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
|
|
|
+ chargePointVendor = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.chargePointVendor);
|
|
|
|
|
|
//system
|
|
|
json_object_object_add(jobj1,"ModelName",ModelName);
|
|
@@ -1535,6 +1543,7 @@ int main(int argc, char *argv[]) {
|
|
|
json_object_object_add(jobj4,"OcppConnStatus",OcppConnStatus);
|
|
|
json_object_object_add(jobj4,"OcppServerURL",OcppServerURL);
|
|
|
json_object_object_add(jobj4,"ChargeBoxId",ChargeBoxId);
|
|
|
+ json_object_object_add(jobj4,"chargePointVendor",chargePointVendor);
|
|
|
printf("%s\n", json_object_to_json_string(jobj4));
|
|
|
json_object_put(jobj4);
|
|
|
}
|