|
@@ -102,7 +102,7 @@ static int TransactionQueueNum = 0;
|
|
|
static int OfflineTransactionQueueNum = 0; // Number of offline transactions
|
|
|
static int OfflineTransaction = 0;
|
|
|
static int IsUsing = FALSE;
|
|
|
-static int IsFinished = FALSE;
|
|
|
+
|
|
|
|
|
|
int defaultWaitingTime = 10; //10 second
|
|
|
char OcppPath[160]={0};
|
|
@@ -717,7 +717,7 @@ void* ConnectWsServer(void* data) //int ConnectWsServer()
|
|
|
|
|
|
memset(&ContextInfo, 0, sizeof(struct lws_context_creation_info));
|
|
|
|
|
|
- if((GetOcppServerURL()==0) || (GetOcppPort() == 0) || (GetOcppPath()==0) )
|
|
|
+ if((GetOcppServerURL()==0) || (GetOcppPort() == 0) || (GetOcppPath()==0))
|
|
|
{
|
|
|
//result = FAIL;
|
|
|
DEBUG_ERROR("OCPP URL is NULL or OCPP Port is zero or OCPP Path is NULL\n");
|
|
@@ -1544,13 +1544,10 @@ int queue_operation(int type, char *frontUUID, char *frontData)
|
|
|
}
|
|
|
|
|
|
//pthread_mutex_unlock(&lock_sentData);
|
|
|
-
|
|
|
- //IsFinished = TRUE;
|
|
|
IsUsing = FALSE;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- //IsFinished = FALSE;
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -1729,10 +1726,9 @@ int main(void)
|
|
|
|
|
|
for(;;)
|
|
|
{
|
|
|
- while(ConnectionEstablished==0)
|
|
|
+ while((ConnectionEstablished==0)&&(GetInternetConn() == 1)) // Check InternetConn 0: disconnected, 1: connected
|
|
|
{
|
|
|
SetOcppConnStatus(FALSE);
|
|
|
-
|
|
|
if((time((time_t*)NULL)-startTime.connect)>=60)
|
|
|
{
|
|
|
#ifdef Debug
|
|
@@ -1746,6 +1742,7 @@ int main(void)
|
|
|
// Check System Value, process offline Transaction
|
|
|
CheckSystemValue();
|
|
|
lws_service(context, 10000);//timeout_ms
|
|
|
+ usleep(1000);
|
|
|
}
|
|
|
|
|
|
if(( (BootNotificationInterval != 0 && ((time((time_t*)NULL)-startTime.bootNotification)>=BootNotificationInterval) ) || ((time((time_t*)NULL)-startTime.bootNotification)>=defaultWaitingTime) ) && ((server_sign == FALSE)/*|| (server_pending == TRUE)*/))
|