|
@@ -21,7 +21,7 @@
|
|
|
#define TMR_IDX_LOGPPRINTOUT 2
|
|
|
#define TMR_IDX_PROFILE_PREPARE 3
|
|
|
#define TMR_IDX_PWN_CHANGE 4
|
|
|
-#define TMR_IDX_5 5
|
|
|
+#define TMR_IDX_CHECK_TASK 5
|
|
|
#define TMR_IDX_6 6
|
|
|
#define TMR_IDX_7 7
|
|
|
#define TMR_IDX_8 8
|
|
@@ -2972,6 +2972,8 @@ void checkTask()
|
|
|
DEBUG_WARN("OcppBackend watch dog timeout task restart.\n");
|
|
|
ShmOCPP16Data->procDogTime = time((time_t*)NULL);
|
|
|
system("pkill OcppBackend");
|
|
|
+ sleep(3);
|
|
|
+ ocpp_process_start();
|
|
|
}
|
|
|
|
|
|
if(system("pidof -s OcppBackend > /dev/null") != 0)
|
|
@@ -2987,6 +2989,8 @@ void checkTask()
|
|
|
DEBUG_WARN("OcppBackend20 watch dog timeout task restart.\n");
|
|
|
ShmOCPP20Data->procDogTime = time((time_t*)NULL);
|
|
|
system("pkill OcppBackend20");
|
|
|
+ sleep(3);
|
|
|
+ ocpp_process_start();
|
|
|
}
|
|
|
|
|
|
if(system("pidof -s OcppBackend20 > /dev/null") != 0)
|
|
@@ -3571,16 +3575,24 @@ int main(void)
|
|
|
//==========================================
|
|
|
ShmSysConfigAndInfo->SysInfo.OcppConnStatus = ocpp_get_connection_status();
|
|
|
|
|
|
- //==========================================
|
|
|
- // Check task processing
|
|
|
- //==========================================
|
|
|
- if(ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_BOOTING)
|
|
|
- checkTask();
|
|
|
+ //==============================================
|
|
|
+ // Period check for 10 seconds
|
|
|
+ //==============================================
|
|
|
+ if(DiffTimebWithNow(startTime[0][TMR_IDX_CHECK_TASK]) > 10000)
|
|
|
+ {
|
|
|
+ //==============================================
|
|
|
+ // Check task processing
|
|
|
+ //==============================================
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_BOOTING)
|
|
|
+ checkTask();
|
|
|
|
|
|
- //==========================================
|
|
|
- // Check connection timeout specification
|
|
|
- //==========================================
|
|
|
- checkConnectionTimeout();
|
|
|
+ //==============================================
|
|
|
+ // Check connection timeout specification
|
|
|
+ //==============================================
|
|
|
+ checkConnectionTimeout();
|
|
|
+
|
|
|
+ ftime(&startTime[0][TMR_IDX_CHECK_TASK]);
|
|
|
+ }
|
|
|
|
|
|
//==========================================
|
|
|
// Something need run in Idle mode
|
|
@@ -3955,7 +3967,7 @@ int main(void)
|
|
|
case START_METHOD_RFID:
|
|
|
if((ocpp_get_auth_conf()) ||
|
|
|
(!ocpp_get_connection_status() && ((ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE) || (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_NOCHARGE))) ||
|
|
|
- (!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST) && (strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") == 0)))
|
|
|
+ (!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST) && (DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > 2000)))
|
|
|
{
|
|
|
if(ocpp_get_auth_result(gun_index) ||
|
|
|
(!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)) ||
|
|
@@ -4177,7 +4189,7 @@ int main(void)
|
|
|
{
|
|
|
if(ocpp_get_auth_conf() ||
|
|
|
(ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) ||
|
|
|
- (!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST) && (strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") == 0)) ||
|
|
|
+ (!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST) && (DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > 2000)) ||
|
|
|
(!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)))
|
|
|
{
|
|
|
if(ocpp_get_auth_result(gun_index) ||
|
|
@@ -4525,7 +4537,7 @@ int main(void)
|
|
|
{
|
|
|
if(ocpp_get_auth_conf() ||
|
|
|
(ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE) ||
|
|
|
- (!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST) && (strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") == 0)) ||
|
|
|
+ (!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST) && (DiffTimebWithNow(startTime[gun_index][TMR_IDX_AUTH]) > 2000)) ||
|
|
|
(!ocpp_get_connection_status() && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_FREE)))
|
|
|
{
|
|
|
if(ocpp_get_auth_result(gun_index) ||
|