|
@@ -43,6 +43,7 @@
|
|
|
#include <mcheck.h>
|
|
|
|
|
|
|
|
|
+
|
|
|
#define PASS 1
|
|
|
#define FAIL -1
|
|
|
|
|
@@ -115,8 +116,10 @@ static char idTagAuthorization[32]={0};
|
|
|
|
|
|
|
|
|
|
|
|
-char OcppPath[160]={};
|
|
|
-char OcppProtocol[10]={0},OcppHost[50]={0}, OcppTempPath[50]={0};
|
|
|
+extern char OcppPath[160];
|
|
|
+extern char OcppProtocol[10];
|
|
|
+extern char OcppHost[50];
|
|
|
+extern char OcppTempPath[50];
|
|
|
int OcppPort=0;
|
|
|
|
|
|
|
|
@@ -6467,7 +6470,7 @@ int handleGetDiagnosticsRequest(char *uuid, char *payload)
|
|
|
|
|
|
sendGetDiagnosticsConfirmation(uuid,fname);
|
|
|
pthread_create(&t, NULL, GetDiagnosticsProcess, payload);
|
|
|
- pthread_join(t, NULL);
|
|
|
+
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -6475,6 +6478,7 @@ int handleGetDiagnosticsRequest(char *uuid, char *payload)
|
|
|
|
|
|
void* GetDiagnosticsProcess(void* data)
|
|
|
{
|
|
|
+ pthread_detach(pthread_self());
|
|
|
mtrace();
|
|
|
int retriesInt=0, retryIntervalInt=0;
|
|
|
char locationstr[100]={0}, startTimestr[30]={0}, stopTimestr[30]={0} ;
|
|
@@ -6702,7 +6706,7 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
|
|
|
|
|
|
do{
|
|
|
- isSuccess = httpUploadFile(host, ftppath, filenametemp, locationstr);
|
|
|
+ isSuccess = httpUploadFile(host, ftppath, fnamePlusPath, locationstr);
|
|
|
sleep(retryIntervalInt);
|
|
|
}while((isSuccess == 0)&&(retriesInt > 0 && retriesInt --));
|
|
|
|
|
@@ -9587,7 +9591,7 @@ int handleUpdateFirmwareRequest(char *uuid, char *payload)
|
|
|
sendUpdateFirmwareConfirmation(uuid);
|
|
|
pthread_create(&t, NULL, UpdateFirmwareProcess, payload);
|
|
|
|
|
|
- pthread_detach(t);
|
|
|
+
|
|
|
|
|
|
|
|
|
ShmOCPP16Data->MsMsg.bits.UpdateFirmwareConf =1;
|
|
@@ -9597,6 +9601,7 @@ int handleUpdateFirmwareRequest(char *uuid, char *payload)
|
|
|
|
|
|
void *UpdateFirmwareProcess(void *data)
|
|
|
{
|
|
|
+ pthread_detach(pthread_self());
|
|
|
mtrace();
|
|
|
int retriesInt =0, retryIntervalInt=0;
|
|
|
char protocol[10], user[50],password[50],host[50], path[50], ftppath[60],host1[50],path1[20];
|
|
@@ -10640,7 +10645,7 @@ int initialConfigurationTable(void)
|
|
|
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemAccessibility = 1;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemName, "ConnectionTimeOut");
|
|
|
- strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemData, "60" );
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemData, "180" );
|
|
|
|
|
|
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[GetConfigurationMaxKeys].ItemAccessibility =0;
|
|
@@ -10707,7 +10712,15 @@ int initialConfigurationTable(void)
|
|
|
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemAccessibility = 0;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemName, "NumberOfConnectors");
|
|
|
- strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemData, "3" );
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemData, "%d", (CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemData, "%d", AC_QUANTITY);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ResetRetries].ItemAccessibility = 1;
|
|
@@ -12490,6 +12503,7 @@ int httpUploadFile(char *location, char *path, char *filename,char *url)
|
|
|
|
|
|
DEBUG_INFO("filename=%s\n",filename);
|
|
|
DEBUG_INFO("url=%s\n",url);
|
|
|
+
|
|
|
sprintf(FilePath,"%s","../mnt/upload_file.txt");
|
|
|
|
|
|
if((access(FilePath,F_OK))!=-1)
|
|
@@ -12991,9 +13005,9 @@ void OCPP_deleteIdTag(char *idTag)
|
|
|
|
|
|
}
|
|
|
|
|
|
-char *GetOcppServerURL()
|
|
|
+int GetOcppServerURL()
|
|
|
{
|
|
|
-
|
|
|
+ int result = FALSE;
|
|
|
memset(OcppProtocol, 0, sizeof(OcppProtocol));
|
|
|
memset(OcppHost, 0, sizeof(OcppHost));
|
|
|
memset(OcppTempPath, 0, sizeof(OcppTempPath));
|
|
@@ -13004,6 +13018,7 @@ char *GetOcppServerURL()
|
|
|
sscanf((const char *)ShmSysConfigAndInfo->SysConfig.OcppServerURL,
|
|
|
"%[^:]:%*2[/]%[^:]:%i/%[a-zA-Z0-9._/-]",
|
|
|
OcppProtocol, OcppHost, &OcppPort, OcppTempPath);
|
|
|
+ result = TRUE;
|
|
|
|
|
|
|
|
|
|
|
@@ -13016,6 +13031,7 @@ char *GetOcppServerURL()
|
|
|
sscanf((const char *)ShmOCPP16Data->OcppServerURL,
|
|
|
"%[^:]:%*2[/]%[^:]:%i/%[a-zA-Z0-9._/-]",
|
|
|
OcppProtocol, OcppHost, &OcppPort, OcppTempPath);
|
|
|
+ result = TRUE;
|
|
|
|
|
|
|
|
|
|
|
@@ -13029,11 +13045,12 @@ char *GetOcppServerURL()
|
|
|
}
|
|
|
|
|
|
End:
|
|
|
- return OcppHost;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
-char *GetOcppPath()
|
|
|
+int GetOcppPath()
|
|
|
{
|
|
|
+ int result = FALSE;
|
|
|
if((ShmSysConfigAndInfo->SysConfig.ChargeBoxId != NULL) && (strcmp((const char *)ShmSysConfigAndInfo->SysConfig.ChargeBoxId,"") != 0) )
|
|
|
{
|
|
|
if(OcppTempPath == NULL)
|
|
@@ -13044,6 +13061,7 @@ char *GetOcppPath()
|
|
|
{
|
|
|
sprintf(OcppPath,"/%s%s",OcppTempPath,ShmSysConfigAndInfo->SysConfig.ChargeBoxId);
|
|
|
}
|
|
|
+ result = TRUE;
|
|
|
goto End;
|
|
|
}
|
|
|
else if((ShmOCPP16Data->ChargeBoxId != NULL) && (strcmp((const char *)ShmOCPP16Data->ChargeBoxId,"") != 0))
|
|
@@ -13056,16 +13074,17 @@ char *GetOcppPath()
|
|
|
{
|
|
|
sprintf(OcppPath,"/%s%s",OcppTempPath,ShmOCPP16Data->ChargeBoxId);
|
|
|
}
|
|
|
+ result = TRUE;
|
|
|
goto End;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- strcpy(OcppHost,"");
|
|
|
+ strcpy(OcppPath,"");
|
|
|
}
|
|
|
|
|
|
End:
|
|
|
DEBUG_INFO("OcppPath=%s\n",OcppPath);
|
|
|
- return OcppPath;
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
int GetOcppPort()
|