|
@@ -44,7 +44,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
#define PASS 1
|
|
|
#define FAIL -1
|
|
|
|
|
@@ -1171,8 +1170,11 @@ void CheckSystemValue(void)
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
if((server_sign == TRUE) && (difftime(time((time_t*)NULL), clientTime.Heartbeat) >= HeartBeatWaitTime))
|
|
|
{
|
|
|
+ printf("Heartbeat !!!\n");
|
|
|
|
|
|
sendHeartbeatRequest(0);
|
|
|
|
|
@@ -1994,14 +1996,6 @@ int sendStartTransactionRequest(int gun_index)
|
|
|
sprintf(usec_buf,"%dZ",(int)tmnow.tv_usec);
|
|
|
strcat(buf,usec_buf);
|
|
|
#endif
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
ShmOCPP16Data->StartTransaction[gun_index].ConnectorId = gun_index +1 ;
|
|
|
strcpy((char *)ShmOCPP16Data->StartTransaction[gun_index].Timestamp, buf);
|
|
@@ -6304,8 +6298,8 @@ int handleGetDiagnosticsRequest(char *uuid, char *payload)
|
|
|
mtrace();
|
|
|
int result = FAIL;
|
|
|
|
|
|
- char fnamePlusPath[50]="";
|
|
|
- char fname[16]="";
|
|
|
+ char fnamePlusPath[100]="";
|
|
|
+ char fname[40]="";
|
|
|
pthread_t t;
|
|
|
time_t rawtime;
|
|
|
struct tm * timeinfo;
|
|
@@ -6322,7 +6316,7 @@ int handleGetDiagnosticsRequest(char *uuid, char *payload)
|
|
|
if((access(fnamePlusPath,F_OK))!=-1)
|
|
|
{
|
|
|
DEBUG_INFO("fnamePlusPath exist.\n");
|
|
|
- strftime (fname,sizeof(fname),"%4Y-%2m.zip",timeinfo);
|
|
|
+ strftime (fname,sizeof(fname),"%4Y-%2m-%d-%H-%M-%S.zip",timeinfo);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -6349,8 +6343,8 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
int retriesIsNULL,retryIntervalIsNULL, startTimeIsNULL, stopTimeIsNULL;
|
|
|
char protocol[10]={0}, user[50]={0},password[50]={0},host[50]={0}, path[50]={0}, ftppath[60]={0},host1[50]={0},path1[50]={0};
|
|
|
int port=0;
|
|
|
- char fnamePlusPath[50]="";
|
|
|
- char fname[16]="";
|
|
|
+ char fnamePlusPath[100]="";
|
|
|
+ char fname[40]="";
|
|
|
char sstr[260]={ 0 };
|
|
|
int c = 0;
|
|
|
char *loc;
|
|
@@ -6366,7 +6360,7 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
|
|
|
retriesIsNULL = retryIntervalIsNULL = startTimeIsNULL = stopTimeIsNULL = FALSE;
|
|
|
|
|
|
- DEBUG_INFO("sendDiagnosticsStatusNotificationRequest 1\n");
|
|
|
+ DEBUG_INFO("GetDiagnosticsProcess\n");
|
|
|
sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_Uploading]);
|
|
|
|
|
|
|
|
@@ -6488,7 +6482,7 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
|
|
|
timeinfo = localtime (&rawtime);
|
|
|
strftime (fnamePlusPath,sizeof(fnamePlusPath),"../mnt/%4Y-%2m.zip",timeinfo);
|
|
|
- strftime (fname,sizeof(fname),"%4Y-%2m.zip",timeinfo);
|
|
|
+ strftime (fname,sizeof(fname),"%4Y-%2m-%d-%H-%M-%S.zip",timeinfo);
|
|
|
DEBUG_INFO("fnamePlusPath =%s\n",fnamePlusPath);
|
|
|
if((access(fnamePlusPath,F_OK))!=-1)
|
|
|
{
|
|
@@ -10105,6 +10099,7 @@ void handleBootNotificationResponse(char *payload, int gun_index)
|
|
|
|
|
|
BootNotificationInterval = ShmOCPP16Data->BootNotification.ResponseHeartbeatInterval = intervalInt;
|
|
|
HeartBeatWaitTime = BootNotificationInterval;
|
|
|
+ clientTime.Heartbeat=time((time_t*)NULL);
|
|
|
|
|
|
|
|
|
|
|
@@ -13691,6 +13686,7 @@ int ftpFile(char *location, char *user, char *password, int port, char *path, ch
|
|
|
|
|
|
memset(ftpbuf, 0, sizeof(ftpbuf));
|
|
|
|
|
|
+
|
|
|
|
|
|
sprintf(ftpbuf, "ftpput -u %s -p %s %s -P %d %s%s %s",user,password,IPbuffer,port,path,filename,fnamePlusPath);
|
|
|
DEBUG_INFO("ftpbuf=%s\n",ftpbuf);
|