|
@@ -4943,7 +4943,8 @@ int ProcessShareMemory()
|
|
|
if((ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') &&
|
|
|
((ShmSysConfigAndInfo->SysConfig.ModelName[1]=='B') ||
|
|
|
(ShmSysConfigAndInfo->SysConfig.ModelName[1]=='K') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O'))
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='L'))
|
|
|
) // 'D' means DC
|
|
|
{
|
|
|
// DO series
|
|
@@ -12221,7 +12222,7 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
if(access(ROOTCA_V2G,F_OK) != -1)
|
|
|
{
|
|
|
DEBUG_INFO("Existed V2GRootCertificate is found. Replacing...\n");
|
|
|
- rename(ROOTCA_V2G, "/Storage/OCPP/rootCaV2g_fallback.pem");
|
|
|
+ rename(ROOTCA_V2G, "/Storage/rootCaV2g_fallback.pem");
|
|
|
rename(tempCert, ROOTCA_V2G);
|
|
|
}
|
|
|
else
|
|
@@ -12240,12 +12241,12 @@ int handleDataTransferRequest(char *uuid, char *payload)
|
|
|
if(access(ROOTCA_MO,F_OK) != -1)
|
|
|
{
|
|
|
DEBUG_INFO("Existed MORootCertificate is found. Replacing...\n");
|
|
|
- rename(ROOTCA_MO, "/Storage/OCPP/rootCaMo_fallback.pem");
|
|
|
+ rename(ROOTCA_MO, "/Storage/rootCaMo_fallback.pem");
|
|
|
rename(tempCert, ROOTCA_MO);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DEBUG_INFO("No existed V2GRootCertificate. Creating...\n");
|
|
|
+ DEBUG_INFO("No existed MORootCertificate. Creating...\n");
|
|
|
rename(tempCert, ROOTCA_MO);
|
|
|
}
|
|
|
|
|
@@ -12584,6 +12585,31 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
}
|
|
|
json_object_put(GetDiagnostics);
|
|
|
|
|
|
+ // Notify CSU to get log of dispensers.
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') &&
|
|
|
+ ((ShmSysConfigAndInfo->SysConfig.ModelName[1]=='B') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='K') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='L'))
|
|
|
+ )
|
|
|
+ {
|
|
|
+ sprintf((char *)ShmOCPP16Data->GetDiagnostics.StartTime,"%s",startTimestr);
|
|
|
+ sprintf((char *)ShmOCPP16Data->GetDiagnostics.StopTime,"%s",stopTimestr);
|
|
|
+
|
|
|
+ ShmOCPP16Data->MsMsg.bits.GetDiagnosticsReq = TRUE;
|
|
|
+
|
|
|
+ struct timespec timerGetDiagnostics;
|
|
|
+ refreshStartTimer(&timerGetDiagnostics);
|
|
|
+ while(ShmOCPP16Data->MsMsg.bits.GetDiagnosticsReq != FALSE)
|
|
|
+ {
|
|
|
+ if(getDiffSecNow(timerGetDiagnostics)>=180)
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->MsMsg.bits.GetDiagnosticsReq = FALSE;
|
|
|
+ DEBUG_INFO("Waiting log of dispenser timeout.");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Pack log to compress file
|
|
|
if((sscanf((char*)startTimestr, "%4d-%2d-%2dT%2d:%2d:%2d", &tmStart.tm_year, &tmStart.tm_mon, &tmStart.tm_mday, &tmStart.tm_hour, &tmStart.tm_min, &tmStart.tm_sec) == 6) &&
|
|
|
(sscanf((char*)stopTimestr, "%4d-%2d-%2dT%2d:%2d:%2d", &tmStop.tm_year, &tmStop.tm_mon, &tmStop.tm_mday, &tmStop.tm_hour, &tmStop.tm_min, &tmStop.tm_sec) == 6))
|
|
@@ -12613,6 +12639,9 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
|
|
|
sprintf(cmdBuf, "%s /Storage/CCS*.zip", cmdBuf);
|
|
|
sprintf(cmdBuf, "%s /Storage/OCPP/*.db", cmdBuf);
|
|
|
+ sprintf(cmdBuf, "%s /Storage/OCPP/TransactionRelatedQueue", cmdBuf);
|
|
|
+ sprintf(cmdBuf, "%s /Storage/OCPP/QueueTransactionId", cmdBuf);
|
|
|
+ sprintf(cmdBuf, "%s /Storage/OCPP/OCPPConfiguration", cmdBuf);
|
|
|
system(cmdBuf);
|
|
|
|
|
|
// Pack charging & event log
|
|
@@ -12994,6 +13023,24 @@ int handleRemoteStartRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
ShmOCPP16Data->RemoteStartTransaction[connectorIdInt -1].ChargingProfile.ChargingProfileId = -1;
|
|
|
}
|
|
|
+
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.ModelName[0] != 'D') && (ShmSysConfigAndInfo->SysConfig.ModelName[1] != 'W'))
|
|
|
+ {
|
|
|
+ for(uint8_t gun_index=0;gun_index<gunTotalNumber;gun_index++)
|
|
|
+ {
|
|
|
+ if(cpinitateMsg.bits[gun_index].isOnCharging ||
|
|
|
+ (strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "Preparing") != NULL) ||
|
|
|
+ (strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "Finishing") != NULL))
|
|
|
+ {
|
|
|
+ if(connectorIdInt != (gun_index+1))
|
|
|
+ {
|
|
|
+ DEBUG_WARN("DWseries--> Other connector is in charging.\n");
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -15881,11 +15928,11 @@ int handleDeleteCertificateRequest(char *uuid, char *payload)
|
|
|
}
|
|
|
|
|
|
// Check ManufacturerRootCertificate
|
|
|
- if(access(ROOTCA_MFG,F_OK) != -1)
|
|
|
+ if(access(ROOTCA_MF,F_OK) != -1)
|
|
|
{
|
|
|
DEBUG_INFO("Checking ManufacturerRootCertificate...\n");
|
|
|
isMatch = TRUE;
|
|
|
- parseCertInfo(ROOTCA_MFG, CERT_PARSE_SerialNumber, compareData);
|
|
|
+ parseCertInfo(ROOTCA_MF, CERT_PARSE_SerialNumber, compareData);
|
|
|
for(int i = 0; compareData[i]; i++)
|
|
|
{
|
|
|
compareData[i] = tolower(compareData[i]);
|
|
@@ -15895,7 +15942,7 @@ int handleDeleteCertificateRequest(char *uuid, char *payload)
|
|
|
|
|
|
if(isMatch == TRUE)
|
|
|
{
|
|
|
- parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerNameHash, compareData);
|
|
|
+ parseCertInfo(ROOTCA_MF, CERT_PARSE_IssuerNameHash, compareData);
|
|
|
for(int i = 0; compareData[i]; i++)
|
|
|
{
|
|
|
compareData[i] = tolower(compareData[i]);
|
|
@@ -15906,7 +15953,7 @@ int handleDeleteCertificateRequest(char *uuid, char *payload)
|
|
|
|
|
|
if(isMatch == TRUE)
|
|
|
{
|
|
|
- parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerKeyHash, compareData);
|
|
|
+ parseCertInfo(ROOTCA_MF, CERT_PARSE_IssuerKeyHash, compareData);
|
|
|
for(int i = 0; compareData[i]; i++)
|
|
|
{
|
|
|
compareData[i] = tolower(compareData[i]);
|
|
@@ -15918,7 +15965,7 @@ int handleDeleteCertificateRequest(char *uuid, char *payload)
|
|
|
if(isMatch == TRUE)
|
|
|
{
|
|
|
DEBUG_INFO("Deleting ManufacturerRootCertificate...\n");
|
|
|
- sprintf(temp, "rm -f %s", ROOTCA_MFG);
|
|
|
+ sprintf(temp, "rm -f %s", ROOTCA_MF);
|
|
|
system(temp);
|
|
|
sprintf((char*)ShmOCPP16Data->DeleteCertificate.Response_status, "Accepted");
|
|
|
goto End;
|
|
@@ -15975,7 +16022,7 @@ End:
|
|
|
json_object_put(DeleteCertificate);
|
|
|
ShmOCPP16Data->MsMsg.bits.DeleteCertificateReq = 1;
|
|
|
sendDeleteCertificateConfirmation(uuid);
|
|
|
-
|
|
|
+ system("/bin/fsync -d /dev/mtdblock13;/bin/sync &");
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -16144,19 +16191,19 @@ int handleGetInstalledCertificateIdsRequest(char *uuid, char *payload)
|
|
|
// Check ManufacturerRootCertificate
|
|
|
else if(strstr((char*)ShmOCPP16Data->GetInstalledCertificateIds.certificateType, "ManufacturerRootCertificate") != NULL)
|
|
|
{
|
|
|
- if(access(ROOTCA_MFG,F_OK) != -1)
|
|
|
+ if(access(ROOTCA_MF,F_OK) != -1)
|
|
|
{
|
|
|
char parseData[512] = {0};
|
|
|
- if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_HashAlgorithm, parseData) == PASS)
|
|
|
+ if(parseCertInfo(ROOTCA_MF, CERT_PARSE_HashAlgorithm, parseData) == PASS)
|
|
|
sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].hashAlgorithm, parseData);
|
|
|
|
|
|
- if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_SerialNumber, parseData) == PASS)
|
|
|
+ if(parseCertInfo(ROOTCA_MF, CERT_PARSE_SerialNumber, parseData) == PASS)
|
|
|
sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].serialNumber, parseData);
|
|
|
|
|
|
- if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerNameHash, parseData) == PASS)
|
|
|
+ if(parseCertInfo(ROOTCA_MF, CERT_PARSE_IssuerNameHash, parseData) == PASS)
|
|
|
sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerNameHash, parseData);
|
|
|
|
|
|
- if(parseCertInfo(ROOTCA_MFG, CERT_PARSE_IssuerKeyHash, parseData) == PASS)
|
|
|
+ if(parseCertInfo(ROOTCA_MF, CERT_PARSE_IssuerKeyHash, parseData) == PASS)
|
|
|
sprintf((char*)ShmOCPP16Data->GetInstalledCertificateIds.Response_certificateHashData[0].issuerKeyHash, parseData);
|
|
|
}
|
|
|
else
|
|
@@ -16638,16 +16685,16 @@ End:
|
|
|
}
|
|
|
else if(strcmp((char*)ShmOCPP16Data->InstallCertificate.certificateType, "ManufacturerRootCertificate") == 0)
|
|
|
{
|
|
|
- if(access(ROOTCA_MFG,F_OK) != -1)
|
|
|
+ if(access(ROOTCA_MF,F_OK) != -1)
|
|
|
{
|
|
|
DEBUG_INFO("Existed ManufacturerRootCertificate is found. Replacing...\n");
|
|
|
- rename(ROOTCA_MFG, "/Storage/OCPP/ManufacturerRootCertificate_fallback.pem");
|
|
|
- rename(tempCert, ROOTCA_MFG);
|
|
|
+ rename(ROOTCA_MF, "/Storage/OCPP/ManufacturerRootCertificate_fallback.pem");
|
|
|
+ rename(tempCert, ROOTCA_MF);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
DEBUG_INFO("No existed ManufacturerRootCertificate. Creating...\n");
|
|
|
- rename(tempCert, ROOTCA_MFG);
|
|
|
+ rename(tempCert, ROOTCA_MF);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -17401,6 +17448,7 @@ void handleStartTransactionResponse(char *payload, int gun_index)
|
|
|
sprintf(data,"%d,%s,%d\n", ShmOCPP16Data->StartTransaction[gun_index].ConnectorId , ShmOCPP16Data->StartTransaction[gun_index].IdTag, ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId); // GunIndex, idtag, TransactionId
|
|
|
fputs(data, outfile);
|
|
|
fclose (outfile);
|
|
|
+ DEBUG_INFO("Update QueueTransactionId done...\n");
|
|
|
}
|
|
|
|
|
|
DEBUG_INFO("idTagInfo-expiryDate: %s\n", ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ExpiryDate);
|