|
@@ -1975,14 +1975,9 @@ int main(int argc, char *argv[]) {
|
|
|
struct json_object *isCalibratedPa[3];
|
|
|
struct json_object *isCalibratedPb[3];
|
|
|
struct json_object *isCalibratedPc[3];
|
|
|
- struct json_object *ChargePointPrivateKey;
|
|
|
- struct json_object *ChargePointCertificate;
|
|
|
struct json_object *V2GPrivateKey;
|
|
|
struct json_object *V2GRootCertificate;
|
|
|
struct json_object *V2GCertificateChain;
|
|
|
- struct json_object *MORootCertificate;
|
|
|
- struct json_object *CSRootCertificate;
|
|
|
- struct json_object *ManufacturerRootCertificate;
|
|
|
/* for DO & DD*/
|
|
|
struct json_object *DDChargingInfo1;
|
|
|
struct json_object *DDChargingInfo2;
|
|
@@ -2068,6 +2063,11 @@ int main(int argc, char *argv[]) {
|
|
|
struct json_object *PowerSharingServerIP;
|
|
|
struct json_object *OcppReceiptrURL;
|
|
|
struct json_object *MaintainServerURL;
|
|
|
+ struct json_object *ChargePointPrivateKey;
|
|
|
+ struct json_object *ChargePointCertificate;
|
|
|
+ struct json_object *MORootCertificate;
|
|
|
+ struct json_object *CSRootCertificate;
|
|
|
+ struct json_object *ManufacturerRootCertificate;
|
|
|
/*for TTIA*/
|
|
|
struct json_object *isEnableTTIA;
|
|
|
struct json_object *server_addr;
|
|
@@ -2719,34 +2719,6 @@ int main(int argc, char *argv[]) {
|
|
|
//V2G certificate
|
|
|
FILE *file;
|
|
|
char line[0];
|
|
|
- ChargePointPrivateKey = json_object_new_string("");
|
|
|
- file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
|
|
|
- if (NULL != file)
|
|
|
- {
|
|
|
- int i=0;
|
|
|
- while (fgets(line, 65, file) != NULL)
|
|
|
- {
|
|
|
- if(i==0){
|
|
|
- ChargePointPrivateKey = json_object_new_string(line);
|
|
|
- }
|
|
|
- i++;
|
|
|
- }
|
|
|
- }
|
|
|
- pclose(file);
|
|
|
- ChargePointCertificate = json_object_new_string("");
|
|
|
- file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
|
|
|
- if (NULL != file)
|
|
|
- {
|
|
|
- int i=0;
|
|
|
- while (fgets(line, 65, file) != NULL)
|
|
|
- {
|
|
|
- if(i==0){
|
|
|
- ChargePointCertificate = json_object_new_string(line);
|
|
|
- }
|
|
|
- i++;
|
|
|
- }
|
|
|
- }
|
|
|
- pclose(file);
|
|
|
V2GPrivateKey = json_object_new_string("");
|
|
|
file = popen("sha256sum /Storage/certV2G.key", "r");
|
|
|
if (NULL != file)
|
|
@@ -2789,48 +2761,6 @@ int main(int argc, char *argv[]) {
|
|
|
}
|
|
|
}
|
|
|
pclose(file);
|
|
|
- MORootCertificate = json_object_new_string("");
|
|
|
- file = popen("sha256sum /Storage/rootCaMo.pem", "r");
|
|
|
- if (NULL != file)
|
|
|
- {
|
|
|
- int i=0;
|
|
|
- while (fgets(line, 65, file) != NULL)
|
|
|
- {
|
|
|
- if(i==0){
|
|
|
- MORootCertificate = json_object_new_string(line);
|
|
|
- }
|
|
|
- i++;
|
|
|
- }
|
|
|
- }
|
|
|
- pclose(file);
|
|
|
- CSRootCertificate = json_object_new_string("");
|
|
|
- file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
|
|
|
- if (NULL != file)
|
|
|
- {
|
|
|
- int i=0;
|
|
|
- while (fgets(line, 65, file) != NULL)
|
|
|
- {
|
|
|
- if(i==0){
|
|
|
- CSRootCertificate = json_object_new_string(line);
|
|
|
- }
|
|
|
- i++;
|
|
|
- }
|
|
|
- }
|
|
|
- pclose(file);
|
|
|
- ManufacturerRootCertificate = json_object_new_string("");
|
|
|
- file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
|
|
|
- if (NULL != file)
|
|
|
- {
|
|
|
- int i=0;
|
|
|
- while (fgets(line, 65, file) != NULL)
|
|
|
- {
|
|
|
- if(i==0){
|
|
|
- ManufacturerRootCertificate = json_object_new_string(line);
|
|
|
- }
|
|
|
- i++;
|
|
|
- }
|
|
|
- }
|
|
|
- pclose(file);
|
|
|
//network
|
|
|
InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
|
|
|
FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
|
|
@@ -2913,6 +2843,77 @@ int main(int argc, char *argv[]) {
|
|
|
TTIAChargeBoxId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
|
|
|
evseStation = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
|
|
|
}
|
|
|
+ //PnC certificate
|
|
|
+ ChargePointPrivateKey = json_object_new_string("");
|
|
|
+ file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
|
|
|
+ if (NULL != file)
|
|
|
+ {
|
|
|
+ int i=0;
|
|
|
+ while (fgets(line, 65, file) != NULL)
|
|
|
+ {
|
|
|
+ if(i==0){
|
|
|
+ ChargePointPrivateKey = json_object_new_string(line);
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(file);
|
|
|
+ ChargePointCertificate = json_object_new_string("");
|
|
|
+ file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
|
|
|
+ if (NULL != file)
|
|
|
+ {
|
|
|
+ int i=0;
|
|
|
+ while (fgets(line, 65, file) != NULL)
|
|
|
+ {
|
|
|
+ if(i==0){
|
|
|
+ ChargePointCertificate = json_object_new_string(line);
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(file);
|
|
|
+ MORootCertificate = json_object_new_string("");
|
|
|
+ file = popen("sha256sum /Storage/rootCaMo.pem", "r");
|
|
|
+ if (NULL != file)
|
|
|
+ {
|
|
|
+ int i=0;
|
|
|
+ while (fgets(line, 65, file) != NULL)
|
|
|
+ {
|
|
|
+ if(i==0){
|
|
|
+ MORootCertificate = json_object_new_string(line);
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(file);
|
|
|
+ CSRootCertificate = json_object_new_string("");
|
|
|
+ file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
|
|
|
+ if (NULL != file)
|
|
|
+ {
|
|
|
+ int i=0;
|
|
|
+ while (fgets(line, 65, file) != NULL)
|
|
|
+ {
|
|
|
+ if(i==0){
|
|
|
+ CSRootCertificate = json_object_new_string(line);
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(file);
|
|
|
+ ManufacturerRootCertificate = json_object_new_string("");
|
|
|
+ file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
|
|
|
+ if (NULL != file)
|
|
|
+ {
|
|
|
+ int i=0;
|
|
|
+ while (fgets(line, 65, file) != NULL)
|
|
|
+ {
|
|
|
+ if(i==0){
|
|
|
+ ManufacturerRootCertificate = json_object_new_string(line);
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(file);
|
|
|
|
|
|
//system
|
|
|
json_object_object_add(jobj1,"ModelName",ModelName);
|
|
@@ -3276,14 +3277,9 @@ int main(int argc, char *argv[]) {
|
|
|
json_object_object_add(jobj2,"DDChargingInfo4",DDChargingInfo4);
|
|
|
}
|
|
|
}
|
|
|
- json_object_object_add(jobj2,"ChargePointPrivateKey",ChargePointPrivateKey);
|
|
|
- json_object_object_add(jobj2,"ChargePointCertificate",ChargePointCertificate);
|
|
|
json_object_object_add(jobj2,"V2GPrivateKey",V2GPrivateKey);
|
|
|
json_object_object_add(jobj2,"V2GRootCertificate",V2GRootCertificate);
|
|
|
json_object_object_add(jobj2,"V2GCertificateChain",V2GCertificateChain);
|
|
|
- json_object_object_add(jobj2,"MORootCertificate",MORootCertificate);
|
|
|
- json_object_object_add(jobj2,"CSRootCertificate",CSRootCertificate);
|
|
|
- json_object_object_add(jobj2,"ManufacturerRootCertificate",ManufacturerRootCertificate);
|
|
|
printf("%s\n", json_object_to_json_string(jobj2));
|
|
|
json_object_put(jobj2);
|
|
|
|
|
@@ -3373,6 +3369,11 @@ int main(int argc, char *argv[]) {
|
|
|
json_object_object_add(jobj4,"TTIAChargeBoxId",TTIAChargeBoxId);
|
|
|
json_object_object_add(jobj4,"evseStation",evseStation);
|
|
|
}
|
|
|
+ json_object_object_add(jobj4,"ChargePointPrivateKey",ChargePointPrivateKey);
|
|
|
+ json_object_object_add(jobj4,"ChargePointCertificate",ChargePointCertificate);
|
|
|
+ json_object_object_add(jobj4,"MORootCertificate",MORootCertificate);
|
|
|
+ json_object_object_add(jobj4,"CSRootCertificate",CSRootCertificate);
|
|
|
+ json_object_object_add(jobj4,"ManufacturerRootCertificate",ManufacturerRootCertificate);
|
|
|
|
|
|
printf("%s\n", json_object_to_json_string(jobj4));
|
|
|
json_object_put(jobj4);
|