|
@@ -178,6 +178,7 @@ static int GbPreviousConnectorPlugIn[GB_QUANTITY];
|
|
|
static int AcPreviousConnectorPlugIn[AC_QUANTITY];
|
|
|
static int TransactionMessageAttemptsValue = 0;
|
|
|
static int TransactionMessageRetryIntervalValue = 0;
|
|
|
+static int TempMeterValueInterval = 0;
|
|
|
static struct OCPPAuthLocalElemet
|
|
|
{
|
|
|
int listVersionInt;
|
|
@@ -1051,7 +1052,10 @@ int InitShareMemory()
|
|
|
ShmOCPP16Data->GetConfiguration.ResponseUnknownKey = staticResponseUnknownKey;
|
|
|
ShmOCPP16Data->SendLocalList.LocalAuthorizationList = staticLocalAuthorizationList;
|
|
|
|
|
|
- return result;
|
|
|
+
|
|
|
+ TempMeterValueInterval = 0;
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1126,6 +1130,27 @@ char * stringtrimspace( char * s )
|
|
|
return (s);
|
|
|
}
|
|
|
|
|
|
+int isOFFline(void)
|
|
|
+{
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.InternetConn == 0)
|
|
|
+ {
|
|
|
+ if(TempMeterValueInterval >= (atoi((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValueSampleInterval].ItemData)- 1 ) )
|
|
|
+ {
|
|
|
+ TempMeterValueInterval = 0;
|
|
|
+ return TRUE;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ TempMeterValueInterval = TempMeterValueInterval+ 1;
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1395,7 +1420,7 @@ void CheckSystemValue(void)
|
|
|
|
|
|
|
|
|
|
|
|
- if( ((time((time_t*)NULL) - clientTime.MeterValues[gun_index])> (atoi((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValueSampleInterval].ItemData)- 1 ) ) )
|
|
|
+ if((isOFFline() == TRUE) || ((time((time_t*)NULL) - clientTime.MeterValues[gun_index])> (atoi((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValueSampleInterval].ItemData)- 1 ) ) )
|
|
|
{
|
|
|
|
|
|
if(gunType[gun_index] == 'J')
|
|
@@ -15995,7 +16020,7 @@ void SetTransactionIdZero(int transactionId)
|
|
|
temptransactionId = atoi(revbuf[2]);
|
|
|
if(transactionId != temptransactionId)
|
|
|
{
|
|
|
- fprintf(fptr2, "%s", strtemp);
|
|
|
+ fprintf(fptr2, "%s\n", strtemp);
|
|
|
}
|
|
|
|
|
|
}
|